# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
791405 |
2023-07-24T06:05:44 Z |
GEN 이지후(#10078) |
Bliskost (COI23_bliskost) |
C++17 |
|
1000 ms |
4640 KB |
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pi = array<lint, 2>;
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
const int MAXT = 530000;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, q;
cin >> n >> q;
string s, t;
cin >> s >> t;
auto sol = [&]() {
int ans = 0;
for (int i = 0; i < n; i++) {
if (i % 2 == 0) {
ans += s[i] - 'a';
ans -= t[i] - 'a';
} else {
ans -= s[i] - 'a';
ans += t[i] - 'a';
}
}
ans %= 26;
if (ans == 0)
cout << "da\n";
else
cout << "ne\n";
};
sol();
while (q--) {
int idx;
string chr;
cin >> idx >> chr;
s[idx - 1] = chr[0];
sol();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
3 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
3 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
0 ms |
212 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
0 ms |
212 KB |
Output is correct |
28 |
Correct |
0 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
3 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
0 ms |
212 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
0 ms |
212 KB |
Output is correct |
28 |
Correct |
0 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
0 ms |
212 KB |
Output is correct |
31 |
Correct |
6 ms |
3268 KB |
Output is correct |
32 |
Correct |
5 ms |
3484 KB |
Output is correct |
33 |
Correct |
6 ms |
4140 KB |
Output is correct |
34 |
Correct |
6 ms |
2800 KB |
Output is correct |
35 |
Correct |
5 ms |
4036 KB |
Output is correct |
36 |
Correct |
6 ms |
2888 KB |
Output is correct |
37 |
Correct |
5 ms |
4548 KB |
Output is correct |
38 |
Correct |
5 ms |
4224 KB |
Output is correct |
39 |
Correct |
5 ms |
4596 KB |
Output is correct |
40 |
Correct |
4 ms |
4640 KB |
Output is correct |
41 |
Correct |
4 ms |
4392 KB |
Output is correct |
42 |
Correct |
5 ms |
4464 KB |
Output is correct |
43 |
Correct |
4 ms |
4640 KB |
Output is correct |
44 |
Correct |
5 ms |
4336 KB |
Output is correct |
45 |
Correct |
5 ms |
4452 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
3 ms |
212 KB |
Output is correct |
16 |
Correct |
13 ms |
980 KB |
Output is correct |
17 |
Correct |
13 ms |
900 KB |
Output is correct |
18 |
Correct |
13 ms |
980 KB |
Output is correct |
19 |
Correct |
13 ms |
980 KB |
Output is correct |
20 |
Correct |
13 ms |
980 KB |
Output is correct |
21 |
Correct |
13 ms |
936 KB |
Output is correct |
22 |
Correct |
13 ms |
980 KB |
Output is correct |
23 |
Correct |
13 ms |
932 KB |
Output is correct |
24 |
Correct |
13 ms |
980 KB |
Output is correct |
25 |
Correct |
13 ms |
980 KB |
Output is correct |
26 |
Correct |
13 ms |
988 KB |
Output is correct |
27 |
Correct |
13 ms |
980 KB |
Output is correct |
28 |
Correct |
13 ms |
980 KB |
Output is correct |
29 |
Correct |
13 ms |
940 KB |
Output is correct |
30 |
Correct |
13 ms |
980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
3 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
0 ms |
212 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
0 ms |
212 KB |
Output is correct |
28 |
Correct |
0 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
0 ms |
212 KB |
Output is correct |
31 |
Correct |
13 ms |
980 KB |
Output is correct |
32 |
Correct |
13 ms |
900 KB |
Output is correct |
33 |
Correct |
13 ms |
980 KB |
Output is correct |
34 |
Correct |
13 ms |
980 KB |
Output is correct |
35 |
Correct |
13 ms |
980 KB |
Output is correct |
36 |
Correct |
13 ms |
936 KB |
Output is correct |
37 |
Correct |
13 ms |
980 KB |
Output is correct |
38 |
Correct |
13 ms |
932 KB |
Output is correct |
39 |
Correct |
13 ms |
980 KB |
Output is correct |
40 |
Correct |
13 ms |
980 KB |
Output is correct |
41 |
Correct |
13 ms |
988 KB |
Output is correct |
42 |
Correct |
13 ms |
980 KB |
Output is correct |
43 |
Correct |
13 ms |
980 KB |
Output is correct |
44 |
Correct |
13 ms |
940 KB |
Output is correct |
45 |
Correct |
13 ms |
980 KB |
Output is correct |
46 |
Correct |
98 ms |
1180 KB |
Output is correct |
47 |
Correct |
91 ms |
1132 KB |
Output is correct |
48 |
Correct |
91 ms |
1152 KB |
Output is correct |
49 |
Correct |
89 ms |
1088 KB |
Output is correct |
50 |
Correct |
92 ms |
1148 KB |
Output is correct |
51 |
Correct |
90 ms |
1112 KB |
Output is correct |
52 |
Correct |
93 ms |
1064 KB |
Output is correct |
53 |
Correct |
99 ms |
1284 KB |
Output is correct |
54 |
Correct |
91 ms |
1100 KB |
Output is correct |
55 |
Correct |
91 ms |
1168 KB |
Output is correct |
56 |
Correct |
93 ms |
1116 KB |
Output is correct |
57 |
Correct |
91 ms |
1096 KB |
Output is correct |
58 |
Correct |
92 ms |
1120 KB |
Output is correct |
59 |
Correct |
101 ms |
1116 KB |
Output is correct |
60 |
Correct |
92 ms |
1096 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
3 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
0 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
212 KB |
Output is correct |
21 |
Correct |
0 ms |
212 KB |
Output is correct |
22 |
Correct |
0 ms |
212 KB |
Output is correct |
23 |
Correct |
0 ms |
212 KB |
Output is correct |
24 |
Correct |
0 ms |
212 KB |
Output is correct |
25 |
Correct |
0 ms |
212 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
0 ms |
212 KB |
Output is correct |
28 |
Correct |
0 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
0 ms |
212 KB |
Output is correct |
31 |
Correct |
6 ms |
3268 KB |
Output is correct |
32 |
Correct |
5 ms |
3484 KB |
Output is correct |
33 |
Correct |
6 ms |
4140 KB |
Output is correct |
34 |
Correct |
6 ms |
2800 KB |
Output is correct |
35 |
Correct |
5 ms |
4036 KB |
Output is correct |
36 |
Correct |
6 ms |
2888 KB |
Output is correct |
37 |
Correct |
5 ms |
4548 KB |
Output is correct |
38 |
Correct |
5 ms |
4224 KB |
Output is correct |
39 |
Correct |
5 ms |
4596 KB |
Output is correct |
40 |
Correct |
4 ms |
4640 KB |
Output is correct |
41 |
Correct |
4 ms |
4392 KB |
Output is correct |
42 |
Correct |
5 ms |
4464 KB |
Output is correct |
43 |
Correct |
4 ms |
4640 KB |
Output is correct |
44 |
Correct |
5 ms |
4336 KB |
Output is correct |
45 |
Correct |
5 ms |
4452 KB |
Output is correct |
46 |
Correct |
13 ms |
980 KB |
Output is correct |
47 |
Correct |
13 ms |
900 KB |
Output is correct |
48 |
Correct |
13 ms |
980 KB |
Output is correct |
49 |
Correct |
13 ms |
980 KB |
Output is correct |
50 |
Correct |
13 ms |
980 KB |
Output is correct |
51 |
Correct |
13 ms |
936 KB |
Output is correct |
52 |
Correct |
13 ms |
980 KB |
Output is correct |
53 |
Correct |
13 ms |
932 KB |
Output is correct |
54 |
Correct |
13 ms |
980 KB |
Output is correct |
55 |
Correct |
13 ms |
980 KB |
Output is correct |
56 |
Correct |
13 ms |
988 KB |
Output is correct |
57 |
Correct |
13 ms |
980 KB |
Output is correct |
58 |
Correct |
13 ms |
980 KB |
Output is correct |
59 |
Correct |
13 ms |
940 KB |
Output is correct |
60 |
Correct |
13 ms |
980 KB |
Output is correct |
61 |
Correct |
98 ms |
1180 KB |
Output is correct |
62 |
Correct |
91 ms |
1132 KB |
Output is correct |
63 |
Correct |
91 ms |
1152 KB |
Output is correct |
64 |
Correct |
89 ms |
1088 KB |
Output is correct |
65 |
Correct |
92 ms |
1148 KB |
Output is correct |
66 |
Correct |
90 ms |
1112 KB |
Output is correct |
67 |
Correct |
93 ms |
1064 KB |
Output is correct |
68 |
Correct |
99 ms |
1284 KB |
Output is correct |
69 |
Correct |
91 ms |
1100 KB |
Output is correct |
70 |
Correct |
91 ms |
1168 KB |
Output is correct |
71 |
Correct |
93 ms |
1116 KB |
Output is correct |
72 |
Correct |
91 ms |
1096 KB |
Output is correct |
73 |
Correct |
92 ms |
1120 KB |
Output is correct |
74 |
Correct |
101 ms |
1116 KB |
Output is correct |
75 |
Correct |
92 ms |
1096 KB |
Output is correct |
76 |
Execution timed out |
1040 ms |
4564 KB |
Time limit exceeded |
77 |
Halted |
0 ms |
0 KB |
- |