Time Complexity Variation

Правка en1, от xINFERNOx, 2021-12-17 22:40:08

Why the second code executes within 500ms whereas the first one gives TLE(2000ms) ?

1497E1 - Square-Free Division (easy version)

const int N = 1e7 + 5;
vector<int> maping(N);
int i,j;
Code 1
Code 2
Теги number theory, sieve of eratosthenes, #sieve, doubt

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский xINFERNOx 2021-12-17 22:40:08 709 Initial revision (published)