0x0002's blog

By 0x0002, history, 4 weeks ago, In English

I was solving problem F of ABC just now. And I got passed with long long, but when I change the type into __int128_t, it got wrong answer in most of the cases. Why is that?

Passed with long long.

Wrong answer with int128.

Upd: It is said that __int128_t can not be the index of array. It may cause wrong answer. So it is always not a good idea to use things like #define int __int128_t.

Upd2: I just tested some other things on AtCoder about __int128_t, it seems template<typename> may work incorrectly with __int128_t. That's from my function read(). I searched for many times in Google but have not found why.

Full text and comments »

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

By 0x0002, history, 5 months ago, In English

As we know, if someone cheated in a contest, using other contestants' codes, his solution will be skipped.

But, Codeforces allows to use code which was published online before the contest.

So my question is that how Codeforces determines if or if not the code was published online before?

Full text and comments »

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

By 0x0002, history, 9 months ago, In English

I think I am ok with algorithm problems, but I am so bad in problems like greedy, constructive problems, interactive problems. The problem A, B and C in div2 are often problems like that. I often can't find the key observation. How to practise? Just doing more problems like that or something else?

Full text and comments »

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

By 0x0002, history, 9 months ago, In English

I was trying to solve 25E, I used hash and passed it, this is my submission. There is also a similar problem in SPOJ, link. The difference is only that the problem in SPOJ has $$$T$$$ test cases, where codeforces has only one.

I clear for every test, but got wrong answer in SPOJ. Is my algorithm wrong or there is some corner cases i didn't realize? Thanks.

Full text and comments »

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

By 0x0002, history, 9 months ago, In English

I want to solve a problem, which includes three operations: add an edge, delete an edge, and check if the undirected graph is connected. Both online or offline algorithm is ok. How to solve it for $$$n,m \le 10^5$$$?($$$n$$$ denotes the number of vertexs, $$$m$$$ denotes the number of operations.)

Full text and comments »

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