Submission #871665

# Submission time Handle Problem Language Result Execution time Memory
871665 2023-11-11T08:48:23 Z vjudge1 Trobojnica (COCI19_trobojnica) C++17
0 / 110
1 ms 348 KB
//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;
    }

    cout << "DA";
    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;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -