-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1030_In_Search_of_an_Easy_Problem.cpp
More file actions
53 lines (46 loc) · 1.89 KB
/
Copy path1030_In_Search_of_an_Easy_Problem.cpp
File metadata and controls
53 lines (46 loc) · 1.89 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* A. In Search of an Easy Problem
time limit per test 1 second
memory limit per test 256 megabytes
When preparing a tournament, Codeforces coordinators try treir best to make the first problem as easy as possible.
This time the coordinator had chosen some problem and asked npeople about their opinions. Each person answered whether this problem is easy or hard.
If at least one of these npeople has answered that the problem is hard, the coordinator decides to change the problem.
For the given responses, check if the problem is easy enough.
Input
The first line contains a single integer n (1≤n≤100) — the number of people who were asked to give their opinions.
The second line contains n integers, each integer is either 0 or 1. If i-th integer is 0, then i-th person thinks that the problem is easy;
if it is 1, then i-th person thinks that the problem is hard.
Output
Print one word: "EASY" if the problem is easy according to all responses, or "HARD" if there is at least one person who thinks the problem is hard.
You may print every letter in any register: "EASY", "easy", "EaSY" and "eAsY" all will be processed correctly.
Examples:
Input:
3
0 0 1
Output:
HARD
Input:
1
0
Output:
EASY
Note:
In the first example the third person says it's a hard problem, so it should be replaced.
In the second example the problem easy for the only person, so it doesn't have to be replaced.
*/
#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main(){
int i,j;
int n;
cin>>n;
vector<int> arr(n);
for(i=0;i<n;i++){
cin>>arr[i];
}
int x = 1;
if (binary_search(arr.begin(), arr.end(),x))
cout << "HARD";
else
cout <<"EASY";
}