Help Solve Div2 Task With Bigger Constraints

Revision en1, by Ibrahim-Elsayed, 2022-03-31 01:49:16

i recently solved this problem: https://codeforces.com/contest/1097/problem/B,

I know that it's an easy problem with a brute-force solution but, I'm curious how to solve it for $$${1 <= N <= 10^5}$$$, I'd appreciate your help, thanks in advance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Ibrahim-Elsayed 2022-03-31 01:49:16 289 Initial revision (published)