Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

How should I set up my local envorinment for C++17?

Revision en2, by MaxWelll, 2024-08-02 10:15:13

I just got a WA verdict from the sample case in a problem that worked on my machine.

The issue was that I had some out-of-boundaries access in a vector. It happens. But the scary part is that it worked on my machine without any complaints.

I saw Mike's post about adding C++17 and it says and I quote:

The exact compilation command line is:

g++.exe -static -DONLINE_JUDGE -Wl,--stack=268435456 -O2 -std=c++17 -o %name%.exe %1 2>compilation.log`

First I tried copying the options but -Wl,--stack=268435456 doesn't work for me. I'm not sure what they do, options for the linker?

I'm using GNU/Linux (Ubuntu 24.04 to be more precise), and my compilation command is

g++ "$filename.cpp" -static -Wall -pedantic -O2 -std=c++17 -DEMWAVE -o "$filename"

I also tried some options that ChatGPT suggested but I could still run my program locally without any indication that something was wrong.

UPD

The WA verdict instead of Runtime Error indicates that the program didn't fail. Codeforces likely just ran a diagnostic after the WA verdict.

I'm not sure running a diagnostic before every submission is worthwhile.

Tags c++17, setup, compilation

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English MaxWelll 2024-08-02 10:15:13 233 adding some update about the WA veredict
en1 English MaxWelll 2024-08-02 09:43:58 1037 Initial revision (published)