C++ flags & HW Limits (Codingame)

Votre programme est compilé et exécuté dans un environnement Linux sur une architecture multi-coeurs 64bits. - Environment/lang

SIGSEGV will often been seen as Timeout by the Codingame engine (without any clue given). see Stacktrace - for a quick Signal handler that could help diagnosing this situation.

Limits

Your program is compiled and run in a Linux environment on a 64bit multi-core architecture.

  • 1 cpu
  • Memory limits is 768MB - forum
  • source code is 100k chararcters

Ruby 2.6.2

C++ as of 21/04

compiler: g++ 11.2.0 mode C++17
flags: -std=gnu++17 -Werror=return-type -g -pthread 
libraries: -lm -lpthread -ldl -lcrypt

c++ optimization trick

// trigger optimisation from source file
#pragma GCC optimize("O3")
#pragma GCC optimize("inline")
#pragma GCC optimize("omit-frame-pointer")
#pragma GCC optimize("unroll-loops") //Optimization flags

#pragma GCC optimize("Ofast")

#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx")  //Enable AVX
#pragma GCC target "bmi2"
#include <x86intrin.h> //AVX/SSE Extensions
Written on December 18, 2017, Last update on March 28, 2024
c++ codingame