//author: Ahmet Alp Orakci
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define ONLINE_JUDGE
void solve() {
int n;
cin >> n;
string s;
cin >> s;
int arr[3] {};
for(char &ch : s)
arr[ch - '1']++;
if(arr[0] % 2 != arr[1] % 2 || arr[1] % 2 != arr[2] % 2 || arr[2] % 2 != arr[0] % 2) {
cout << "NE";
return;
} else if(arr[0] == n || arr[1] == n || arr[2] == n) {
cout << "NE";
return;
}
cout << "DA" << "\n";
for(int i = 1; i <= n - 3; i++) {
cout << 1 << " " << 1 << " " << 1 << "\n";
}
return;
}
signed main() {
#ifndef ONLINE_JUDGE
freopen(".in", "r", stdin);
freopen(".out", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int t = 1; //cin >> t;
for(int i = 1; i <= t; i++) {
solve();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |