#include <iostream>
usingnamespace std;
int main(){
int a=0;
int b=0;
int c=0;
cin >> a;
for(int i=0; i < a ;i++){
cin >> b >> c;
if (b < c) cout << "NO BRAINS\n";
elseif(b >= c) cout << "MMM BRAINS\n";
}
//system("pause");
}
Input
The first line contains a single integer n indicating the number of data sets.
The following n lines each represent a data set. Each data set will be formatted according to the following description:
A single data set consists of a line "X Y", where X is the number of brains the zombie eats and Y is the number of brains the zombie requires to stay alive.
Output
For each data set, there will be exactly one line of output. This line will be "MMM BRAINS"if the number of brains the zombie eats is greater than or equal to the number of brains the zombie requires to stay alive. Otherwise, the line will be "NO BRAINS".
Sample Input
3
4 5
3 3
4 3
Sample Output
NO BRAINS
MMM BRAINS
MMM BRAINS
i got 0.00008 second but somepeople got 0.00000 second for this problem
Presumably you want to increase the speed, and probably the speed of execution, rather than that of compiling.
This looks like an online judge problem. Use C input functions instead of C++ as usually recommended by such sites.
Also, on many of those sites, when you've solved a problem you can access other people's solutions to the same problem. Viewing those might be helpful to you.