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

Автор RestingRajarshi, 6 лет назад, По-английски

Just a heads up if someone else gets this bug:

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

I usually add these two lines of pragmas in my code. But on submitting it to the POI judge, it gives runtime error 4, and when excluded, it doesn't.

Would also be nice if someone could elaborate on why Runtime error 4 is returned on passing the pragmas.

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

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

With second pragma you allow compiler to use some assembly instructions which are not supported on some machines, and if some judge system uses different machines for compilation and execution, you may encounter such a problem. I'm not sure about POI, but with Yandex system it is exactly such case.