#11824: 為何TLE?


fudan1030199 (樓上真智障)


#include<iostream>
using namespace std;
int main(){
double a,b;
while(cin>>a>>b){
for(int timer=0;a>0;timer++){
a-=1+timer*b;
}
if(a==0){
cout<<"Go Kevin!!"<<endl;
}
else{
cout<<"No Stop!!"<<endl;
}
}
}

最後一個測資TLE...

#11825: Re:為何TLE?


HSUxMichael (IAmTotallyExhausted)


#include
using namespace std;
int main(){
double a,b;
while(cin>>a>>b){
for(int timer=0;a>0;timer++){
a-=1+timer*b;
}
if(a==0){
cout<<"Go Kevin!!"<<endl;
}
else{
cout<<"No Stop!!"<<endl;
}
}
}

最後一個測資TLE...

n=2147483647,m=0