Submission #791419

# Submission time Handle Problem Language Result Execution time Memory
791419 2023-07-24T06:15:01 Z 이성호(#10048) Bliskost (COI23_bliskost) C++17
0 / 100
1 ms 212 KB
#include <iostream>
#include <string>
using namespace std;

int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int N, Q; cin >> N >> Q;
    long long v[2] = {};
    string s[2];
    for (int i = 0; i < 2; i++) {
        cin >> s[i];
        for (int j = 0; j < N; j++) {
            if (j & 1) v[i] -= s[i][j];
            else v[i] += s[i][j];
        }
    }
    cout << (v[0] == v[1] ? "ne" : "da") << '\n';
    while (Q--) {
        int i; char p; cin >> i >> p; --i;
        if (i & 1) v[0] += s[0][i];
        else v[0] -= s[0][i];
        s[0][i] = p;
        if (i & 1) v[0] -= s[0][i];
        else v[0] += s[0][i];
        cout << (v[0] == v[1] ? "ne" : "da") << '\n';
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -