Submission #926089

# Submission time Handle Problem Language Result Execution time Memory
926089 2024-02-12T14:40:08 Z De3b0o Crossing (JOI21_crossing) C++14
3 / 100
7000 ms 6316 KB
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define in insert
#define er erase
#define pb push_back
#define ppb pop_back()
#define ph push
#define pp pop()
#define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define cans cout << ans << "\n";
#define yes cout << "Yes" << "\n";
#define no cout << "No" << "\n";
#define pll pair<ll,ll>
#define lin cout << "\n";
#define sqr 340
#define mod 1000000007

using namespace std;

string sa , sb , sc;
string s1 , s2 , s3;

void check(string t)
{
    if(t==sa||t==sb||t==sc||t==s1||t==s2||t==s3)
        yes
    else
        no
}

int main()
{
    d3
    ll n;
    cin >> n;
    cin >> sa >> sb >> sc;
    for(int i = 0 ; n>i ; i++)
    {
        if(sa[i]==sb[i])
            s1+=sa[i];
        else
            s1+=char(226-int(sa[i]+sb[i]));
    }
    for(int i = 0 ; n>i ; i++)
    {
        if(sa[i]==sc[i])
            s2+=sa[i];
        else
            s2+=char(226-int(sa[i]+sc[i]));
    }

    for(int i = 0 ; n>i ; i++)
    {
        if(sb[i]==sc[i])
            s3+=sb[i];
        else
            s3+=char(226-int(sc[i]+sb[i]));
    }
    ll q;
    cin >> q;
    string t;
    cin >> t;
    check(t);
    while(q--)
    {
        ll l , r;
        char c;
        cin >> l >> r >> c;
        for(int i = l-1 ; r>i ; i++)
            t[i]=c;
        check(t);
    }
}
# Verdict Execution time Memory Grader output
1 Correct 39 ms 856 KB Output is correct
2 Correct 43 ms 2544 KB Output is correct
3 Correct 53 ms 2392 KB Output is correct
4 Correct 42 ms 2384 KB Output is correct
5 Correct 42 ms 2384 KB Output is correct
6 Correct 41 ms 2384 KB Output is correct
7 Correct 42 ms 2372 KB Output is correct
8 Correct 43 ms 2392 KB Output is correct
9 Correct 50 ms 2360 KB Output is correct
10 Correct 48 ms 2672 KB Output is correct
11 Correct 43 ms 2384 KB Output is correct
12 Correct 46 ms 2452 KB Output is correct
13 Correct 44 ms 2388 KB Output is correct
14 Correct 44 ms 2384 KB Output is correct
15 Correct 46 ms 2824 KB Output is correct
16 Correct 50 ms 2540 KB Output is correct
17 Correct 43 ms 2564 KB Output is correct
18 Correct 54 ms 2388 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 39 ms 856 KB Output is correct
2 Correct 43 ms 2544 KB Output is correct
3 Correct 53 ms 2392 KB Output is correct
4 Correct 42 ms 2384 KB Output is correct
5 Correct 42 ms 2384 KB Output is correct
6 Correct 41 ms 2384 KB Output is correct
7 Correct 42 ms 2372 KB Output is correct
8 Correct 43 ms 2392 KB Output is correct
9 Correct 50 ms 2360 KB Output is correct
10 Correct 48 ms 2672 KB Output is correct
11 Correct 43 ms 2384 KB Output is correct
12 Correct 46 ms 2452 KB Output is correct
13 Correct 44 ms 2388 KB Output is correct
14 Correct 44 ms 2384 KB Output is correct
15 Correct 46 ms 2824 KB Output is correct
16 Correct 50 ms 2540 KB Output is correct
17 Correct 43 ms 2564 KB Output is correct
18 Correct 54 ms 2388 KB Output is correct
19 Correct 4121 ms 6316 KB Output is correct
20 Execution timed out 7021 ms 4068 KB Time limit exceeded
21 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 39 ms 856 KB Output is correct
2 Correct 43 ms 2544 KB Output is correct
3 Correct 53 ms 2392 KB Output is correct
4 Correct 42 ms 2384 KB Output is correct
5 Correct 42 ms 2384 KB Output is correct
6 Correct 41 ms 2384 KB Output is correct
7 Correct 42 ms 2372 KB Output is correct
8 Correct 43 ms 2392 KB Output is correct
9 Correct 50 ms 2360 KB Output is correct
10 Correct 48 ms 2672 KB Output is correct
11 Correct 43 ms 2384 KB Output is correct
12 Correct 46 ms 2452 KB Output is correct
13 Correct 44 ms 2388 KB Output is correct
14 Correct 44 ms 2384 KB Output is correct
15 Correct 46 ms 2824 KB Output is correct
16 Correct 50 ms 2540 KB Output is correct
17 Correct 43 ms 2564 KB Output is correct
18 Correct 54 ms 2388 KB Output is correct
19 Correct 41 ms 2388 KB Output is correct
20 Correct 54 ms 2384 KB Output is correct
21 Correct 44 ms 2540 KB Output is correct
22 Correct 39 ms 2128 KB Output is correct
23 Correct 45 ms 2484 KB Output is correct
24 Correct 41 ms 2476 KB Output is correct
25 Correct 43 ms 2556 KB Output is correct
26 Correct 40 ms 2392 KB Output is correct
27 Correct 43 ms 2392 KB Output is correct
28 Correct 39 ms 2128 KB Output is correct
29 Correct 42 ms 2388 KB Output is correct
30 Correct 39 ms 2376 KB Output is correct
31 Incorrect 43 ms 2384 KB Output isn't correct
32 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 39 ms 856 KB Output is correct
2 Correct 43 ms 2544 KB Output is correct
3 Correct 53 ms 2392 KB Output is correct
4 Correct 42 ms 2384 KB Output is correct
5 Correct 42 ms 2384 KB Output is correct
6 Correct 41 ms 2384 KB Output is correct
7 Correct 42 ms 2372 KB Output is correct
8 Correct 43 ms 2392 KB Output is correct
9 Correct 50 ms 2360 KB Output is correct
10 Correct 48 ms 2672 KB Output is correct
11 Correct 43 ms 2384 KB Output is correct
12 Correct 46 ms 2452 KB Output is correct
13 Correct 44 ms 2388 KB Output is correct
14 Correct 44 ms 2384 KB Output is correct
15 Correct 46 ms 2824 KB Output is correct
16 Correct 50 ms 2540 KB Output is correct
17 Correct 43 ms 2564 KB Output is correct
18 Correct 54 ms 2388 KB Output is correct
19 Correct 4121 ms 6316 KB Output is correct
20 Execution timed out 7021 ms 4068 KB Time limit exceeded
21 Halted 0 ms 0 KB -