txingml's blog

By txingml, history, 4 years ago, In English

I want to learn a fast solution for

Bubble Cup 13 - Finals [Online Mirror, unrated, Div. 1] B Valuable Paper

https://codeforces.com/contest/1423

So I click here.

And sort all accepted solutions by Execution Time.

The fastest one is https://codeforces.com/contest/1423/submission/94770930.

I read it carefully and found it is wrong. Then I noticed that it already has been hacked. https://codeforces.com/contest/1423/hacks/669563

Why does a hacked solution display as Accepted? I think it can mislead users.

Full text and comments »

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

By txingml, history, 6 years ago, In English

I found a very strange thing in Educational Codeforces Round 50 F. Relatively Prime Powers.

First, here is a AC code written by me. https://codeforces.com/contest/1036/submission/42680029

And If you add a line "assert(val != 999999999999999956LL);", then this code will fail on test 3. It means test 3 has a case that num = 999999999999999956. https://codeforces.com/contest/1036/submission/42680073

But This is another AC code written by @alonefight, https://codeforces.com/contest/1036/submission/42657108. I ran it in my local environment and compared with my code. The result is surprised.

I used the test case as follow. 1 999999999999999956

My result is 999999998998996625 But @alonefight's result is 999999998998996624

I submitted his code and it still passed all test case. https://codeforces.com/contest/1036/submission/42680102

FYI, my environment is macbook, clion, c++14.

Can anyone tell me why this strange thing happened?

Full text and comments »

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