Please read the new rule regarding the restriction on the use of AI tools. ×

"You can do 1e9 operations per sec". Well, what "the operation" really is?

Revision en2, by shevlopmes, 2023-02-27 21:32:34

Hi Codeforces!

Today I'm writing this blog to express my sad feelings about my lack of knowledge. I was pretty sure that a testing system does around 1e9 operations per a second. That's what everyone have been telling me for last 2 years. The problem, as I think, is that I didn't really question myself what "the operation" is. That's why I made an unsuccessful hack attempt in today's round. Some newbie wrote the code for problem A using this:

for(int i = 0; i < m; ++i){
  for(int j = 0; j < i; ++j){
     if(B[i] == B[j]) {...}
  }
}

m is up to 5*1e4, so even these 5 lines make around 5*1e4*2.5*1e4 = 1.25*1e9 operations. Obvious TL, as I thought. But it wasn't (the solution soon got AC on final tests). I think that by saying "the operation" people actually mean some arithmetic operation like plus, minus, maybe divide, while logic operations may take smaller time. Again, this is only my assumption, and if you know the real explanation to this situation, please write it in the commentary section.

Tags c++

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English shevlopmes 2023-02-27 21:32:34 6 (published)
en1 English shevlopmes 2023-02-27 21:30:55 1109 Initial revision (saved to drafts)