답안 #1112615

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1112615 2024-11-14T12:24:24 Z vjudge1 Bliskost (COI23_bliskost) C++17
0 / 100
1 ms 336 KB
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define a2b(a, b) (a << b) // a*2^b
#define bit(a, b) ((a >> b) & 1) // bth bit from the right, starts at zero
#define n1p(x) (x%2==1?-1:1) // (-1)^x
using namespace std;
template<class T> using vec = vector<T>;

const int INFTY = (1LL << 63) - 1;
const int NNFTY = 1LL << 63;

int32_t main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n, q; cin >> n >> q;
    string s1, s2; cin >> s1 >> s2;
    int mod27 = 0;
    for (int i = 0; i < n; i++) {
        mod27 += n1p(i)*(s1[i] - s2[i]);
    }
    cout << "ne\n\0da\n" + 4*(mod27%27==0);
    while (q--) {
        int i; char c; cin >> i >> c; i--;
        mod27 -= n1p(i)*s1[i];
        mod27 += n1p(i)*c;
        s1[i] = c;
        cout << "ne\n\0da\n" + 4*(mod27%27==0);
    }
}

Compilation message

Main.cpp:10:31: warning: integer overflow in expression of type 'long long int' results in '9223372036854775807' [-Woverflow]
   10 | const int INFTY = (1LL << 63) - 1;
      |                   ~~~~~~~~~~~~^~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -