Closed MdNihal05 closed 10 months ago
I am not allowed to see your second link, and the first one is not loading, anyways I think this is more related to how your debug functions are written, at the moment there is no config around debug statements
Please take a closer look to the section linked below , specially notice the special flag -DDEBUG which helps us to just include parts of the code only when that flag is set. Then obviously codeforces does not set that flag and therefore the debugging code is not included at all in the execution, neither your compile/execution command should include that flag.
https://searleser97.github.io/cpbooster/docs/debug#print-debug-lines-in-red-in-c
thanks for looking in to the issue
i update the link you can see here
and my config file is attached below
and my issue is attached below
i submited the code and got accepted but where i run cpbooster test file.cpp it showing error because of the debug statements
how should i debug can you share any picture or something so that i can understand here is my templete and this is my debug
your debug statements should no be printing when running Test, could you send an screenshot of the output of your program without using cpbooster? Like compiling with the same command that you have in the config, and then just executing as normal to see if there is any difference in the output
you can see here
and i can't submit when iam using proxy since i use college proxy iam getting error
can you fix that
That is the output without your flag ? Then that is the problem, why your debug statements get printed even when you are not passing the debug flag ?
For the proxy thing please create a different issue in this repo, will try to investigate and see if there is something I can do about it
it is because i called debug function inside my code you can see my accepted submission this is what i generally do to check my output there is not way to fix it ?
and for proxy thing i will create a new issue thanks
so, your code should not print any debugging text if you did NOT set the flag -DONLINEJUDGE
It should only print them if you set the flag, there is something you are doing on local that is not same as in codeforces, can't figure out what it is yet.
Could you literally run the :Test command with the code from the codeforces link? I mean copy and paste it from codeforces, not from your local machine, and see what is the output in cpbooster
i copied the same code i submitted before and i cloned problem and them submitted the same code so i can test but giving wa because of debug statements
i habituate to looking the outputs by calling debug function if it is correct than i will sumit it directly
even i did the same here it got sumitted successfully but when i test it it showing wa
so was curious to solve the issue without commenting the debug(....) function in my code
it's taking too long sorry for the inconvenience and can't we see the status of submissoin in vim itself ?
I just reproduced the issue
?
so, I just learned that "codeforces" add the flag "ONLINE_JUDGE" so basically you are doing the opposite, you are saying in your code: If you DON'T see the "ONLINE_JUDGE" flag then print debug stuff, otherwise just hide it, the issue is that then you should add this "ONLINE_JUDGE" flag in the "compilation command"
so that the command from codeforces and from cpbooster is the same
however, I do recommend changing it to the opposite I don't think the "ONLINE_JUDGE" is added by all judges, therefore this might not be compatible if you submit to some other place like AtCoder, OmegaUp, etc...
In the link I sent before I explained how to do it with the "DEBUG" flag instead of "ONLINE_JUDGE"
https://searleser97.github.io/cpbooster/docs/debug#print-debug-lines-in-red-in-c
you are saying that i should add
debugCommand : g++ -std=gnu++17 -ONLINE_JUDGE -Wshadow -Wall
instead of debugCommand : g++ -std=gnu++17 -DONLINE_JUDGE -Wshadow -Wall
or something else
can you tell me where should i change the command what should i add for specially codeforce because i haven't tried other you can tell here changing flag specially for codeforces
debug command should not include any flag for your code to work, but then in "command" you should include it
you mean i should remove `#ifdef ONLINE_JUDGE debug(...);
from my code ?
no
just modify the "config" file
"languages": {
"cpp": {
"template": "",
"command": "g++ -std=gnu++17 -DONLINE_JUDGE -O2",
"debugCommand": "g++ -std=gnu++17 -Wshadow -Wall",
which statement should i add to this
13 cpp : {
14 template : "",
15 command : g++ -std=gnu++17 -O2 ,
16 debugCommand : g++ -std=gnu++17 -DONLINE_JUDGE -Wshadow -Wall ,
17 aliases : {
18 codeforces : 54 ,
19 atcoder : 4003 ,
20 omegaup : cpp17-gcc ,
21 szkopul : C++ ,
22 yandex : gcc7_3
23 },
24 type : compiled ,
25 commentString : //
26 },```
ok thanks i will try this
it worked thanks for your patience and you can close this issue if you can help me with proxy stuff try to fix it please
however I do recommend to do the opposite as I explain in the documentation link, ONLINE_JUDGE flag will only work for codeforces but not other judge, and I also recommend understanding your template entirely
why iam getting this error for atcoder
iam new to atcoder so i created account and tried to submit
i even tried by changing config to default
its working fine for codeforces
When we use our own debug template which prints output for us
For example like this
For more clarity see here
We can submit without removing the debug functions
But when we test using:Test or cpb test it gives WA
It should ignore debug statements and compare actual output
How to fix that any modifications in config file ?