# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
409858 | 2021-05-21T16:50:10 Z | Ahmadsm2005 | 벽 칠하기 (APIO20_paint) | C++14 | 1500 ms | 12088 KB |
#include "paint.h" //#include "grader.cpp" #include <bits/stdc++.h> using namespace std; set<int>lolz[50001]; int minimumInstructions(int N,int M,int K,vector<int>C,vector<int>A,vector<vector<int>>B){ for(int i=0;i<B.size();i++){ for(int l=0;l<B[i].size();l++) lolz[i].insert(B[i][l]); } vector<int>P; int CUR=0,COST=0,LAST=-1; for(int i=0;i<N-M+1;i++){ if(LAST==-1){ for(int l=0;l<M;l++){ for(int x=l;x<M+l;x++){ if(lolz[x%M].find(C[x-l+i])==lolz[x%M].end()) goto a; } P.push_back(i); LAST=l; goto b; a:; } //return -1; b:; LAST=-1; continue; } /*LAST=(LAST+1)%M; for(int l=LAST;l<M+LAST;l++){ if(lolz[l%M].find(C[l-LAST+i])==lolz[l%M].end()) goto c; } P.push_back(i); continue; c:;*/ LAST=-1; } if(!P.size()) return -1; if(P[0]!=0) return -1; int MAXER=M; COST=1; for(int i=1;i<P.size();i++){ if(P[i]>MAXER){ if(MAXER==P[i-1]+M) return -1; MAXER=P[i-1]+M; COST++; i--; } } if(P[P.size()-1]+M!=MAXER){ MAXER=P[P.size()-1]+M,COST++; } if(MAXER<N) return -1; return COST; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2636 KB | Output is correct |
2 | Correct | 2 ms | 2636 KB | Output is correct |
3 | Correct | 2 ms | 2636 KB | Output is correct |
4 | Correct | 2 ms | 2648 KB | Output is correct |
5 | Correct | 2 ms | 2636 KB | Output is correct |
6 | Correct | 2 ms | 2636 KB | Output is correct |
7 | Correct | 2 ms | 2636 KB | Output is correct |
8 | Correct | 2 ms | 2636 KB | Output is correct |
9 | Correct | 2 ms | 2636 KB | Output is correct |
10 | Correct | 2 ms | 2636 KB | Output is correct |
11 | Correct | 2 ms | 2636 KB | Output is correct |
12 | Correct | 2 ms | 2636 KB | Output is correct |
13 | Correct | 3 ms | 2636 KB | Output is correct |
14 | Correct | 3 ms | 2764 KB | Output is correct |
15 | Correct | 3 ms | 2636 KB | Output is correct |
16 | Correct | 4 ms | 2648 KB | Output is correct |
17 | Correct | 3 ms | 2636 KB | Output is correct |
18 | Correct | 3 ms | 2648 KB | Output is correct |
19 | Correct | 4 ms | 2636 KB | Output is correct |
20 | Correct | 4 ms | 2636 KB | Output is correct |
21 | Correct | 4 ms | 2636 KB | Output is correct |
22 | Correct | 36 ms | 8148 KB | Output is correct |
23 | Correct | 33 ms | 8240 KB | Output is correct |
24 | Correct | 38 ms | 8156 KB | Output is correct |
25 | Correct | 6 ms | 3016 KB | Output is correct |
26 | Correct | 4 ms | 3020 KB | Output is correct |
27 | Correct | 5 ms | 2832 KB | Output is correct |
28 | Correct | 5 ms | 2764 KB | Output is correct |
29 | Correct | 5 ms | 2764 KB | Output is correct |
30 | Correct | 5 ms | 2764 KB | Output is correct |
31 | Correct | 1388 ms | 4284 KB | Output is correct |
32 | Correct | 1392 ms | 4256 KB | Output is correct |
33 | Correct | 1388 ms | 4464 KB | Output is correct |
34 | Correct | 1352 ms | 4328 KB | Output is correct |
35 | Correct | 1414 ms | 4448 KB | Output is correct |
36 | Correct | 1383 ms | 4468 KB | Output is correct |
37 | Execution timed out | 1577 ms | 8540 KB | Time limit exceeded |
38 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2636 KB | Output is correct |
2 | Correct | 2 ms | 2636 KB | Output is correct |
3 | Correct | 2 ms | 2636 KB | Output is correct |
4 | Correct | 2 ms | 2648 KB | Output is correct |
5 | Correct | 2 ms | 2636 KB | Output is correct |
6 | Correct | 2 ms | 2636 KB | Output is correct |
7 | Correct | 2 ms | 2636 KB | Output is correct |
8 | Correct | 2 ms | 2636 KB | Output is correct |
9 | Correct | 2 ms | 2636 KB | Output is correct |
10 | Correct | 2 ms | 2636 KB | Output is correct |
11 | Correct | 2 ms | 2636 KB | Output is correct |
12 | Correct | 2 ms | 2636 KB | Output is correct |
13 | Correct | 3 ms | 2636 KB | Output is correct |
14 | Correct | 3 ms | 2764 KB | Output is correct |
15 | Correct | 3 ms | 2636 KB | Output is correct |
16 | Correct | 4 ms | 2648 KB | Output is correct |
17 | Correct | 3 ms | 2636 KB | Output is correct |
18 | Correct | 3 ms | 2648 KB | Output is correct |
19 | Correct | 4 ms | 2636 KB | Output is correct |
20 | Correct | 4 ms | 2636 KB | Output is correct |
21 | Correct | 4 ms | 2636 KB | Output is correct |
22 | Correct | 2 ms | 2640 KB | Output is correct |
23 | Correct | 2 ms | 2552 KB | Output is correct |
24 | Correct | 2 ms | 2644 KB | Output is correct |
25 | Correct | 2 ms | 2636 KB | Output is correct |
26 | Correct | 2 ms | 2636 KB | Output is correct |
27 | Correct | 2 ms | 2636 KB | Output is correct |
28 | Correct | 2 ms | 2640 KB | Output is correct |
29 | Correct | 2 ms | 2636 KB | Output is correct |
30 | Correct | 3 ms | 2764 KB | Output is correct |
31 | Correct | 2 ms | 2636 KB | Output is correct |
32 | Correct | 3 ms | 2636 KB | Output is correct |
33 | Correct | 4 ms | 2636 KB | Output is correct |
34 | Correct | 3 ms | 2636 KB | Output is correct |
35 | Correct | 3 ms | 2636 KB | Output is correct |
36 | Correct | 3 ms | 2636 KB | Output is correct |
37 | Correct | 3 ms | 2636 KB | Output is correct |
38 | Correct | 3 ms | 2636 KB | Output is correct |
39 | Correct | 2 ms | 2636 KB | Output is correct |
40 | Correct | 3 ms | 2636 KB | Output is correct |
41 | Correct | 3 ms | 2636 KB | Output is correct |
42 | Correct | 3 ms | 2764 KB | Output is correct |
43 | Correct | 3 ms | 2636 KB | Output is correct |
44 | Correct | 2 ms | 2636 KB | Output is correct |
45 | Correct | 2 ms | 2636 KB | Output is correct |
46 | Correct | 3 ms | 2692 KB | Output is correct |
47 | Correct | 2 ms | 2636 KB | Output is correct |
48 | Correct | 3 ms | 2636 KB | Output is correct |
49 | Correct | 3 ms | 2648 KB | Output is correct |
50 | Correct | 3 ms | 2636 KB | Output is correct |
51 | Correct | 4 ms | 2652 KB | Output is correct |
52 | Correct | 3 ms | 2648 KB | Output is correct |
53 | Correct | 4 ms | 2636 KB | Output is correct |
54 | Correct | 3 ms | 2636 KB | Output is correct |
55 | Correct | 3 ms | 2644 KB | Output is correct |
56 | Correct | 4 ms | 2656 KB | Output is correct |
57 | Correct | 3 ms | 2648 KB | Output is correct |
58 | Correct | 4 ms | 2636 KB | Output is correct |
59 | Correct | 3 ms | 2636 KB | Output is correct |
60 | Correct | 3 ms | 2656 KB | Output is correct |
61 | Correct | 3 ms | 2636 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2640 KB | Output is correct |
2 | Correct | 2 ms | 2552 KB | Output is correct |
3 | Correct | 2 ms | 2636 KB | Output is correct |
4 | Correct | 2 ms | 2636 KB | Output is correct |
5 | Correct | 2 ms | 2636 KB | Output is correct |
6 | Correct | 2 ms | 2648 KB | Output is correct |
7 | Correct | 2 ms | 2636 KB | Output is correct |
8 | Correct | 2 ms | 2636 KB | Output is correct |
9 | Correct | 2 ms | 2636 KB | Output is correct |
10 | Correct | 2 ms | 2636 KB | Output is correct |
11 | Correct | 2 ms | 2636 KB | Output is correct |
12 | Correct | 2 ms | 2636 KB | Output is correct |
13 | Correct | 2 ms | 2636 KB | Output is correct |
14 | Correct | 2 ms | 2636 KB | Output is correct |
15 | Correct | 3 ms | 2636 KB | Output is correct |
16 | Correct | 3 ms | 2764 KB | Output is correct |
17 | Correct | 3 ms | 2636 KB | Output is correct |
18 | Correct | 4 ms | 2648 KB | Output is correct |
19 | Correct | 3 ms | 2636 KB | Output is correct |
20 | Correct | 3 ms | 2648 KB | Output is correct |
21 | Correct | 4 ms | 2636 KB | Output is correct |
22 | Correct | 4 ms | 2636 KB | Output is correct |
23 | Correct | 4 ms | 2636 KB | Output is correct |
24 | Correct | 36 ms | 8148 KB | Output is correct |
25 | Correct | 33 ms | 8240 KB | Output is correct |
26 | Correct | 38 ms | 8156 KB | Output is correct |
27 | Correct | 2 ms | 2644 KB | Output is correct |
28 | Correct | 2 ms | 2636 KB | Output is correct |
29 | Correct | 2 ms | 2636 KB | Output is correct |
30 | Correct | 2 ms | 2636 KB | Output is correct |
31 | Correct | 2 ms | 2640 KB | Output is correct |
32 | Correct | 2 ms | 2636 KB | Output is correct |
33 | Correct | 3 ms | 2764 KB | Output is correct |
34 | Correct | 2 ms | 2636 KB | Output is correct |
35 | Correct | 3 ms | 2636 KB | Output is correct |
36 | Correct | 4 ms | 2636 KB | Output is correct |
37 | Correct | 3 ms | 2636 KB | Output is correct |
38 | Correct | 3 ms | 2636 KB | Output is correct |
39 | Correct | 3 ms | 2636 KB | Output is correct |
40 | Correct | 3 ms | 2636 KB | Output is correct |
41 | Correct | 3 ms | 2636 KB | Output is correct |
42 | Correct | 2 ms | 2636 KB | Output is correct |
43 | Correct | 3 ms | 2636 KB | Output is correct |
44 | Correct | 3 ms | 2636 KB | Output is correct |
45 | Correct | 3 ms | 2764 KB | Output is correct |
46 | Correct | 3 ms | 2636 KB | Output is correct |
47 | Correct | 2 ms | 2636 KB | Output is correct |
48 | Correct | 2 ms | 2636 KB | Output is correct |
49 | Correct | 3 ms | 2692 KB | Output is correct |
50 | Correct | 2 ms | 2636 KB | Output is correct |
51 | Correct | 3 ms | 2636 KB | Output is correct |
52 | Correct | 3 ms | 2648 KB | Output is correct |
53 | Correct | 3 ms | 2636 KB | Output is correct |
54 | Correct | 4 ms | 2652 KB | Output is correct |
55 | Correct | 3 ms | 2648 KB | Output is correct |
56 | Correct | 4 ms | 2636 KB | Output is correct |
57 | Correct | 3 ms | 2636 KB | Output is correct |
58 | Correct | 3 ms | 2644 KB | Output is correct |
59 | Correct | 4 ms | 2656 KB | Output is correct |
60 | Correct | 3 ms | 2648 KB | Output is correct |
61 | Correct | 4 ms | 2636 KB | Output is correct |
62 | Correct | 3 ms | 2636 KB | Output is correct |
63 | Correct | 3 ms | 2656 KB | Output is correct |
64 | Correct | 3 ms | 2636 KB | Output is correct |
65 | Correct | 2 ms | 2636 KB | Output is correct |
66 | Correct | 2 ms | 2636 KB | Output is correct |
67 | Correct | 3 ms | 2636 KB | Output is correct |
68 | Correct | 3 ms | 2636 KB | Output is correct |
69 | Correct | 3 ms | 2636 KB | Output is correct |
70 | Correct | 16 ms | 3292 KB | Output is correct |
71 | Correct | 13 ms | 3276 KB | Output is correct |
72 | Correct | 8 ms | 3276 KB | Output is correct |
73 | Correct | 5 ms | 2916 KB | Output is correct |
74 | Correct | 7 ms | 3204 KB | Output is correct |
75 | Correct | 8 ms | 3148 KB | Output is correct |
76 | Correct | 35 ms | 9392 KB | Output is correct |
77 | Correct | 43 ms | 10052 KB | Output is correct |
78 | Correct | 44 ms | 11432 KB | Output is correct |
79 | Correct | 3 ms | 2636 KB | Output is correct |
80 | Correct | 3 ms | 2636 KB | Output is correct |
81 | Correct | 3 ms | 2636 KB | Output is correct |
82 | Correct | 3 ms | 2636 KB | Output is correct |
83 | Correct | 3 ms | 2636 KB | Output is correct |
84 | Correct | 12 ms | 3404 KB | Output is correct |
85 | Correct | 24 ms | 3512 KB | Output is correct |
86 | Correct | 16 ms | 3512 KB | Output is correct |
87 | Correct | 13 ms | 3520 KB | Output is correct |
88 | Correct | 13 ms | 3512 KB | Output is correct |
89 | Correct | 15 ms | 3512 KB | Output is correct |
90 | Correct | 51 ms | 12088 KB | Output is correct |
91 | Correct | 50 ms | 11972 KB | Output is correct |
92 | Correct | 50 ms | 12076 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2640 KB | Output is correct |
2 | Correct | 2 ms | 2552 KB | Output is correct |
3 | Correct | 2 ms | 2636 KB | Output is correct |
4 | Correct | 2 ms | 2636 KB | Output is correct |
5 | Correct | 2 ms | 2636 KB | Output is correct |
6 | Correct | 2 ms | 2648 KB | Output is correct |
7 | Correct | 2 ms | 2636 KB | Output is correct |
8 | Correct | 2 ms | 2636 KB | Output is correct |
9 | Correct | 2 ms | 2636 KB | Output is correct |
10 | Correct | 2 ms | 2636 KB | Output is correct |
11 | Correct | 2 ms | 2636 KB | Output is correct |
12 | Correct | 2 ms | 2636 KB | Output is correct |
13 | Correct | 2 ms | 2636 KB | Output is correct |
14 | Correct | 2 ms | 2636 KB | Output is correct |
15 | Correct | 3 ms | 2636 KB | Output is correct |
16 | Correct | 3 ms | 2764 KB | Output is correct |
17 | Correct | 3 ms | 2636 KB | Output is correct |
18 | Correct | 4 ms | 2648 KB | Output is correct |
19 | Correct | 3 ms | 2636 KB | Output is correct |
20 | Correct | 3 ms | 2648 KB | Output is correct |
21 | Correct | 4 ms | 2636 KB | Output is correct |
22 | Correct | 4 ms | 2636 KB | Output is correct |
23 | Correct | 4 ms | 2636 KB | Output is correct |
24 | Correct | 36 ms | 8148 KB | Output is correct |
25 | Correct | 33 ms | 8240 KB | Output is correct |
26 | Correct | 38 ms | 8156 KB | Output is correct |
27 | Correct | 6 ms | 3016 KB | Output is correct |
28 | Correct | 4 ms | 3020 KB | Output is correct |
29 | Correct | 5 ms | 2832 KB | Output is correct |
30 | Correct | 5 ms | 2764 KB | Output is correct |
31 | Correct | 5 ms | 2764 KB | Output is correct |
32 | Correct | 5 ms | 2764 KB | Output is correct |
33 | Correct | 1388 ms | 4284 KB | Output is correct |
34 | Correct | 1392 ms | 4256 KB | Output is correct |
35 | Correct | 1388 ms | 4464 KB | Output is correct |
36 | Correct | 1352 ms | 4328 KB | Output is correct |
37 | Correct | 1414 ms | 4448 KB | Output is correct |
38 | Correct | 1383 ms | 4468 KB | Output is correct |
39 | Execution timed out | 1577 ms | 8540 KB | Time limit exceeded |
40 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2640 KB | Output is correct |
2 | Correct | 2 ms | 2552 KB | Output is correct |
3 | Correct | 2 ms | 2636 KB | Output is correct |
4 | Correct | 2 ms | 2636 KB | Output is correct |
5 | Correct | 2 ms | 2636 KB | Output is correct |
6 | Correct | 2 ms | 2648 KB | Output is correct |
7 | Correct | 2 ms | 2636 KB | Output is correct |
8 | Correct | 2 ms | 2636 KB | Output is correct |
9 | Correct | 2 ms | 2636 KB | Output is correct |
10 | Correct | 2 ms | 2636 KB | Output is correct |
11 | Correct | 2 ms | 2636 KB | Output is correct |
12 | Correct | 2 ms | 2636 KB | Output is correct |
13 | Correct | 2 ms | 2636 KB | Output is correct |
14 | Correct | 2 ms | 2636 KB | Output is correct |
15 | Correct | 3 ms | 2636 KB | Output is correct |
16 | Correct | 3 ms | 2764 KB | Output is correct |
17 | Correct | 3 ms | 2636 KB | Output is correct |
18 | Correct | 4 ms | 2648 KB | Output is correct |
19 | Correct | 3 ms | 2636 KB | Output is correct |
20 | Correct | 3 ms | 2648 KB | Output is correct |
21 | Correct | 4 ms | 2636 KB | Output is correct |
22 | Correct | 4 ms | 2636 KB | Output is correct |
23 | Correct | 4 ms | 2636 KB | Output is correct |
24 | Correct | 36 ms | 8148 KB | Output is correct |
25 | Correct | 33 ms | 8240 KB | Output is correct |
26 | Correct | 38 ms | 8156 KB | Output is correct |
27 | Correct | 6 ms | 3016 KB | Output is correct |
28 | Correct | 4 ms | 3020 KB | Output is correct |
29 | Correct | 5 ms | 2832 KB | Output is correct |
30 | Correct | 5 ms | 2764 KB | Output is correct |
31 | Correct | 5 ms | 2764 KB | Output is correct |
32 | Correct | 5 ms | 2764 KB | Output is correct |
33 | Correct | 1388 ms | 4284 KB | Output is correct |
34 | Correct | 1392 ms | 4256 KB | Output is correct |
35 | Correct | 1388 ms | 4464 KB | Output is correct |
36 | Correct | 1352 ms | 4328 KB | Output is correct |
37 | Correct | 1414 ms | 4448 KB | Output is correct |
38 | Correct | 1383 ms | 4468 KB | Output is correct |
39 | Execution timed out | 1577 ms | 8540 KB | Time limit exceeded |
40 | Halted | 0 ms | 0 KB | - |