Блог пользователя dx24816

Автор dx24816, история, 8 лет назад, По-английски

Hello,

I use to include the following code into my headers because I saw others doing the same.

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

For the most part, it has made some of my programs that previously got TLE get AC. However I recently kept getting TLE with these comments in the header of my program for a problem, and when I removed them, I got AC. So I'm wondering what do these comments do, and when should I use them? Thanks in advance!

Edit:

Here is the TLE: http://codeforces.me/contest/1009/submission/40353118

Here is the AC: http://codeforces.me/contest/1009/submission/40353105

You can check the only difference is the pragma.

-dx24816

  • Проголосовать: нравится
  • +14
  • Проголосовать: не нравится

»
8 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Please give examples of removing these giving AC.

BTW, if this is for USACO, I think they will switch you to optimize level 0 if you use any of these flags. So don't try it there.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Can anyone say what the following line actually do?

#pragma comment(linker, "/stack:200000000")
»
5 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

https://codeforces.me/contest/1009/submission/153624213 submit it again and get AC

UPD: Sorry I didn't notice the time of this blog, I think it might be because of the judge have been update.