Submission #947283

# Submission time Handle Problem Language Result Execution time Memory
947283 2024-03-15T20:53:15 Z Mer123haba456 Bliskost (COI23_bliskost) C++17
57 / 100
1000 ms 14312 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long double ld;
#define N lli(2e6)
#define MOD lli(1e9 + 7)
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0);
#define heps(v) v.begin(),v.end()
typedef vector<lli> vlli;
typedef pair<lli,lli> plli;
typedef pair<lli,plli> pplli;
typedef vector<plli> vplli;
typedef vector<pplli> vpplli;
typedef map<lli,lli> mlli;

lli t,n,m,k;

string str;

vector<char> bir, ik;

lli topl = 0;

void kont(){
    if(topl % 26 == 0)
        cout << "da" << endl;
    else
        cout << "ne" << endl;
}

int main(){
    fast_io
    cin >> n >> t;
    for(lli i = 0;i<n;i++){
        char c;
        cin >> c;
        bir.push_back(c);
    }
    for(lli i = 0;i<n;i++){
        char c;
        cin >> c;
        ik.push_back(c);
        if((n - i) & 1)
            topl += ik[i] - bir[i];
        else
            topl -= ik[i] - bir[i];
    }
    kont();
    while(t--){
        char c;
        cin >> m >> c;
        m--;
        if((n - m)&1){
            topl -= ik[m] - bir[m];
            topl += ik[m] - c;
        }else{
            topl += ik[m] - bir[m];
            topl -= ik[m] - c;
        }
        bir[m] = c;
        kont();
    }
    
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 356 KB Output is correct
26 Correct 0 ms 344 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 356 KB Output is correct
26 Correct 0 ms 344 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 21 ms 2972 KB Output is correct
32 Correct 21 ms 2772 KB Output is correct
33 Correct 32 ms 2776 KB Output is correct
34 Correct 21 ms 2776 KB Output is correct
35 Correct 21 ms 2776 KB Output is correct
36 Correct 21 ms 2856 KB Output is correct
37 Correct 30 ms 2968 KB Output is correct
38 Correct 21 ms 2776 KB Output is correct
39 Correct 21 ms 2984 KB Output is correct
40 Correct 21 ms 2744 KB Output is correct
41 Correct 21 ms 2888 KB Output is correct
42 Correct 33 ms 2856 KB Output is correct
43 Correct 21 ms 2776 KB Output is correct
44 Correct 32 ms 2776 KB Output is correct
45 Correct 33 ms 2776 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 114 ms 592 KB Output is correct
17 Correct 115 ms 972 KB Output is correct
18 Correct 115 ms 1108 KB Output is correct
19 Correct 115 ms 1104 KB Output is correct
20 Correct 115 ms 1104 KB Output is correct
21 Correct 123 ms 1108 KB Output is correct
22 Correct 114 ms 1252 KB Output is correct
23 Correct 114 ms 1108 KB Output is correct
24 Correct 114 ms 1004 KB Output is correct
25 Correct 123 ms 1732 KB Output is correct
26 Correct 115 ms 1040 KB Output is correct
27 Correct 112 ms 1104 KB Output is correct
28 Correct 114 ms 908 KB Output is correct
29 Correct 125 ms 1016 KB Output is correct
30 Correct 117 ms 1064 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 356 KB Output is correct
26 Correct 0 ms 344 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 114 ms 592 KB Output is correct
32 Correct 115 ms 972 KB Output is correct
33 Correct 115 ms 1108 KB Output is correct
34 Correct 115 ms 1104 KB Output is correct
35 Correct 115 ms 1104 KB Output is correct
36 Correct 123 ms 1108 KB Output is correct
37 Correct 114 ms 1252 KB Output is correct
38 Correct 114 ms 1108 KB Output is correct
39 Correct 114 ms 1004 KB Output is correct
40 Correct 123 ms 1732 KB Output is correct
41 Correct 115 ms 1040 KB Output is correct
42 Correct 112 ms 1104 KB Output is correct
43 Correct 114 ms 908 KB Output is correct
44 Correct 125 ms 1016 KB Output is correct
45 Correct 117 ms 1064 KB Output is correct
46 Correct 118 ms 1108 KB Output is correct
47 Correct 116 ms 1108 KB Output is correct
48 Correct 120 ms 1256 KB Output is correct
49 Correct 115 ms 1228 KB Output is correct
50 Correct 115 ms 1156 KB Output is correct
51 Correct 121 ms 1320 KB Output is correct
52 Correct 114 ms 1096 KB Output is correct
53 Correct 122 ms 1104 KB Output is correct
54 Correct 115 ms 1248 KB Output is correct
55 Correct 115 ms 1236 KB Output is correct
56 Correct 115 ms 1256 KB Output is correct
57 Correct 115 ms 1240 KB Output is correct
58 Correct 115 ms 1144 KB Output is correct
59 Correct 123 ms 1436 KB Output is correct
60 Correct 118 ms 1128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 344 KB Output is correct
25 Correct 1 ms 356 KB Output is correct
26 Correct 0 ms 344 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 21 ms 2972 KB Output is correct
32 Correct 21 ms 2772 KB Output is correct
33 Correct 32 ms 2776 KB Output is correct
34 Correct 21 ms 2776 KB Output is correct
35 Correct 21 ms 2776 KB Output is correct
36 Correct 21 ms 2856 KB Output is correct
37 Correct 30 ms 2968 KB Output is correct
38 Correct 21 ms 2776 KB Output is correct
39 Correct 21 ms 2984 KB Output is correct
40 Correct 21 ms 2744 KB Output is correct
41 Correct 21 ms 2888 KB Output is correct
42 Correct 33 ms 2856 KB Output is correct
43 Correct 21 ms 2776 KB Output is correct
44 Correct 32 ms 2776 KB Output is correct
45 Correct 33 ms 2776 KB Output is correct
46 Correct 114 ms 592 KB Output is correct
47 Correct 115 ms 972 KB Output is correct
48 Correct 115 ms 1108 KB Output is correct
49 Correct 115 ms 1104 KB Output is correct
50 Correct 115 ms 1104 KB Output is correct
51 Correct 123 ms 1108 KB Output is correct
52 Correct 114 ms 1252 KB Output is correct
53 Correct 114 ms 1108 KB Output is correct
54 Correct 114 ms 1004 KB Output is correct
55 Correct 123 ms 1732 KB Output is correct
56 Correct 115 ms 1040 KB Output is correct
57 Correct 112 ms 1104 KB Output is correct
58 Correct 114 ms 908 KB Output is correct
59 Correct 125 ms 1016 KB Output is correct
60 Correct 117 ms 1064 KB Output is correct
61 Correct 118 ms 1108 KB Output is correct
62 Correct 116 ms 1108 KB Output is correct
63 Correct 120 ms 1256 KB Output is correct
64 Correct 115 ms 1228 KB Output is correct
65 Correct 115 ms 1156 KB Output is correct
66 Correct 121 ms 1320 KB Output is correct
67 Correct 114 ms 1096 KB Output is correct
68 Correct 122 ms 1104 KB Output is correct
69 Correct 115 ms 1248 KB Output is correct
70 Correct 115 ms 1236 KB Output is correct
71 Correct 115 ms 1256 KB Output is correct
72 Correct 115 ms 1240 KB Output is correct
73 Correct 115 ms 1144 KB Output is correct
74 Correct 123 ms 1436 KB Output is correct
75 Correct 118 ms 1128 KB Output is correct
76 Execution timed out 1020 ms 14312 KB Time limit exceeded
77 Halted 0 ms 0 KB -