Submission #1114016

# Submission time Handle Problem Language Result Execution time Memory
1114016 2024-11-18T06:16:05 Z NotLinux Bliskost (COI23_bliskost) C++17
40 / 100
1000 ms 10732 KB
// Author : FatihCihan
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin() , v.end()
#define sz(a) (int)a.size()
void solve(){
	int n,q;
	cin >> n >> q;
	string s1 , s2;
	cin >> s1 >> s2;
	int arr[n];
	for(int i = 0;i<n;i++){
		arr[i] = s2[i] - s1[i];
		if(arr[i] < 0)arr[i] += 26;
	}
	auto get = [&]{
		int tmp[n] = {0};
		for(int i = 0;i<n-1;i++){
			while(arr[i] != tmp[i]){
				tmp[i] = (tmp[i] + 1) % 26;
				tmp[i+1] = (tmp[i+1] + 1) % 26;
			}
		}
		if(arr[n-1] == tmp[n-1])return "da";
		else return "ne";
	};
	cout << get() << endl;
	while(q--){
		int pos;
		char ch;
		cin >> pos >> ch;
		pos--;
		s1[pos] = ch;
		arr[pos] = s2[pos] - s1[pos];
		if(arr[pos] < 0)arr[pos] += 26;
		cout << get() << endl;
	}
}
signed main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	int testcase = 1;//cin >> testcase;
	while(testcase--)solve();
	cerr << 1000.0 * clock() / CLOCKS_PER_SEC << " ms" << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 552 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 552 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 504 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 1 ms 336 KB Output is correct
26 Correct 1 ms 336 KB Output is correct
27 Correct 1 ms 336 KB Output is correct
28 Correct 1 ms 336 KB Output is correct
29 Correct 1 ms 336 KB Output is correct
30 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 552 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 504 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 1 ms 336 KB Output is correct
26 Correct 1 ms 336 KB Output is correct
27 Correct 1 ms 336 KB Output is correct
28 Correct 1 ms 336 KB Output is correct
29 Correct 1 ms 336 KB Output is correct
30 Correct 1 ms 336 KB Output is correct
31 Correct 73 ms 10112 KB Output is correct
32 Correct 74 ms 10112 KB Output is correct
33 Correct 73 ms 10144 KB Output is correct
34 Correct 72 ms 10128 KB Output is correct
35 Correct 70 ms 10112 KB Output is correct
36 Correct 70 ms 10728 KB Output is correct
37 Correct 72 ms 10608 KB Output is correct
38 Correct 69 ms 10128 KB Output is correct
39 Correct 70 ms 10732 KB Output is correct
40 Correct 74 ms 10720 KB Output is correct
41 Correct 68 ms 10124 KB Output is correct
42 Correct 72 ms 10112 KB Output is correct
43 Correct 69 ms 10732 KB Output is correct
44 Correct 71 ms 10144 KB Output is correct
45 Correct 71 ms 10356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 552 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 175 ms 584 KB Output is correct
17 Correct 170 ms 748 KB Output is correct
18 Correct 168 ms 584 KB Output is correct
19 Correct 175 ms 744 KB Output is correct
20 Correct 165 ms 584 KB Output is correct
21 Correct 171 ms 744 KB Output is correct
22 Correct 189 ms 744 KB Output is correct
23 Correct 167 ms 584 KB Output is correct
24 Correct 165 ms 584 KB Output is correct
25 Correct 165 ms 584 KB Output is correct
26 Correct 164 ms 584 KB Output is correct
27 Correct 164 ms 496 KB Output is correct
28 Correct 190 ms 584 KB Output is correct
29 Correct 195 ms 740 KB Output is correct
30 Correct 170 ms 584 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 552 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 504 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 1 ms 336 KB Output is correct
26 Correct 1 ms 336 KB Output is correct
27 Correct 1 ms 336 KB Output is correct
28 Correct 1 ms 336 KB Output is correct
29 Correct 1 ms 336 KB Output is correct
30 Correct 1 ms 336 KB Output is correct
31 Correct 175 ms 584 KB Output is correct
32 Correct 170 ms 748 KB Output is correct
33 Correct 168 ms 584 KB Output is correct
34 Correct 175 ms 744 KB Output is correct
35 Correct 165 ms 584 KB Output is correct
36 Correct 171 ms 744 KB Output is correct
37 Correct 189 ms 744 KB Output is correct
38 Correct 167 ms 584 KB Output is correct
39 Correct 165 ms 584 KB Output is correct
40 Correct 165 ms 584 KB Output is correct
41 Correct 164 ms 584 KB Output is correct
42 Correct 164 ms 496 KB Output is correct
43 Correct 190 ms 584 KB Output is correct
44 Correct 195 ms 740 KB Output is correct
45 Correct 170 ms 584 KB Output is correct
46 Execution timed out 1057 ms 336 KB Time limit exceeded
47 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Correct 1 ms 552 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 1 ms 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 504 KB Output is correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 1 ms 336 KB Output is correct
26 Correct 1 ms 336 KB Output is correct
27 Correct 1 ms 336 KB Output is correct
28 Correct 1 ms 336 KB Output is correct
29 Correct 1 ms 336 KB Output is correct
30 Correct 1 ms 336 KB Output is correct
31 Correct 73 ms 10112 KB Output is correct
32 Correct 74 ms 10112 KB Output is correct
33 Correct 73 ms 10144 KB Output is correct
34 Correct 72 ms 10128 KB Output is correct
35 Correct 70 ms 10112 KB Output is correct
36 Correct 70 ms 10728 KB Output is correct
37 Correct 72 ms 10608 KB Output is correct
38 Correct 69 ms 10128 KB Output is correct
39 Correct 70 ms 10732 KB Output is correct
40 Correct 74 ms 10720 KB Output is correct
41 Correct 68 ms 10124 KB Output is correct
42 Correct 72 ms 10112 KB Output is correct
43 Correct 69 ms 10732 KB Output is correct
44 Correct 71 ms 10144 KB Output is correct
45 Correct 71 ms 10356 KB Output is correct
46 Correct 175 ms 584 KB Output is correct
47 Correct 170 ms 748 KB Output is correct
48 Correct 168 ms 584 KB Output is correct
49 Correct 175 ms 744 KB Output is correct
50 Correct 165 ms 584 KB Output is correct
51 Correct 171 ms 744 KB Output is correct
52 Correct 189 ms 744 KB Output is correct
53 Correct 167 ms 584 KB Output is correct
54 Correct 165 ms 584 KB Output is correct
55 Correct 165 ms 584 KB Output is correct
56 Correct 164 ms 584 KB Output is correct
57 Correct 164 ms 496 KB Output is correct
58 Correct 190 ms 584 KB Output is correct
59 Correct 195 ms 740 KB Output is correct
60 Correct 170 ms 584 KB Output is correct
61 Execution timed out 1057 ms 336 KB Time limit exceeded
62 Halted 0 ms 0 KB -