Gerald's blog

By Gerald, 5 years ago, translation, In English,

411A - Password Check

In the first problem you should correctly implement what was written in statement. It could be done like this:

string s;
cin >> s;
bool upper = false, lower = false, digit = false;
for(int i= 0; i < s.size(); ++i){
        upper = true;
        lower = true;
        digit = true;
puts((upper && lower && digit && s.size() >= 5) ? "Correct" : "Too weak");

411B - Multi-core Processor

In this problem you should read the statement carefully, consider some principal cases and implement them in your program. The author's solution is:

  1. We will store array$blockedCell[]$ (value in cell i equals 1 if this cell is blocked, 0 otherwise), blockedCore[]$ (value in cell i equals 0, if this core is not blocked and the number cycle when this core is blocked otherwise).
  2. Consider all cycles from the first to the last. Consider the cycle number k.
  3. Consider all processors and calc what cells will blocked on the cycle k. Set values one to corresponding cells of array blockedCell[]
  4. Then for each core i if conditions blockedCore[i] = 0 and blockedCell[x[i][k]] = 1 meet then core i is blocked on cycle k. Set blockedCore[i] = k.

411C - Kicker

To solve this problem you should use logic (mathematic logic) :] Logic says:

  1. If for some arrangement of the first team there is no arrangement to have even a draw then the first team is guaranteed to win.
  2. If for any arrangement of the first team there is some arrangement for the second team when the second team wins then the second team is guaranteed to win.
  3. Otherwise nobody is guaranteed to win. The answer is Draw.

This logic should be implemented in your program. I could be done considering each arrangement of every team.

  • Vote: I like it  
  • +34
  • Vote: I do not like it  

5 years ago, # |
  Vote: I like it -8 Vote: I do not like it