Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

kingofnumbers's blog

By kingofnumbers, 14 years ago, In English

Hi, Just take look how I solved 242E — XOR on Segment

here is my code

the time limit for this problem is 4000ms and the running time for my code is 4000ms :) :] :D

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

»
14 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

You are really king of numbers :D Nice submit!

»
14 years ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

nice (:

»
14 years ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

:|

»
14 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

Same kind of thing happened on SRM 543. A loop from 1 to 4*10^9 passed system tests(and hacks) within 2 secs. link

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

I guess the 'count' and 'tmp' variables are used to reduce additions to 'sum', which is long long. Nice work!

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

I think the major reason is compiler optimisation. It's so cool what a compiler can actually do :).

»
14 years ago, hide # |
Rev. 3  
Vote: I like it +5 Vote: I do not like it

Weak test case only, try 10^5 query like this

1 1 10^5
2 1 10^5 1
1 1 10^5
2 1 10^5 2
......

TLE please

»
14 years ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Why the code is correct? Why not TL?