# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
948063 |
2024-03-17T14:37:31 Z |
Abito |
Bliskost (COI23_bliskost) |
C++17 |
|
1000 ms |
8380 KB |
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define ep insert
#define endl '\n'
#define elif else if
#define pow pwr
#define sqrt sqrtt
//#define int long long
#define ll long long
typedef unsigned long long ull;
using namespace std;
const int N=1e6+5;
int n,q,a[N];
char s[N],z[N];
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
cin>>n>>q;
for (int i=1;i<=n;i++) cin>>s[i];
for (int i=1;i<=n;i++) cin>>z[i];
for (int i=1;i<=n;i++) a[i]=((z[i]-'a')-(s[i]-'a')+26)%26;
for (int Q=0;Q<=q;Q++){
if (Q){
int i;char c;
cin>>i>>c;
s[i]=c;
a[i]=((z[i]-'a')-(s[i]-'a')+26)%26;
}
//for (int i=1;i<=n;i++) cout<<a[i]<<' ';cout<<endl;
int p=0;
for (int i=1;i<n;i++){
//cout<<p<<' ';
int x=(a[i]+p)%26;
p=(26-x)%26;
}//cout<<p<<endl;
if ((a[n]+p)%26) cout<<"ne"<<endl;
else cout<<"da"<<endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2648 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2392 KB |
Output is correct |
8 |
Correct |
1 ms |
2392 KB |
Output is correct |
9 |
Correct |
1 ms |
2396 KB |
Output is correct |
10 |
Correct |
1 ms |
2392 KB |
Output is correct |
11 |
Correct |
1 ms |
2396 KB |
Output is correct |
12 |
Correct |
0 ms |
2396 KB |
Output is correct |
13 |
Correct |
0 ms |
2396 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
1 ms |
2392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2648 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2392 KB |
Output is correct |
8 |
Correct |
1 ms |
2392 KB |
Output is correct |
9 |
Correct |
1 ms |
2396 KB |
Output is correct |
10 |
Correct |
1 ms |
2392 KB |
Output is correct |
11 |
Correct |
1 ms |
2396 KB |
Output is correct |
12 |
Correct |
0 ms |
2396 KB |
Output is correct |
13 |
Correct |
0 ms |
2396 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
1 ms |
2392 KB |
Output is correct |
16 |
Correct |
1 ms |
2396 KB |
Output is correct |
17 |
Correct |
1 ms |
2396 KB |
Output is correct |
18 |
Correct |
1 ms |
2396 KB |
Output is correct |
19 |
Correct |
1 ms |
2392 KB |
Output is correct |
20 |
Correct |
1 ms |
2396 KB |
Output is correct |
21 |
Correct |
1 ms |
2396 KB |
Output is correct |
22 |
Correct |
1 ms |
2396 KB |
Output is correct |
23 |
Correct |
0 ms |
2396 KB |
Output is correct |
24 |
Correct |
1 ms |
2396 KB |
Output is correct |
25 |
Correct |
0 ms |
2396 KB |
Output is correct |
26 |
Correct |
1 ms |
2396 KB |
Output is correct |
27 |
Correct |
1 ms |
2396 KB |
Output is correct |
28 |
Correct |
1 ms |
2396 KB |
Output is correct |
29 |
Correct |
0 ms |
2396 KB |
Output is correct |
30 |
Correct |
0 ms |
2396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2648 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2392 KB |
Output is correct |
8 |
Correct |
1 ms |
2392 KB |
Output is correct |
9 |
Correct |
1 ms |
2396 KB |
Output is correct |
10 |
Correct |
1 ms |
2392 KB |
Output is correct |
11 |
Correct |
1 ms |
2396 KB |
Output is correct |
12 |
Correct |
0 ms |
2396 KB |
Output is correct |
13 |
Correct |
0 ms |
2396 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
1 ms |
2392 KB |
Output is correct |
16 |
Correct |
1 ms |
2396 KB |
Output is correct |
17 |
Correct |
1 ms |
2396 KB |
Output is correct |
18 |
Correct |
1 ms |
2396 KB |
Output is correct |
19 |
Correct |
1 ms |
2392 KB |
Output is correct |
20 |
Correct |
1 ms |
2396 KB |
Output is correct |
21 |
Correct |
1 ms |
2396 KB |
Output is correct |
22 |
Correct |
1 ms |
2396 KB |
Output is correct |
23 |
Correct |
0 ms |
2396 KB |
Output is correct |
24 |
Correct |
1 ms |
2396 KB |
Output is correct |
25 |
Correct |
0 ms |
2396 KB |
Output is correct |
26 |
Correct |
1 ms |
2396 KB |
Output is correct |
27 |
Correct |
1 ms |
2396 KB |
Output is correct |
28 |
Correct |
1 ms |
2396 KB |
Output is correct |
29 |
Correct |
0 ms |
2396 KB |
Output is correct |
30 |
Correct |
0 ms |
2396 KB |
Output is correct |
31 |
Correct |
25 ms |
6324 KB |
Output is correct |
32 |
Correct |
26 ms |
8020 KB |
Output is correct |
33 |
Correct |
27 ms |
8284 KB |
Output is correct |
34 |
Correct |
27 ms |
8028 KB |
Output is correct |
35 |
Correct |
28 ms |
8028 KB |
Output is correct |
36 |
Correct |
33 ms |
8028 KB |
Output is correct |
37 |
Correct |
26 ms |
8028 KB |
Output is correct |
38 |
Correct |
29 ms |
8016 KB |
Output is correct |
39 |
Correct |
26 ms |
8284 KB |
Output is correct |
40 |
Correct |
28 ms |
8380 KB |
Output is correct |
41 |
Correct |
27 ms |
8284 KB |
Output is correct |
42 |
Correct |
25 ms |
8028 KB |
Output is correct |
43 |
Correct |
26 ms |
8284 KB |
Output is correct |
44 |
Correct |
29 ms |
8016 KB |
Output is correct |
45 |
Correct |
26 ms |
8028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2648 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2392 KB |
Output is correct |
8 |
Correct |
1 ms |
2392 KB |
Output is correct |
9 |
Correct |
1 ms |
2396 KB |
Output is correct |
10 |
Correct |
1 ms |
2392 KB |
Output is correct |
11 |
Correct |
1 ms |
2396 KB |
Output is correct |
12 |
Correct |
0 ms |
2396 KB |
Output is correct |
13 |
Correct |
0 ms |
2396 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
1 ms |
2392 KB |
Output is correct |
16 |
Correct |
12 ms |
2648 KB |
Output is correct |
17 |
Correct |
11 ms |
2652 KB |
Output is correct |
18 |
Correct |
10 ms |
2648 KB |
Output is correct |
19 |
Correct |
10 ms |
2652 KB |
Output is correct |
20 |
Correct |
10 ms |
2652 KB |
Output is correct |
21 |
Correct |
11 ms |
2652 KB |
Output is correct |
22 |
Correct |
11 ms |
2652 KB |
Output is correct |
23 |
Correct |
10 ms |
2652 KB |
Output is correct |
24 |
Correct |
10 ms |
2648 KB |
Output is correct |
25 |
Correct |
10 ms |
2652 KB |
Output is correct |
26 |
Correct |
11 ms |
2648 KB |
Output is correct |
27 |
Correct |
10 ms |
2652 KB |
Output is correct |
28 |
Correct |
12 ms |
2652 KB |
Output is correct |
29 |
Correct |
13 ms |
2652 KB |
Output is correct |
30 |
Correct |
10 ms |
2648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2648 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2392 KB |
Output is correct |
8 |
Correct |
1 ms |
2392 KB |
Output is correct |
9 |
Correct |
1 ms |
2396 KB |
Output is correct |
10 |
Correct |
1 ms |
2392 KB |
Output is correct |
11 |
Correct |
1 ms |
2396 KB |
Output is correct |
12 |
Correct |
0 ms |
2396 KB |
Output is correct |
13 |
Correct |
0 ms |
2396 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
1 ms |
2392 KB |
Output is correct |
16 |
Correct |
1 ms |
2396 KB |
Output is correct |
17 |
Correct |
1 ms |
2396 KB |
Output is correct |
18 |
Correct |
1 ms |
2396 KB |
Output is correct |
19 |
Correct |
1 ms |
2392 KB |
Output is correct |
20 |
Correct |
1 ms |
2396 KB |
Output is correct |
21 |
Correct |
1 ms |
2396 KB |
Output is correct |
22 |
Correct |
1 ms |
2396 KB |
Output is correct |
23 |
Correct |
0 ms |
2396 KB |
Output is correct |
24 |
Correct |
1 ms |
2396 KB |
Output is correct |
25 |
Correct |
0 ms |
2396 KB |
Output is correct |
26 |
Correct |
1 ms |
2396 KB |
Output is correct |
27 |
Correct |
1 ms |
2396 KB |
Output is correct |
28 |
Correct |
1 ms |
2396 KB |
Output is correct |
29 |
Correct |
0 ms |
2396 KB |
Output is correct |
30 |
Correct |
0 ms |
2396 KB |
Output is correct |
31 |
Correct |
12 ms |
2648 KB |
Output is correct |
32 |
Correct |
11 ms |
2652 KB |
Output is correct |
33 |
Correct |
10 ms |
2648 KB |
Output is correct |
34 |
Correct |
10 ms |
2652 KB |
Output is correct |
35 |
Correct |
10 ms |
2652 KB |
Output is correct |
36 |
Correct |
11 ms |
2652 KB |
Output is correct |
37 |
Correct |
11 ms |
2652 KB |
Output is correct |
38 |
Correct |
10 ms |
2652 KB |
Output is correct |
39 |
Correct |
10 ms |
2648 KB |
Output is correct |
40 |
Correct |
10 ms |
2652 KB |
Output is correct |
41 |
Correct |
11 ms |
2648 KB |
Output is correct |
42 |
Correct |
10 ms |
2652 KB |
Output is correct |
43 |
Correct |
12 ms |
2652 KB |
Output is correct |
44 |
Correct |
13 ms |
2652 KB |
Output is correct |
45 |
Correct |
10 ms |
2648 KB |
Output is correct |
46 |
Correct |
620 ms |
3156 KB |
Output is correct |
47 |
Correct |
621 ms |
3012 KB |
Output is correct |
48 |
Correct |
598 ms |
2644 KB |
Output is correct |
49 |
Correct |
604 ms |
3156 KB |
Output is correct |
50 |
Correct |
615 ms |
2724 KB |
Output is correct |
51 |
Correct |
606 ms |
2840 KB |
Output is correct |
52 |
Correct |
621 ms |
2644 KB |
Output is correct |
53 |
Correct |
596 ms |
2780 KB |
Output is correct |
54 |
Correct |
621 ms |
2788 KB |
Output is correct |
55 |
Correct |
603 ms |
2980 KB |
Output is correct |
56 |
Correct |
602 ms |
2760 KB |
Output is correct |
57 |
Correct |
606 ms |
2776 KB |
Output is correct |
58 |
Correct |
609 ms |
2896 KB |
Output is correct |
59 |
Correct |
617 ms |
2772 KB |
Output is correct |
60 |
Correct |
606 ms |
2644 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2648 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
1 ms |
2392 KB |
Output is correct |
8 |
Correct |
1 ms |
2392 KB |
Output is correct |
9 |
Correct |
1 ms |
2396 KB |
Output is correct |
10 |
Correct |
1 ms |
2392 KB |
Output is correct |
11 |
Correct |
1 ms |
2396 KB |
Output is correct |
12 |
Correct |
0 ms |
2396 KB |
Output is correct |
13 |
Correct |
0 ms |
2396 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
1 ms |
2392 KB |
Output is correct |
16 |
Correct |
1 ms |
2396 KB |
Output is correct |
17 |
Correct |
1 ms |
2396 KB |
Output is correct |
18 |
Correct |
1 ms |
2396 KB |
Output is correct |
19 |
Correct |
1 ms |
2392 KB |
Output is correct |
20 |
Correct |
1 ms |
2396 KB |
Output is correct |
21 |
Correct |
1 ms |
2396 KB |
Output is correct |
22 |
Correct |
1 ms |
2396 KB |
Output is correct |
23 |
Correct |
0 ms |
2396 KB |
Output is correct |
24 |
Correct |
1 ms |
2396 KB |
Output is correct |
25 |
Correct |
0 ms |
2396 KB |
Output is correct |
26 |
Correct |
1 ms |
2396 KB |
Output is correct |
27 |
Correct |
1 ms |
2396 KB |
Output is correct |
28 |
Correct |
1 ms |
2396 KB |
Output is correct |
29 |
Correct |
0 ms |
2396 KB |
Output is correct |
30 |
Correct |
0 ms |
2396 KB |
Output is correct |
31 |
Correct |
25 ms |
6324 KB |
Output is correct |
32 |
Correct |
26 ms |
8020 KB |
Output is correct |
33 |
Correct |
27 ms |
8284 KB |
Output is correct |
34 |
Correct |
27 ms |
8028 KB |
Output is correct |
35 |
Correct |
28 ms |
8028 KB |
Output is correct |
36 |
Correct |
33 ms |
8028 KB |
Output is correct |
37 |
Correct |
26 ms |
8028 KB |
Output is correct |
38 |
Correct |
29 ms |
8016 KB |
Output is correct |
39 |
Correct |
26 ms |
8284 KB |
Output is correct |
40 |
Correct |
28 ms |
8380 KB |
Output is correct |
41 |
Correct |
27 ms |
8284 KB |
Output is correct |
42 |
Correct |
25 ms |
8028 KB |
Output is correct |
43 |
Correct |
26 ms |
8284 KB |
Output is correct |
44 |
Correct |
29 ms |
8016 KB |
Output is correct |
45 |
Correct |
26 ms |
8028 KB |
Output is correct |
46 |
Correct |
12 ms |
2648 KB |
Output is correct |
47 |
Correct |
11 ms |
2652 KB |
Output is correct |
48 |
Correct |
10 ms |
2648 KB |
Output is correct |
49 |
Correct |
10 ms |
2652 KB |
Output is correct |
50 |
Correct |
10 ms |
2652 KB |
Output is correct |
51 |
Correct |
11 ms |
2652 KB |
Output is correct |
52 |
Correct |
11 ms |
2652 KB |
Output is correct |
53 |
Correct |
10 ms |
2652 KB |
Output is correct |
54 |
Correct |
10 ms |
2648 KB |
Output is correct |
55 |
Correct |
10 ms |
2652 KB |
Output is correct |
56 |
Correct |
11 ms |
2648 KB |
Output is correct |
57 |
Correct |
10 ms |
2652 KB |
Output is correct |
58 |
Correct |
12 ms |
2652 KB |
Output is correct |
59 |
Correct |
13 ms |
2652 KB |
Output is correct |
60 |
Correct |
10 ms |
2648 KB |
Output is correct |
61 |
Correct |
620 ms |
3156 KB |
Output is correct |
62 |
Correct |
621 ms |
3012 KB |
Output is correct |
63 |
Correct |
598 ms |
2644 KB |
Output is correct |
64 |
Correct |
604 ms |
3156 KB |
Output is correct |
65 |
Correct |
615 ms |
2724 KB |
Output is correct |
66 |
Correct |
606 ms |
2840 KB |
Output is correct |
67 |
Correct |
621 ms |
2644 KB |
Output is correct |
68 |
Correct |
596 ms |
2780 KB |
Output is correct |
69 |
Correct |
621 ms |
2788 KB |
Output is correct |
70 |
Correct |
603 ms |
2980 KB |
Output is correct |
71 |
Correct |
602 ms |
2760 KB |
Output is correct |
72 |
Correct |
606 ms |
2776 KB |
Output is correct |
73 |
Correct |
609 ms |
2896 KB |
Output is correct |
74 |
Correct |
617 ms |
2772 KB |
Output is correct |
75 |
Correct |
606 ms |
2644 KB |
Output is correct |
76 |
Execution timed out |
1014 ms |
8376 KB |
Time limit exceeded |
77 |
Halted |
0 ms |
0 KB |
- |