tobias_tris's blog

By tobias_tris, history, 3 years ago, In English

While solving round 883Div3 — 1846E2 I encountered a strange problem. I want to handle the overflow of long long while doing addition and multiplication. I used Geeks for Geeks logic to handle them and wrote the code 212721992. While it is working locally, Codeforces is giving a wrong answer with a warning of signed integer overflow. Can anyone help me how to handle Overflows in general?

Full text and comments »

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

By tobias_tris, history, 3 years ago, In English

Determine whether it is possible to choose X numbers that are powers of 2 and add up to N.

Full text and comments »

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