#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
int n,a,b,c;
char arr[200005];
signed main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
for(int i=1;i<=n;i++){
cin >> arr[i];
if(arr[i]=='1'){
a++;
}
else if(arr[i]=='2'){
b++;
}
else if(arr[i]=='3'){
c++;
}
}
vector<int> v = {a,b,c};
while(v[0]+v[1]+v[2]!=3){
sort(v.begin(),v.end());
v[2]--;
v[1]--;
v[0]++;
}
sort(v.begin(),v.end());
if(v[2]>1){
cout << "NE" << "\n";
}
else{
cout << "DA" << "\n";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |