Submission #839285

# Submission time Handle Problem Language Result Execution time Memory
839285 2023-08-29T15:03:09 Z serifefedartar Bliskost (COI23_bliskost) C++17
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;
 
#define debug(x) {cout << #x << ": "; for (auto it : x) cout << it << " ";cout << endl;}
#define fast ios::sync_with_stdio(0);cin.tie(0);
typedef long long ll;
#define f first
#define s second
#define MOD 1000000007
#define LOGN 15
#define MAXN 100005
 
int main() {
	fast
	int N, Q;
	cin >> N >> Q;
 
	string S, T;
	cin >> S >> T;
	int even = 0, odd = 0;
	for (int i = 0; i < N; i+=2)
		even += T[i] - S[i];
	for (int i = 1; i < N; i+=2)
		odd += T[i] - S[i];
 
	if ((even % 26) == (odd % 26))
		cout << "da\n";
	else
		cout << "ne\n";
 
	while (Q--) {
		int plc; char ch;
		cin >> plc >> ch;
		plc--;
		if (plc % 2)
			odd += S[plc] - ch;
		else
			even += S[plc] - ch;
 
		if ((even % 26) == (odd % 26))
			cout << "da\n";
		else
			cout << "ne\n";		
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -