# AMR15A - Editorial

### Panel Members

Problem Setter: Suhash
Problem Tester:
Editorialist: Sunny Aggarwal
Russian Translator:
Mandarin Translator:
Vietnamese Translator:
Language Verifier:

Cakewalk

### PREREQUISITES:

Simple, Input processing, Basic Maths.

### PROBLEM:

Given a list of integers. We are asked to report whether the number of even integers is more than the number of odd integers or not.

### EXPLANATION

This is a simple problem and can be solved by simply counting the number of even/odd integers.

Basic C++ Code:

```int main() {
int n; cin >> n;
int cnt = 0;
for(int i=1; i<=n; i++) {
int x; cin >> x;
if( x % 2 == 0 ) cnt ++;
}
puts( cnt > n - cnt ? "READY FOR BATTLE" : "NOT READY" );
return 0;
}
```

Basic Java Code:

```public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int cnt = 0;
for(int i=1; i<=n; i++) {
int x;
x = sc.nextInt();
if( x % 2 == 0 ) {
cnt ++;
}
}
System.out.println( cnt > n - cnt ? "READY FOR BATTLE" : "NOT READY" );
}
```

Basic Python Code:

```import sys
f = sys.stdin
cnt = 0
A = [int(x) for x in f.readline().split()]
for i in range(0, n):
if A[i] % 2 == 0:
cnt += 1
if cnt > n - cnt:
else:
```

O(N)

O(1)

### SIMILAR PROBLEMS

Distinct Codes

Black And White Cells

Chef And Easy Problem

import java.io.*;
public class in
{
public static void main(String args[])throws IOException
{
int n,a,i,j=0,c=0;
for(i=0;i<n;i++)
{
if(a%2==0)
c++;
else
j++
}
if(c>b)
else
}
}

import java.io.*;
public class in
{
public static void main(String args[])throws IOException
{
int n,a,i,j=0,c=0;
for(i=0;i<n;i++)
{
if(a%2==0)
c++;
else
j++
}
if(c>b)
else
}
}

#include
#include
using namespace std;
int main()
{
int n,ev=0,od=0;
int a[100];
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
if(a[i]%2==0)
ev++;
else
od++;
}
if(ev>od)
else
return 0;
}

#include

using namespace std;

int main()

{

int a[100],n,i,ev,od;

ev=0;

ev=0;

cin>>n;

for(i=0;i<n;i++)

{

cin>>a[i];

}

for(i=0;i<n;i++)

{

if((a[i]%2)==0)

{

ev++;

}

else

{

od++;

}

}

if(ev>od)

{

}

else

{

}
return (0);

}

whats wrong with this code? why is it not entering the loop?
#include<stdio.h>
void main()
{
int N,i,b=0;
int A[100];
scanf("%d",&N);
for(i=1;i<=N;i++)
{
scanf("%d",&A[i]);
}
for(i=1;i<=N;i++)
{
if(A[i]%2==0)
b=b+1;
}
if(b>N-b)