As an experiment the Educational Codeforces Round 33 will be rated for Div. 2. ×

himanshujaju's blog

By himanshujaju, history, 2 years ago, In English,

I am stuck on questions "B" and "J" of PSUT Coding Marathon (http://codeforces.com/gym/100687).

My code for "J" ( I believe this is the classroom — lecture greedy problem) : http://pastebin.com/Lnp4VMJL

My code for "B" ( I can only see this as a trivial question, unless I havn't understood the question well enough) : http://pastebin.com/bHL0xcqY

Any hints / cases for any of these questions would be helpful. Thanks!

 
 
 
 

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

For problem B, one detail that isn't really made clear from the problem statement is that all the test IDs have to be distinct. So if one them exactly matches the student's id it has to be that one. Also, I think if there are 10 of the form 12? and the student's id is 123, it has to match one of those.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I did check that if one of them matches perfectly, I print that as the answer. I didnt get your second part.

    • »
      »
      »
      2 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Suppose you have 10 IDs that are "1?" (all grade 10), 1 ID that is "??" (grade 20) and the ID you want to match is 15. Then, one of those "1?" IDs must be the match because they must be exactly the set {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}, so the answer is 10

      • »
        »
        »
        »
        2 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        okay, I will try this. Did you see "J" ?

      • »
        »
        »
        »
        2 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        But this case wouldn't arise in the problem since it's given that every ID contains at most 1 question mark.

      • »
        »
        »
        »
        22 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Do you mean to check the ID with the least '?' .

»
3 months ago, # |
  Vote: I like it -8 Vote: I do not like it

Did you get any bug in J? I am also getting WA and my solution is similar to yours. Thanks.