|
|
#include <iostream> using namespace std; int main() { int m,n,k; cout<<"enter m n k "; cin >> m >> n >> k; if ( m>0 && m<19 ) { if ( k>1 && k<6 ) { if ( n>0 && n<23 ) { cout<<(m+k+n); } else cout<<"enter n between 0 and 23"<<endl; } else cout<<"enter k between 1 and 6"<<endl; } else cout<<"enter m between 0 and 19"<<endl; return 0; } What the answer to test: m k n 12 3 2 18 I got 53 and WA Maybe, someone knows, what is it? I'm pretty sure that testset for this problem doesn't contain maxitests with k=2 and n=22. Otherwise how could program that works about 20sec. on my computer get AC on timus??? You are wrong. Then what supercomputers does timus use??? =) I have Pentium Duo Centrino 3.2 Or you want to say that the whole difference is due to compilers? (I use MSVS C++ 8.0) you can easily test how fast it works on timus online judge.... dont read data from input , run your program when m = 18, k = 2 , and n = 22. I'm sure your solution is fast enough , for example, when I'm using STL classes, program works on my PC 10 times slower than on online judge... use Release option in your compiler Site news contain information about testing computer: Core 2 Quad Q6600 (frequency 2400 MHz, L2 cache 8 MB, bus frequency 1066 MHz). #include<iostream> using namespace std; int main() { int n,k,m,b; cin>>m; cin>>k; cin>>n; b=m+k+n; cout<<b; return 0; } |
|
|