Reminder: in case of any technical issues, you can use the lightweight website m1.codeforces.com, m2.codeforces.com, m3.codeforces.com. ×

kuch_bhi_ni's blog

By kuch_bhi_ni, history, 2 years ago, In English
  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Given the small constraints, you can just generate the string until the nth-ish digit by adding each number to it

str += to_string(i);

then access the nth index

I would recommend solving the harder problem, with n<10^18