This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int cnt[3];
void solve() {
int n; cin >> n;
for (int i = 0; i < n; i++) {
char c; cin >> c;
cnt[c-'1']++;
}
int zeros = 0;
zeros += cnt[0] == 0;
zeros += cnt[1] == 0;
zeros += cnt[2] == 0;
if (zeros > 1 || cnt[0] % 2 != cnt[1] % 2 || cnt[1] % 2 != cnt[2] % 2) {
cout << "NE\n";
} else {
cout << "DA\n";
}
}
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int t = 1;
// cin >> t;
while (t--) {
solve();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |