#ifdef _DEBUG
freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
#endif
# | User | Rating |
---|---|---|
1 | tourist | 3845 |
2 | jiangly | 3707 |
3 | Benq | 3630 |
4 | orzdevinwang | 3573 |
5 | Geothermal | 3569 |
5 | cnnfls_csy | 3569 |
7 | jqdai0815 | 3532 |
8 | ecnerwala | 3501 |
9 | gyh20 | 3447 |
10 | Rebelz | 3409 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 171 |
2 | adamant | 163 |
3 | awoo | 162 |
4 | nor | 153 |
5 | maroonrk | 152 |
6 | -is-this-fft- | 151 |
7 | TheScrasse | 150 |
8 | Petr | 145 |
9 | atcoder_official | 144 |
9 | pajenegod | 144 |
#ifdef _DEBUG
freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
#endif
Name |
---|
#ifdef _DEBUG
and#endif
are C++ preprocessor directives that conditionally compile the code inside this block when the_DEBUG
flag is defined either in the compiler call asgcc .... -D_DEBUG
or inside the program source as#define _DEBUG
. C++ Preprocessorfreopen("input.txt", "r", stdin);
andfreopen("output.txt", "w", stdout)
are C library function calls that reusestdin
andstdout
standard input and standard output stream file pointers as file pointers to the filesinput.txt
andoutput.txt
, respectively. Subsequent standard C stream input/output function calls such asscanf()
,printf()
,getchar()
,putchar()
,puts()
etc. that read/write data from/to stdin/stdout are redirected to read/write data from/to the filesinput.txt
/output.txt
. This saves the typing and/or copy-and-paste time of the program input data during the debugging phase, and stores the program output data in file instead or printing it to the computer screen. FILE * freopen ( const char * filename, const char * mode, FILE * stream )