cofoxyz's blog

By cofoxyz, history, 3 months ago, In English,

hi! Recently I found during hack of 57024850,but though it's take 15 second in testcase t=1,n=1000000000,x=100000000 my hacks fails.

It doesn't take time limit in hacks?? Sorry for my poor English.

Thank You!!

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

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

umm try checking the constraints again its x<n and ur x and n are equal, it fails coz of that probs

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

I think it must be optimized by c++ itself

»
3 months ago, # |
  Vote: I like it +10 Vote: I do not like it

Run the code in custom invocation to see its running time in CF environment.

»
3 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Try adding -O2 to your compilation flags locally, then it should be really fast.

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

Looks like it is fast enough, there are at most 10^10 operations, which should run in time.