Submission #806851

# Submission time Handle Problem Language Result Execution time Memory
806851 2023-08-04T10:33:17 Z oscar1f Maze (JOI23_ho_t3) C++17
100 / 100
667 ms 422176 KB
#include<bits/stdc++.h>
using namespace std;

int nbLig,nbCol,tailleMouv,ligDeb,colDeb,ligFin,colFin,dist;
vector<pair<int,int>> adja;
vector<bool> temp;
vector<string> val;
vector<vector<bool>> dv,dejaMur;
vector<pair<int,int>> frontiere,nouv,mur;
string mot;

void propage(int lig,int col,int gratos) {
    if (lig>=1 and lig<=nbLig and col>=1 and col<=nbCol and (gratos==1 or (val[lig][col]=='.' and dv[lig][col]==false))) {
        dv[lig][col]=true;
        nouv.push_back({lig,col});
        for (auto a:adja) {
            propage(lig+a.first,col+a.second,0);
        }
    }
}

void testMur(int lig,int col) {
    if (lig>=1 and lig<=nbLig and col>=1 and col<=nbCol and dv[lig][col]==false and dejaMur[lig][col]==false) {
        dejaMur[lig][col]=true;
        mur.push_back({lig,col});
    }
}

void etend(int lig,int col,int direc,int rest) {
    if (lig>=1 and lig<=nbLig and col>=1 and col<=nbCol and dv[lig][col]==false and rest>0) {
        dv[lig][col]=true;
        mur.push_back({lig,col});
        etend(lig+adja[direc].first,col+adja[direc].second,direc,rest-1);
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    adja={{-1,0},{0,1},{1,0},{0,-1}};
    cin>>nbLig>>nbCol>>tailleMouv;
    cin>>ligDeb>>colDeb>>ligFin>>colFin;
    for (int j=0;j<=nbCol+1;j++) {
        temp.push_back(false);
    }
    for (int i=0;i<=nbLig+1;i++) {
        dv.push_back(temp);
        dejaMur.push_back(temp);
    }
    val.push_back("");
    for (int i=1;i<=nbLig;i++) {
        cin>>mot;
        val.push_back(" "+mot);
    }

    propage(ligDeb,colDeb,1);
    int lig,col,nbMur;
    while (dv[ligFin][colFin]==false) {
        frontiere=nouv;
        nouv.clear();
        mur.clear();
        for (auto s:frontiere) {
            for (auto a:adja) {
                testMur(s.first+a.first,s.second+a.second);
            }
        }
        nbMur=mur.size();
        for (int i=0;i<nbMur;i++) {
            lig=mur[i].first;
            col=mur[i].second;
            etend(lig,col-1,3,tailleMouv-1);
            etend(lig,col+1,1,tailleMouv-1);
        }
        nbMur=mur.size();
        for (int i=0;i<nbMur;i++) {
            lig=mur[i].first;
            col=mur[i].second;
            etend(lig-1,col,0,tailleMouv-1);
            etend(lig+1,col,2,tailleMouv-1);
        }
        nbMur=mur.size();
        for (int i=0;i<nbMur;i++) {
            lig=mur[i].first;
            col=mur[i].second;
            propage(lig,col,1);
        }
        /*for (auto s:nouv) {
            cout<<s.first<<" "<<s.second<<endl;
        }
        cout<<endl;*/
        dist++;
    }
    cout<<dist<<endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 316 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 324 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 324 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 0 ms 216 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 4 ms 468 KB Output is correct
20 Correct 3 ms 420 KB Output is correct
21 Correct 4 ms 4616 KB Output is correct
22 Correct 6 ms 468 KB Output is correct
23 Correct 5 ms 536 KB Output is correct
24 Correct 2 ms 596 KB Output is correct
25 Correct 4 ms 584 KB Output is correct
26 Correct 1 ms 592 KB Output is correct
27 Correct 1 ms 596 KB Output is correct
28 Correct 2 ms 584 KB Output is correct
29 Correct 11 ms 716 KB Output is correct
30 Correct 4 ms 468 KB Output is correct
31 Correct 10 ms 10956 KB Output is correct
32 Correct 14 ms 840 KB Output is correct
33 Correct 9 ms 712 KB Output is correct
34 Correct 6 ms 1000 KB Output is correct
35 Correct 11 ms 992 KB Output is correct
36 Correct 8 ms 1236 KB Output is correct
37 Correct 11 ms 1108 KB Output is correct
38 Correct 1 ms 840 KB Output is correct
39 Correct 110 ms 3888 KB Output is correct
40 Correct 5 ms 724 KB Output is correct
41 Correct 4 ms 1120 KB Output is correct
42 Correct 18 ms 844 KB Output is correct
43 Correct 14 ms 1108 KB Output is correct
44 Correct 23 ms 2248 KB Output is correct
45 Correct 25 ms 2384 KB Output is correct
46 Correct 93 ms 105660 KB Output is correct
47 Correct 125 ms 4212 KB Output is correct
48 Correct 72 ms 3932 KB Output is correct
49 Correct 33 ms 6148 KB Output is correct
50 Correct 56 ms 6160 KB Output is correct
51 Correct 89 ms 6016 KB Output is correct
52 Correct 75 ms 4860 KB Output is correct
53 Correct 89 ms 4300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 316 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 328 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 320 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 324 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 232 KB Output is correct
23 Correct 1 ms 324 KB Output is correct
24 Correct 1 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 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 344 KB Output is correct
32 Correct 1 ms 316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 320 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 284 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 220 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 408 KB Output is correct
26 Correct 3 ms 2756 KB Output is correct
27 Correct 4 ms 4560 KB Output is correct
28 Correct 4 ms 4688 KB Output is correct
29 Correct 4 ms 1744 KB Output is correct
30 Correct 3 ms 1744 KB Output is correct
31 Correct 2 ms 596 KB Output is correct
32 Correct 2 ms 584 KB Output is correct
33 Correct 1 ms 596 KB Output is correct
34 Correct 6 ms 4796 KB Output is correct
35 Correct 12 ms 10988 KB Output is correct
36 Correct 12 ms 10956 KB Output is correct
37 Correct 13 ms 4880 KB Output is correct
38 Correct 8 ms 4888 KB Output is correct
39 Correct 22 ms 15236 KB Output is correct
40 Correct 54 ms 42084 KB Output is correct
41 Correct 87 ms 105728 KB Output is correct
42 Correct 86 ms 105828 KB Output is correct
43 Correct 103 ms 40104 KB Output is correct
44 Correct 69 ms 40188 KB Output is correct
45 Correct 49 ms 22148 KB Output is correct
46 Correct 60 ms 28588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 316 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 328 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 320 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 324 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 232 KB Output is correct
23 Correct 1 ms 324 KB Output is correct
24 Correct 1 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 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 344 KB Output is correct
32 Correct 1 ms 316 KB Output is correct
33 Correct 4 ms 456 KB Output is correct
34 Correct 1 ms 324 KB Output is correct
35 Correct 1 ms 328 KB Output is correct
36 Correct 1 ms 468 KB Output is correct
37 Correct 3 ms 468 KB Output is correct
38 Correct 3 ms 2764 KB Output is correct
39 Correct 4 ms 4560 KB Output is correct
40 Correct 5 ms 568 KB Output is correct
41 Correct 4 ms 468 KB Output is correct
42 Correct 4 ms 4688 KB Output is correct
43 Correct 4 ms 1744 KB Output is correct
44 Correct 3 ms 1744 KB Output is correct
45 Correct 2 ms 596 KB Output is correct
46 Correct 3 ms 596 KB Output is correct
47 Correct 5 ms 468 KB Output is correct
48 Correct 4 ms 460 KB Output is correct
49 Correct 3 ms 520 KB Output is correct
50 Correct 5 ms 468 KB Output is correct
51 Correct 2 ms 596 KB Output is correct
52 Correct 1 ms 596 KB Output is correct
53 Correct 1 ms 596 KB Output is correct
54 Correct 2 ms 596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 316 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 328 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 320 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 324 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 232 KB Output is correct
23 Correct 1 ms 324 KB Output is correct
24 Correct 1 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 1 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 344 KB Output is correct
32 Correct 1 ms 316 KB Output is correct
33 Correct 4 ms 456 KB Output is correct
34 Correct 1 ms 324 KB Output is correct
35 Correct 1 ms 328 KB Output is correct
36 Correct 1 ms 468 KB Output is correct
37 Correct 3 ms 468 KB Output is correct
38 Correct 3 ms 2764 KB Output is correct
39 Correct 4 ms 4560 KB Output is correct
40 Correct 5 ms 568 KB Output is correct
41 Correct 4 ms 468 KB Output is correct
42 Correct 4 ms 4688 KB Output is correct
43 Correct 4 ms 1744 KB Output is correct
44 Correct 3 ms 1744 KB Output is correct
45 Correct 2 ms 596 KB Output is correct
46 Correct 3 ms 596 KB Output is correct
47 Correct 5 ms 468 KB Output is correct
48 Correct 4 ms 460 KB Output is correct
49 Correct 3 ms 520 KB Output is correct
50 Correct 5 ms 468 KB Output is correct
51 Correct 2 ms 596 KB Output is correct
52 Correct 1 ms 596 KB Output is correct
53 Correct 1 ms 596 KB Output is correct
54 Correct 2 ms 596 KB Output is correct
55 Correct 11 ms 668 KB Output is correct
56 Correct 4 ms 468 KB Output is correct
57 Correct 6 ms 4844 KB Output is correct
58 Correct 12 ms 664 KB Output is correct
59 Correct 10 ms 10956 KB Output is correct
60 Correct 16 ms 836 KB Output is correct
61 Correct 11 ms 724 KB Output is correct
62 Correct 11 ms 10956 KB Output is correct
63 Correct 13 ms 4900 KB Output is correct
64 Correct 8 ms 4928 KB Output is correct
65 Correct 5 ms 1000 KB Output is correct
66 Correct 10 ms 992 KB Output is correct
67 Correct 13 ms 724 KB Output is correct
68 Correct 10 ms 732 KB Output is correct
69 Correct 11 ms 772 KB Output is correct
70 Correct 12 ms 892 KB Output is correct
71 Correct 10 ms 1140 KB Output is correct
72 Correct 8 ms 1260 KB Output is correct
73 Correct 11 ms 1108 KB Output is correct
74 Correct 2 ms 796 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 316 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 324 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 324 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 0 ms 216 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 4 ms 468 KB Output is correct
20 Correct 3 ms 420 KB Output is correct
21 Correct 4 ms 4616 KB Output is correct
22 Correct 6 ms 468 KB Output is correct
23 Correct 5 ms 536 KB Output is correct
24 Correct 2 ms 596 KB Output is correct
25 Correct 4 ms 584 KB Output is correct
26 Correct 1 ms 592 KB Output is correct
27 Correct 1 ms 596 KB Output is correct
28 Correct 2 ms 584 KB Output is correct
29 Correct 11 ms 716 KB Output is correct
30 Correct 4 ms 468 KB Output is correct
31 Correct 10 ms 10956 KB Output is correct
32 Correct 14 ms 840 KB Output is correct
33 Correct 9 ms 712 KB Output is correct
34 Correct 6 ms 1000 KB Output is correct
35 Correct 11 ms 992 KB Output is correct
36 Correct 8 ms 1236 KB Output is correct
37 Correct 11 ms 1108 KB Output is correct
38 Correct 1 ms 840 KB Output is correct
39 Correct 110 ms 3888 KB Output is correct
40 Correct 5 ms 724 KB Output is correct
41 Correct 4 ms 1120 KB Output is correct
42 Correct 18 ms 844 KB Output is correct
43 Correct 14 ms 1108 KB Output is correct
44 Correct 23 ms 2248 KB Output is correct
45 Correct 25 ms 2384 KB Output is correct
46 Correct 93 ms 105660 KB Output is correct
47 Correct 125 ms 4212 KB Output is correct
48 Correct 72 ms 3932 KB Output is correct
49 Correct 33 ms 6148 KB Output is correct
50 Correct 56 ms 6160 KB Output is correct
51 Correct 89 ms 6016 KB Output is correct
52 Correct 75 ms 4860 KB Output is correct
53 Correct 89 ms 4300 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 0 ms 316 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 0 ms 328 KB Output is correct
61 Correct 1 ms 212 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 320 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 0 ms 340 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 1 ms 324 KB Output is correct
70 Correct 1 ms 212 KB Output is correct
71 Correct 1 ms 212 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 212 KB Output is correct
74 Correct 1 ms 212 KB Output is correct
75 Correct 1 ms 232 KB Output is correct
76 Correct 1 ms 324 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 0 ms 212 KB Output is correct
79 Correct 1 ms 212 KB Output is correct
80 Correct 1 ms 212 KB Output is correct
81 Correct 1 ms 212 KB Output is correct
82 Correct 1 ms 212 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 1 ms 344 KB Output is correct
85 Correct 1 ms 316 KB Output is correct
86 Correct 1 ms 320 KB Output is correct
87 Correct 1 ms 212 KB Output is correct
88 Correct 1 ms 212 KB Output is correct
89 Correct 1 ms 212 KB Output is correct
90 Correct 1 ms 212 KB Output is correct
91 Correct 1 ms 212 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 284 KB Output is correct
95 Correct 1 ms 340 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 340 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 1 ms 220 KB Output is correct
101 Correct 1 ms 212 KB Output is correct
102 Correct 1 ms 212 KB Output is correct
103 Correct 1 ms 212 KB Output is correct
104 Correct 1 ms 212 KB Output is correct
105 Correct 0 ms 212 KB Output is correct
106 Correct 1 ms 212 KB Output is correct
107 Correct 1 ms 340 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 1 ms 408 KB Output is correct
111 Correct 3 ms 2756 KB Output is correct
112 Correct 4 ms 4560 KB Output is correct
113 Correct 4 ms 4688 KB Output is correct
114 Correct 4 ms 1744 KB Output is correct
115 Correct 3 ms 1744 KB Output is correct
116 Correct 2 ms 596 KB Output is correct
117 Correct 2 ms 584 KB Output is correct
118 Correct 1 ms 596 KB Output is correct
119 Correct 6 ms 4796 KB Output is correct
120 Correct 12 ms 10988 KB Output is correct
121 Correct 12 ms 10956 KB Output is correct
122 Correct 13 ms 4880 KB Output is correct
123 Correct 8 ms 4888 KB Output is correct
124 Correct 22 ms 15236 KB Output is correct
125 Correct 54 ms 42084 KB Output is correct
126 Correct 87 ms 105728 KB Output is correct
127 Correct 86 ms 105828 KB Output is correct
128 Correct 103 ms 40104 KB Output is correct
129 Correct 69 ms 40188 KB Output is correct
130 Correct 49 ms 22148 KB Output is correct
131 Correct 60 ms 28588 KB Output is correct
132 Correct 4 ms 456 KB Output is correct
133 Correct 1 ms 324 KB Output is correct
134 Correct 1 ms 328 KB Output is correct
135 Correct 1 ms 468 KB Output is correct
136 Correct 3 ms 468 KB Output is correct
137 Correct 3 ms 2764 KB Output is correct
138 Correct 4 ms 4560 KB Output is correct
139 Correct 5 ms 568 KB Output is correct
140 Correct 4 ms 468 KB Output is correct
141 Correct 4 ms 4688 KB Output is correct
142 Correct 4 ms 1744 KB Output is correct
143 Correct 3 ms 1744 KB Output is correct
144 Correct 2 ms 596 KB Output is correct
145 Correct 3 ms 596 KB Output is correct
146 Correct 5 ms 468 KB Output is correct
147 Correct 4 ms 460 KB Output is correct
148 Correct 3 ms 520 KB Output is correct
149 Correct 5 ms 468 KB Output is correct
150 Correct 2 ms 596 KB Output is correct
151 Correct 1 ms 596 KB Output is correct
152 Correct 1 ms 596 KB Output is correct
153 Correct 2 ms 596 KB Output is correct
154 Correct 11 ms 668 KB Output is correct
155 Correct 4 ms 468 KB Output is correct
156 Correct 6 ms 4844 KB Output is correct
157 Correct 12 ms 664 KB Output is correct
158 Correct 10 ms 10956 KB Output is correct
159 Correct 16 ms 836 KB Output is correct
160 Correct 11 ms 724 KB Output is correct
161 Correct 11 ms 10956 KB Output is correct
162 Correct 13 ms 4900 KB Output is correct
163 Correct 8 ms 4928 KB Output is correct
164 Correct 5 ms 1000 KB Output is correct
165 Correct 10 ms 992 KB Output is correct
166 Correct 13 ms 724 KB Output is correct
167 Correct 10 ms 732 KB Output is correct
168 Correct 11 ms 772 KB Output is correct
169 Correct 12 ms 892 KB Output is correct
170 Correct 10 ms 1140 KB Output is correct
171 Correct 8 ms 1260 KB Output is correct
172 Correct 11 ms 1108 KB Output is correct
173 Correct 2 ms 796 KB Output is correct
174 Correct 7 ms 724 KB Output is correct
175 Correct 22 ms 1108 KB Output is correct
176 Correct 27 ms 2564 KB Output is correct
177 Correct 48 ms 2624 KB Output is correct
178 Correct 11 ms 3284 KB Output is correct
179 Correct 54 ms 3940 KB Output is correct
180 Correct 99 ms 4116 KB Output is correct
181 Correct 103 ms 4704 KB Output is correct
182 Correct 122 ms 5996 KB Output is correct
183 Correct 137 ms 10392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 316 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 324 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 324 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 0 ms 216 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 4 ms 468 KB Output is correct
20 Correct 3 ms 420 KB Output is correct
21 Correct 4 ms 4616 KB Output is correct
22 Correct 6 ms 468 KB Output is correct
23 Correct 5 ms 536 KB Output is correct
24 Correct 2 ms 596 KB Output is correct
25 Correct 4 ms 584 KB Output is correct
26 Correct 1 ms 592 KB Output is correct
27 Correct 1 ms 596 KB Output is correct
28 Correct 2 ms 584 KB Output is correct
29 Correct 11 ms 716 KB Output is correct
30 Correct 4 ms 468 KB Output is correct
31 Correct 10 ms 10956 KB Output is correct
32 Correct 14 ms 840 KB Output is correct
33 Correct 9 ms 712 KB Output is correct
34 Correct 6 ms 1000 KB Output is correct
35 Correct 11 ms 992 KB Output is correct
36 Correct 8 ms 1236 KB Output is correct
37 Correct 11 ms 1108 KB Output is correct
38 Correct 1 ms 840 KB Output is correct
39 Correct 110 ms 3888 KB Output is correct
40 Correct 5 ms 724 KB Output is correct
41 Correct 4 ms 1120 KB Output is correct
42 Correct 18 ms 844 KB Output is correct
43 Correct 14 ms 1108 KB Output is correct
44 Correct 23 ms 2248 KB Output is correct
45 Correct 25 ms 2384 KB Output is correct
46 Correct 93 ms 105660 KB Output is correct
47 Correct 125 ms 4212 KB Output is correct
48 Correct 72 ms 3932 KB Output is correct
49 Correct 33 ms 6148 KB Output is correct
50 Correct 56 ms 6160 KB Output is correct
51 Correct 89 ms 6016 KB Output is correct
52 Correct 75 ms 4860 KB Output is correct
53 Correct 89 ms 4300 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 0 ms 316 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 0 ms 328 KB Output is correct
61 Correct 1 ms 212 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 320 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 0 ms 340 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 1 ms 324 KB Output is correct
70 Correct 1 ms 212 KB Output is correct
71 Correct 1 ms 212 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 212 KB Output is correct
74 Correct 1 ms 212 KB Output is correct
75 Correct 1 ms 232 KB Output is correct
76 Correct 1 ms 324 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 0 ms 212 KB Output is correct
79 Correct 1 ms 212 KB Output is correct
80 Correct 1 ms 212 KB Output is correct
81 Correct 1 ms 212 KB Output is correct
82 Correct 1 ms 212 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 1 ms 344 KB Output is correct
85 Correct 1 ms 316 KB Output is correct
86 Correct 1 ms 320 KB Output is correct
87 Correct 1 ms 212 KB Output is correct
88 Correct 1 ms 212 KB Output is correct
89 Correct 1 ms 212 KB Output is correct
90 Correct 1 ms 212 KB Output is correct
91 Correct 1 ms 212 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 284 KB Output is correct
95 Correct 1 ms 340 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 340 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 1 ms 220 KB Output is correct
101 Correct 1 ms 212 KB Output is correct
102 Correct 1 ms 212 KB Output is correct
103 Correct 1 ms 212 KB Output is correct
104 Correct 1 ms 212 KB Output is correct
105 Correct 0 ms 212 KB Output is correct
106 Correct 1 ms 212 KB Output is correct
107 Correct 1 ms 340 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 1 ms 408 KB Output is correct
111 Correct 3 ms 2756 KB Output is correct
112 Correct 4 ms 4560 KB Output is correct
113 Correct 4 ms 4688 KB Output is correct
114 Correct 4 ms 1744 KB Output is correct
115 Correct 3 ms 1744 KB Output is correct
116 Correct 2 ms 596 KB Output is correct
117 Correct 2 ms 584 KB Output is correct
118 Correct 1 ms 596 KB Output is correct
119 Correct 6 ms 4796 KB Output is correct
120 Correct 12 ms 10988 KB Output is correct
121 Correct 12 ms 10956 KB Output is correct
122 Correct 13 ms 4880 KB Output is correct
123 Correct 8 ms 4888 KB Output is correct
124 Correct 22 ms 15236 KB Output is correct
125 Correct 54 ms 42084 KB Output is correct
126 Correct 87 ms 105728 KB Output is correct
127 Correct 86 ms 105828 KB Output is correct
128 Correct 103 ms 40104 KB Output is correct
129 Correct 69 ms 40188 KB Output is correct
130 Correct 49 ms 22148 KB Output is correct
131 Correct 60 ms 28588 KB Output is correct
132 Correct 4 ms 456 KB Output is correct
133 Correct 1 ms 324 KB Output is correct
134 Correct 1 ms 328 KB Output is correct
135 Correct 1 ms 468 KB Output is correct
136 Correct 3 ms 468 KB Output is correct
137 Correct 3 ms 2764 KB Output is correct
138 Correct 4 ms 4560 KB Output is correct
139 Correct 5 ms 568 KB Output is correct
140 Correct 4 ms 468 KB Output is correct
141 Correct 4 ms 4688 KB Output is correct
142 Correct 4 ms 1744 KB Output is correct
143 Correct 3 ms 1744 KB Output is correct
144 Correct 2 ms 596 KB Output is correct
145 Correct 3 ms 596 KB Output is correct
146 Correct 5 ms 468 KB Output is correct
147 Correct 4 ms 460 KB Output is correct
148 Correct 3 ms 520 KB Output is correct
149 Correct 5 ms 468 KB Output is correct
150 Correct 2 ms 596 KB Output is correct
151 Correct 1 ms 596 KB Output is correct
152 Correct 1 ms 596 KB Output is correct
153 Correct 2 ms 596 KB Output is correct
154 Correct 11 ms 668 KB Output is correct
155 Correct 4 ms 468 KB Output is correct
156 Correct 6 ms 4844 KB Output is correct
157 Correct 12 ms 664 KB Output is correct
158 Correct 10 ms 10956 KB Output is correct
159 Correct 16 ms 836 KB Output is correct
160 Correct 11 ms 724 KB Output is correct
161 Correct 11 ms 10956 KB Output is correct
162 Correct 13 ms 4900 KB Output is correct
163 Correct 8 ms 4928 KB Output is correct
164 Correct 5 ms 1000 KB Output is correct
165 Correct 10 ms 992 KB Output is correct
166 Correct 13 ms 724 KB Output is correct
167 Correct 10 ms 732 KB Output is correct
168 Correct 11 ms 772 KB Output is correct
169 Correct 12 ms 892 KB Output is correct
170 Correct 10 ms 1140 KB Output is correct
171 Correct 8 ms 1260 KB Output is correct
172 Correct 11 ms 1108 KB Output is correct
173 Correct 2 ms 796 KB Output is correct
174 Correct 7 ms 724 KB Output is correct
175 Correct 22 ms 1108 KB Output is correct
176 Correct 27 ms 2564 KB Output is correct
177 Correct 48 ms 2624 KB Output is correct
178 Correct 11 ms 3284 KB Output is correct
179 Correct 54 ms 3940 KB Output is correct
180 Correct 99 ms 4116 KB Output is correct
181 Correct 103 ms 4704 KB Output is correct
182 Correct 122 ms 5996 KB Output is correct
183 Correct 137 ms 10392 KB Output is correct
184 Correct 257 ms 7348 KB Output is correct
185 Correct 36 ms 4100 KB Output is correct
186 Correct 115 ms 66208 KB Output is correct
187 Correct 20 ms 7452 KB Output is correct
188 Correct 191 ms 211368 KB Output is correct
189 Correct 215 ms 7732 KB Output is correct
190 Correct 73 ms 7288 KB Output is correct
191 Correct 196 ms 211404 KB Output is correct
192 Correct 203 ms 79900 KB Output is correct
193 Correct 152 ms 79948 KB Output is correct
194 Correct 95 ms 11936 KB Output is correct
195 Correct 135 ms 11832 KB Output is correct
196 Correct 206 ms 7380 KB Output is correct
197 Correct 99 ms 7644 KB Output is correct
198 Correct 110 ms 8524 KB Output is correct
199 Correct 256 ms 10452 KB Output is correct
200 Correct 92 ms 9980 KB Output is correct
201 Correct 176 ms 8864 KB Output is correct
202 Correct 224 ms 8004 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 316 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 324 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 324 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 0 ms 216 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 4 ms 468 KB Output is correct
20 Correct 3 ms 420 KB Output is correct
21 Correct 4 ms 4616 KB Output is correct
22 Correct 6 ms 468 KB Output is correct
23 Correct 5 ms 536 KB Output is correct
24 Correct 2 ms 596 KB Output is correct
25 Correct 4 ms 584 KB Output is correct
26 Correct 1 ms 592 KB Output is correct
27 Correct 1 ms 596 KB Output is correct
28 Correct 2 ms 584 KB Output is correct
29 Correct 11 ms 716 KB Output is correct
30 Correct 4 ms 468 KB Output is correct
31 Correct 10 ms 10956 KB Output is correct
32 Correct 14 ms 840 KB Output is correct
33 Correct 9 ms 712 KB Output is correct
34 Correct 6 ms 1000 KB Output is correct
35 Correct 11 ms 992 KB Output is correct
36 Correct 8 ms 1236 KB Output is correct
37 Correct 11 ms 1108 KB Output is correct
38 Correct 1 ms 840 KB Output is correct
39 Correct 110 ms 3888 KB Output is correct
40 Correct 5 ms 724 KB Output is correct
41 Correct 4 ms 1120 KB Output is correct
42 Correct 18 ms 844 KB Output is correct
43 Correct 14 ms 1108 KB Output is correct
44 Correct 23 ms 2248 KB Output is correct
45 Correct 25 ms 2384 KB Output is correct
46 Correct 93 ms 105660 KB Output is correct
47 Correct 125 ms 4212 KB Output is correct
48 Correct 72 ms 3932 KB Output is correct
49 Correct 33 ms 6148 KB Output is correct
50 Correct 56 ms 6160 KB Output is correct
51 Correct 89 ms 6016 KB Output is correct
52 Correct 75 ms 4860 KB Output is correct
53 Correct 89 ms 4300 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 0 ms 316 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 0 ms 328 KB Output is correct
61 Correct 1 ms 212 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 320 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 0 ms 340 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 1 ms 324 KB Output is correct
70 Correct 1 ms 212 KB Output is correct
71 Correct 1 ms 212 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 212 KB Output is correct
74 Correct 1 ms 212 KB Output is correct
75 Correct 1 ms 232 KB Output is correct
76 Correct 1 ms 324 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 0 ms 212 KB Output is correct
79 Correct 1 ms 212 KB Output is correct
80 Correct 1 ms 212 KB Output is correct
81 Correct 1 ms 212 KB Output is correct
82 Correct 1 ms 212 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 1 ms 344 KB Output is correct
85 Correct 1 ms 316 KB Output is correct
86 Correct 1 ms 320 KB Output is correct
87 Correct 1 ms 212 KB Output is correct
88 Correct 1 ms 212 KB Output is correct
89 Correct 1 ms 212 KB Output is correct
90 Correct 1 ms 212 KB Output is correct
91 Correct 1 ms 212 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 284 KB Output is correct
95 Correct 1 ms 340 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 340 KB Output is correct
98 Correct 1 ms 212 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 1 ms 220 KB Output is correct
101 Correct 1 ms 212 KB Output is correct
102 Correct 1 ms 212 KB Output is correct
103 Correct 1 ms 212 KB Output is correct
104 Correct 1 ms 212 KB Output is correct
105 Correct 0 ms 212 KB Output is correct
106 Correct 1 ms 212 KB Output is correct
107 Correct 1 ms 340 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 1 ms 408 KB Output is correct
111 Correct 3 ms 2756 KB Output is correct
112 Correct 4 ms 4560 KB Output is correct
113 Correct 4 ms 4688 KB Output is correct
114 Correct 4 ms 1744 KB Output is correct
115 Correct 3 ms 1744 KB Output is correct
116 Correct 2 ms 596 KB Output is correct
117 Correct 2 ms 584 KB Output is correct
118 Correct 1 ms 596 KB Output is correct
119 Correct 6 ms 4796 KB Output is correct
120 Correct 12 ms 10988 KB Output is correct
121 Correct 12 ms 10956 KB Output is correct
122 Correct 13 ms 4880 KB Output is correct
123 Correct 8 ms 4888 KB Output is correct
124 Correct 22 ms 15236 KB Output is correct
125 Correct 54 ms 42084 KB Output is correct
126 Correct 87 ms 105728 KB Output is correct
127 Correct 86 ms 105828 KB Output is correct
128 Correct 103 ms 40104 KB Output is correct
129 Correct 69 ms 40188 KB Output is correct
130 Correct 49 ms 22148 KB Output is correct
131 Correct 60 ms 28588 KB Output is correct
132 Correct 4 ms 456 KB Output is correct
133 Correct 1 ms 324 KB Output is correct
134 Correct 1 ms 328 KB Output is correct
135 Correct 1 ms 468 KB Output is correct
136 Correct 3 ms 468 KB Output is correct
137 Correct 3 ms 2764 KB Output is correct
138 Correct 4 ms 4560 KB Output is correct
139 Correct 5 ms 568 KB Output is correct
140 Correct 4 ms 468 KB Output is correct
141 Correct 4 ms 4688 KB Output is correct
142 Correct 4 ms 1744 KB Output is correct
143 Correct 3 ms 1744 KB Output is correct
144 Correct 2 ms 596 KB Output is correct
145 Correct 3 ms 596 KB Output is correct
146 Correct 5 ms 468 KB Output is correct
147 Correct 4 ms 460 KB Output is correct
148 Correct 3 ms 520 KB Output is correct
149 Correct 5 ms 468 KB Output is correct
150 Correct 2 ms 596 KB Output is correct
151 Correct 1 ms 596 KB Output is correct
152 Correct 1 ms 596 KB Output is correct
153 Correct 2 ms 596 KB Output is correct
154 Correct 11 ms 668 KB Output is correct
155 Correct 4 ms 468 KB Output is correct
156 Correct 6 ms 4844 KB Output is correct
157 Correct 12 ms 664 KB Output is correct
158 Correct 10 ms 10956 KB Output is correct
159 Correct 16 ms 836 KB Output is correct
160 Correct 11 ms 724 KB Output is correct
161 Correct 11 ms 10956 KB Output is correct
162 Correct 13 ms 4900 KB Output is correct
163 Correct 8 ms 4928 KB Output is correct
164 Correct 5 ms 1000 KB Output is correct
165 Correct 10 ms 992 KB Output is correct
166 Correct 13 ms 724 KB Output is correct
167 Correct 10 ms 732 KB Output is correct
168 Correct 11 ms 772 KB Output is correct
169 Correct 12 ms 892 KB Output is correct
170 Correct 10 ms 1140 KB Output is correct
171 Correct 8 ms 1260 KB Output is correct
172 Correct 11 ms 1108 KB Output is correct
173 Correct 2 ms 796 KB Output is correct
174 Correct 7 ms 724 KB Output is correct
175 Correct 22 ms 1108 KB Output is correct
176 Correct 27 ms 2564 KB Output is correct
177 Correct 48 ms 2624 KB Output is correct
178 Correct 11 ms 3284 KB Output is correct
179 Correct 54 ms 3940 KB Output is correct
180 Correct 99 ms 4116 KB Output is correct
181 Correct 103 ms 4704 KB Output is correct
182 Correct 122 ms 5996 KB Output is correct
183 Correct 137 ms 10392 KB Output is correct
184 Correct 257 ms 7348 KB Output is correct
185 Correct 36 ms 4100 KB Output is correct
186 Correct 115 ms 66208 KB Output is correct
187 Correct 20 ms 7452 KB Output is correct
188 Correct 191 ms 211368 KB Output is correct
189 Correct 215 ms 7732 KB Output is correct
190 Correct 73 ms 7288 KB Output is correct
191 Correct 196 ms 211404 KB Output is correct
192 Correct 203 ms 79900 KB Output is correct
193 Correct 152 ms 79948 KB Output is correct
194 Correct 95 ms 11936 KB Output is correct
195 Correct 135 ms 11832 KB Output is correct
196 Correct 206 ms 7380 KB Output is correct
197 Correct 99 ms 7644 KB Output is correct
198 Correct 110 ms 8524 KB Output is correct
199 Correct 256 ms 10452 KB Output is correct
200 Correct 92 ms 9980 KB Output is correct
201 Correct 176 ms 8864 KB Output is correct
202 Correct 224 ms 8004 KB Output is correct
203 Correct 464 ms 14140 KB Output is correct
204 Correct 163 ms 18044 KB Output is correct
205 Correct 266 ms 9700 KB Output is correct
206 Correct 114 ms 13984 KB Output is correct
207 Correct 373 ms 421548 KB Output is correct
208 Correct 416 ms 14856 KB Output is correct
209 Correct 454 ms 14036 KB Output is correct
210 Correct 362 ms 422176 KB Output is correct
211 Correct 462 ms 126624 KB Output is correct
212 Correct 293 ms 126596 KB Output is correct
213 Correct 126 ms 23304 KB Output is correct
214 Correct 346 ms 23220 KB Output is correct
215 Correct 407 ms 14216 KB Output is correct
216 Correct 359 ms 14640 KB Output is correct
217 Correct 392 ms 15956 KB Output is correct
218 Correct 345 ms 19140 KB Output is correct
219 Correct 434 ms 66176 KB Output is correct
220 Correct 135 ms 57964 KB Output is correct
221 Correct 254 ms 104764 KB Output is correct
222 Correct 667 ms 190208 KB Output is correct
223 Correct 332 ms 18212 KB Output is correct
224 Correct 362 ms 16448 KB Output is correct
225 Correct 204 ms 14844 KB Output is correct