programming speed question

Hello guys
these days im big concerning about the speed issue
this is my code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>

using namespace 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";
		else if(b >= c) cout << "MMM BRAINS\n";

	}
	//system("pause");

}


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

 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

How u decrease the compiling speed?
How u decrease the compiling speed?


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.
Or sync_with_stdio(false)

By the way, you are doing
1
2
3
4
if( condition )
   //...
else if( not condition ) 
   //... 
The else would not be reached if condition were true.

Also, use better names for the variables.
Topic archived. No new replies allowed.