Time complexity

Правка en1, от EternalFire, 2018-10-13 10:58:27

Hi, So far I have known that the time complexity for concatenate two strings is O(n). So

`while (a.length() < b.length()) a = "0" + a;

is O(n^2). But it still passed the TL: http://codeforces.me/contest/1066/submission/44198754

I am wondering why it passed. Could anyone help me?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский EternalFire 2018-10-13 11:00:44 4 Tiny change: 'Hi,\nSo far I ha' -> 'Hi,\n\nso far I ha'
en2 Английский EternalFire 2018-10-13 11:00:10 5
en1 Английский EternalFire 2018-10-13 10:58:27 305 Initial revision (published)