how to calulate compilation time??

1>how to calulate compilation time??
2>wht is the concept of input fie & output file??and string in printf statement is considered as output aswell??

1>how to calulate compilation time??

You don’t care about compile time (this is the time, how long your source code is compiling f.e .cpp -> .exe or .java -> .class). Limit is for running time, here you can roughly assume, that you can do 10.000.000 operation in second (I/O could be problem is some languages)

2>wht is the concept of input fie & output file??

I assume you are writing about program testing. When you have test.exe and you call

test.exe < test.in

your program works exactly the same as you are typing input to your program, but this input is from file.

In deeper detail, if your program needs to read 3 integers a, b, c, you can have test.in file

10
20
30

and program test.cpp

int main() {
    int a, b, c;
    scanf( "%d", &a );
    scanf( "%d", &b );
    scanf( "%d", &c );
    return 0;
}

will read the numbers from input file. Is that what you wantedto know?

string in printf statement is considered as output aswell??

similarly to `< test.in’ you can do

test.exe < test.in > test.out

and your output program will be in test.out file. Internaly CodeChef use it that way and for correct answer it compares test.out generated by your program with the correct one. That means if your program contains

printf( "insert number: "); scanf( "%d", n );

than “insert number” string is in test.out file (try it (-; ), so such program is considered as incorrect - it prints something that problem statement didn’t ask for…

1 Like
//