답안 #683889

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
683889 2023-01-19T14:43:20 Z kym 벽 칠하기 (APIO20_paint) C++14
63 / 100
1500 ms 22732 KB
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,s,e) for(int i = s; i <= (int)e; ++i)
#define DEC(i,s,e) for(int i = s; i >= (int)e; --i)
#define IAMSPEED ios_base::sync_with_stdio(false); cin.tie(0);
#ifdef LOCAL
#define db(x) cerr << #x << "=" << x << "\n"
#define db2(x, y) cerr << #x << "=" << x << " , " << #y << "=" << y << "\n"
#define db3(a,b,c) cerr<<#a<<"="<<a<<","<<#b<<"="<<b<<","<<#c<<"="<<c<<"\n"
#define dbv(v) cerr << #v << ":"; for (auto ite : v) cerr << ite << ' '; cerr <<"\n"
#define dbvp(v) cerr << #v << ":"; for (auto ite : v) cerr << "{"  << ite.f << ',' << ite.s << "} "; cerr << "\n"
#define dba(a,ss,ee) cerr << #a << ":"; FOR(ite,ss,ee) cerr << a[ite] << ' '; cerr << "\n"
#define reach cerr << "LINE: " << __LINE__ << "\n";
#else
#define reach 
#define db(x)
#define db2(x,y)
#define db3(a,b,c)
#define dbv(v)
#define dbvp(v)
#define dba(a,ss,ee)
#endif
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define f first 
#define s second
#define g0(x) get<0>(x)
#define g1(x) get<1>(x)
#define g2(x) get<2>(x)
#define g3(x) get<3>(x)
typedef pair <int, int> pi;
typedef tuple<int,int,int> ti3;
typedef tuple<int,int,int,int> ti4;
int rand(int a, int b) { return a + rng() % (b-a+1); }
const int MOD = 1e9 + 7;
const int inf = (int)1e9 + 500;
const long long oo = (long long)1e18 + 500;
template <typename T> bool chmax(T& a, const T b) { return a<b ? a = b, 1 : 0; }
template <typename T> bool chmin(T& a, const T b) { return a>b ? a = b, 1 : 0; }
const int MAXN = 100005;
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt,tune=native")
int D[MAXN];
unordered_map<int,int> dp[2];
int store[MAXN];
vector<int> V[MAXN]; // contractors of this colour
bool can[MAXN];
struct node {
    int s,e,m,val;
    node *l, *r;
    node(int _s, int _e) {
        s=_s;e=_e;
        m=(s+e)/2;
        val=inf;
        if(s!=e) {
            l=new node(s,m);
            r=new node(m+1,e);
        }
    }
    void update(int x, int nval) {
        if(s==e) {
            val=nval;
            return;
        }
        if(x>m)r->update(x,nval);
        else l->update(x,nval);
        val=min(l->val,r->val);
    }
    int query(int x, int y) {
        if(s==x&&e==y) return val;
        if(x>m) return r->query(x,y);
        else if(y<=m) return l->query(x,y);
        else return min(l->query(x,m), r->query(m+1,y));
    }
} *seg;

int minimumInstructions(
    int n, int m, int k, std::vector<int> C,
    std::vector<int> A, std::vector<std::vector<int>> B) {
    seg=new node(0,n);
    
    FOR(i,0,m-1) { // this contractor
        int y=A[i];
        FOR(j,0,y-1) { // V[i] -> the indices of contractors of this index.
            V[B[i][j]].pb(i);
        }

    }
    FOR(i,1,MAXN)D[i]=inf;
    D[0]=0;
    bool alt;
    FOR(i,0,n-1) {
        alt=i%2;
        dp[alt].clear();
        for(auto x:V[C[i]]) {
            // index of contractor that can paint this place
            // for continuous segment, all V values are the same
            // store longest segment of this same value
            int V=i-x;
            chmax(dp[alt][V],dp[1-alt][V]+1);
        }
        db(i);
        dbvp(dp[alt]);
        store[i]=dp[alt][i-(m-1)];
        //now check if i can cover from [i-m+1 to i]
        int st=i-m+1;
        if(st<0)continue;
        for(auto x:dp[alt]) {
            int idx=-(x.f-i); // idx of the contractor
            int len=min(x.s,idx+1);
            if(idx == m-1) {
                if(len>=m){
                    can[i]=1;
                    break;
                }
            }
            if(idx>=len)continue;
            //idx<len
            int curidx=i-len;
            db(curidx);
            if(curidx<0){
                continue;
            }
            int req=m-len;
            
            if(store[curidx]>=req){
                can[i]=1;
                break;
            }
        }
        //actually after this, the only value that matters is the largest val
    
    }
    dba(store,0,n-1);
    dba(can,0,n-1);
    seg->update(0,0);
    FOR(i,m,n) { // this is thing should be one indexed
        if(!can[i-1])continue;
        chmin(D[i], seg->query(i-m, i-1) + 1);
        seg->update(i, D[i]);
    }
    if(D[n]>=inf)return -1;
    else return D[n];


}

Compilation message

paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:90:22: warning: iteration 100004 invokes undefined behavior [-Waggressive-loop-optimizations]
   90 |     FOR(i,1,MAXN)D[i]=inf;
      |                  ~~~~^~~~
paint.cpp:3:37: note: within this loop
    3 | #define FOR(i,s,e) for(int i = s; i <= (int)e; ++i)
......
   90 |     FOR(i,1,MAXN)D[i]=inf;
      |         ~~~~~~~~                     
paint.cpp:90:5: note: in expansion of macro 'FOR'
   90 |     FOR(i,1,MAXN)D[i]=inf;
      |     ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 3028 KB Output is correct
2 Correct 2 ms 3028 KB Output is correct
3 Correct 3 ms 3028 KB Output is correct
4 Correct 2 ms 3028 KB Output is correct
5 Correct 2 ms 3012 KB Output is correct
6 Correct 2 ms 3028 KB Output is correct
7 Correct 2 ms 3028 KB Output is correct
8 Correct 2 ms 3028 KB Output is correct
9 Correct 2 ms 3028 KB Output is correct
10 Correct 2 ms 3028 KB Output is correct
11 Correct 2 ms 3028 KB Output is correct
12 Correct 2 ms 3028 KB Output is correct
13 Correct 2 ms 3028 KB Output is correct
14 Correct 2 ms 3028 KB Output is correct
15 Correct 3 ms 3028 KB Output is correct
16 Correct 2 ms 3028 KB Output is correct
17 Correct 2 ms 3028 KB Output is correct
18 Correct 2 ms 3028 KB Output is correct
19 Correct 2 ms 3156 KB Output is correct
20 Correct 2 ms 3156 KB Output is correct
21 Correct 2 ms 3156 KB Output is correct
22 Correct 19 ms 7112 KB Output is correct
23 Correct 18 ms 7016 KB Output is correct
24 Correct 17 ms 6996 KB Output is correct
25 Correct 9 ms 5076 KB Output is correct
26 Correct 10 ms 5116 KB Output is correct
27 Correct 8 ms 5096 KB Output is correct
28 Correct 7 ms 5076 KB Output is correct
29 Correct 9 ms 5088 KB Output is correct
30 Correct 9 ms 5076 KB Output is correct
31 Correct 19 ms 6112 KB Output is correct
32 Correct 15 ms 6108 KB Output is correct
33 Correct 15 ms 6100 KB Output is correct
34 Correct 15 ms 6004 KB Output is correct
35 Correct 15 ms 6060 KB Output is correct
36 Correct 15 ms 6108 KB Output is correct
37 Correct 33 ms 9188 KB Output is correct
38 Correct 24 ms 9172 KB Output is correct
39 Correct 28 ms 9156 KB Output is correct
40 Correct 34 ms 12636 KB Output is correct
41 Correct 27 ms 9108 KB Output is correct
42 Correct 34 ms 13524 KB Output is correct
43 Correct 20 ms 9956 KB Output is correct
44 Correct 18 ms 9292 KB Output is correct
45 Correct 27 ms 13652 KB Output is correct
46 Correct 60 ms 20524 KB Output is correct
47 Correct 42 ms 13524 KB Output is correct
48 Correct 38 ms 15988 KB Output is correct
49 Correct 51 ms 16588 KB Output is correct
50 Correct 60 ms 17100 KB Output is correct
51 Correct 39 ms 15308 KB Output is correct
52 Correct 38 ms 13704 KB Output is correct
53 Correct 36 ms 13652 KB Output is correct
54 Correct 44 ms 13604 KB Output is correct
55 Correct 30 ms 13608 KB Output is correct
56 Correct 32 ms 13596 KB Output is correct
57 Correct 29 ms 13716 KB Output is correct
58 Correct 66 ms 22636 KB Output is correct
59 Correct 73 ms 22604 KB Output is correct
60 Correct 72 ms 22548 KB Output is correct
61 Correct 83 ms 22632 KB Output is correct
62 Correct 72 ms 22732 KB Output is correct
63 Correct 70 ms 22612 KB Output is correct
64 Correct 70 ms 21784 KB Output is correct
65 Correct 65 ms 21752 KB Output is correct
66 Correct 64 ms 21708 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 3028 KB Output is correct
2 Correct 2 ms 3028 KB Output is correct
3 Correct 3 ms 3028 KB Output is correct
4 Correct 2 ms 3028 KB Output is correct
5 Correct 2 ms 3012 KB Output is correct
6 Correct 2 ms 3028 KB Output is correct
7 Correct 2 ms 3028 KB Output is correct
8 Correct 2 ms 3028 KB Output is correct
9 Correct 2 ms 3028 KB Output is correct
10 Correct 2 ms 3028 KB Output is correct
11 Correct 2 ms 3028 KB Output is correct
12 Correct 2 ms 3028 KB Output is correct
13 Correct 2 ms 3028 KB Output is correct
14 Correct 2 ms 3028 KB Output is correct
15 Correct 3 ms 3028 KB Output is correct
16 Correct 2 ms 3028 KB Output is correct
17 Correct 2 ms 3028 KB Output is correct
18 Correct 2 ms 3028 KB Output is correct
19 Correct 2 ms 3156 KB Output is correct
20 Correct 2 ms 3156 KB Output is correct
21 Correct 2 ms 3156 KB Output is correct
22 Correct 1 ms 3028 KB Output is correct
23 Correct 1 ms 3028 KB Output is correct
24 Correct 2 ms 3028 KB Output is correct
25 Correct 2 ms 3028 KB Output is correct
26 Correct 1 ms 3028 KB Output is correct
27 Correct 1 ms 3028 KB Output is correct
28 Correct 2 ms 3028 KB Output is correct
29 Correct 2 ms 3028 KB Output is correct
30 Correct 2 ms 3028 KB Output is correct
31 Correct 2 ms 3028 KB Output is correct
32 Correct 2 ms 3028 KB Output is correct
33 Correct 2 ms 3028 KB Output is correct
34 Correct 2 ms 3084 KB Output is correct
35 Correct 2 ms 3028 KB Output is correct
36 Correct 2 ms 3028 KB Output is correct
37 Correct 2 ms 3028 KB Output is correct
38 Correct 2 ms 3028 KB Output is correct
39 Correct 2 ms 3028 KB Output is correct
40 Correct 2 ms 3028 KB Output is correct
41 Correct 2 ms 3028 KB Output is correct
42 Correct 2 ms 3028 KB Output is correct
43 Correct 2 ms 3028 KB Output is correct
44 Correct 3 ms 3028 KB Output is correct
45 Correct 2 ms 3028 KB Output is correct
46 Correct 2 ms 3028 KB Output is correct
47 Correct 3 ms 3028 KB Output is correct
48 Correct 2 ms 3028 KB Output is correct
49 Correct 2 ms 3028 KB Output is correct
50 Correct 2 ms 3136 KB Output is correct
51 Correct 2 ms 3028 KB Output is correct
52 Correct 3 ms 3028 KB Output is correct
53 Correct 2 ms 3028 KB Output is correct
54 Correct 2 ms 3028 KB Output is correct
55 Correct 2 ms 3028 KB Output is correct
56 Correct 2 ms 3156 KB Output is correct
57 Correct 2 ms 3028 KB Output is correct
58 Correct 2 ms 3072 KB Output is correct
59 Correct 2 ms 3028 KB Output is correct
60 Correct 2 ms 3156 KB Output is correct
61 Correct 2 ms 3028 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3028 KB Output is correct
2 Correct 1 ms 3028 KB Output is correct
3 Correct 2 ms 3028 KB Output is correct
4 Correct 2 ms 3028 KB Output is correct
5 Correct 3 ms 3028 KB Output is correct
6 Correct 2 ms 3028 KB Output is correct
7 Correct 2 ms 3012 KB Output is correct
8 Correct 2 ms 3028 KB Output is correct
9 Correct 2 ms 3028 KB Output is correct
10 Correct 2 ms 3028 KB Output is correct
11 Correct 2 ms 3028 KB Output is correct
12 Correct 2 ms 3028 KB Output is correct
13 Correct 2 ms 3028 KB Output is correct
14 Correct 2 ms 3028 KB Output is correct
15 Correct 2 ms 3028 KB Output is correct
16 Correct 2 ms 3028 KB Output is correct
17 Correct 3 ms 3028 KB Output is correct
18 Correct 2 ms 3028 KB Output is correct
19 Correct 2 ms 3028 KB Output is correct
20 Correct 2 ms 3028 KB Output is correct
21 Correct 2 ms 3156 KB Output is correct
22 Correct 2 ms 3156 KB Output is correct
23 Correct 2 ms 3156 KB Output is correct
24 Correct 19 ms 7112 KB Output is correct
25 Correct 18 ms 7016 KB Output is correct
26 Correct 17 ms 6996 KB Output is correct
27 Correct 2 ms 3028 KB Output is correct
28 Correct 2 ms 3028 KB Output is correct
29 Correct 1 ms 3028 KB Output is correct
30 Correct 1 ms 3028 KB Output is correct
31 Correct 2 ms 3028 KB Output is correct
32 Correct 2 ms 3028 KB Output is correct
33 Correct 2 ms 3028 KB Output is correct
34 Correct 2 ms 3028 KB Output is correct
35 Correct 2 ms 3028 KB Output is correct
36 Correct 2 ms 3028 KB Output is correct
37 Correct 2 ms 3084 KB Output is correct
38 Correct 2 ms 3028 KB Output is correct
39 Correct 2 ms 3028 KB Output is correct
40 Correct 2 ms 3028 KB Output is correct
41 Correct 2 ms 3028 KB Output is correct
42 Correct 2 ms 3028 KB Output is correct
43 Correct 2 ms 3028 KB Output is correct
44 Correct 2 ms 3028 KB Output is correct
45 Correct 2 ms 3028 KB Output is correct
46 Correct 2 ms 3028 KB Output is correct
47 Correct 3 ms 3028 KB Output is correct
48 Correct 2 ms 3028 KB Output is correct
49 Correct 2 ms 3028 KB Output is correct
50 Correct 3 ms 3028 KB Output is correct
51 Correct 2 ms 3028 KB Output is correct
52 Correct 2 ms 3028 KB Output is correct
53 Correct 2 ms 3136 KB Output is correct
54 Correct 2 ms 3028 KB Output is correct
55 Correct 3 ms 3028 KB Output is correct
56 Correct 2 ms 3028 KB Output is correct
57 Correct 2 ms 3028 KB Output is correct
58 Correct 2 ms 3028 KB Output is correct
59 Correct 2 ms 3156 KB Output is correct
60 Correct 2 ms 3028 KB Output is correct
61 Correct 2 ms 3072 KB Output is correct
62 Correct 2 ms 3028 KB Output is correct
63 Correct 2 ms 3156 KB Output is correct
64 Correct 2 ms 3028 KB Output is correct
65 Correct 4 ms 3028 KB Output is correct
66 Correct 3 ms 3028 KB Output is correct
67 Correct 4 ms 3028 KB Output is correct
68 Correct 3 ms 3028 KB Output is correct
69 Correct 5 ms 3028 KB Output is correct
70 Correct 4 ms 3284 KB Output is correct
71 Correct 4 ms 3284 KB Output is correct
72 Correct 4 ms 3156 KB Output is correct
73 Correct 3 ms 3180 KB Output is correct
74 Correct 4 ms 3156 KB Output is correct
75 Correct 3 ms 3156 KB Output is correct
76 Correct 20 ms 5740 KB Output is correct
77 Correct 17 ms 6168 KB Output is correct
78 Correct 31 ms 6540 KB Output is correct
79 Correct 6 ms 3028 KB Output is correct
80 Correct 6 ms 3156 KB Output is correct
81 Correct 6 ms 3028 KB Output is correct
82 Correct 6 ms 3156 KB Output is correct
83 Correct 6 ms 3156 KB Output is correct
84 Correct 4 ms 3284 KB Output is correct
85 Correct 4 ms 3284 KB Output is correct
86 Correct 4 ms 3284 KB Output is correct
87 Correct 7 ms 3284 KB Output is correct
88 Correct 4 ms 3284 KB Output is correct
89 Correct 4 ms 3284 KB Output is correct
90 Correct 25 ms 6740 KB Output is correct
91 Correct 27 ms 6776 KB Output is correct
92 Correct 26 ms 6740 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3028 KB Output is correct
2 Correct 1 ms 3028 KB Output is correct
3 Correct 2 ms 3028 KB Output is correct
4 Correct 2 ms 3028 KB Output is correct
5 Correct 3 ms 3028 KB Output is correct
6 Correct 2 ms 3028 KB Output is correct
7 Correct 2 ms 3012 KB Output is correct
8 Correct 2 ms 3028 KB Output is correct
9 Correct 2 ms 3028 KB Output is correct
10 Correct 2 ms 3028 KB Output is correct
11 Correct 2 ms 3028 KB Output is correct
12 Correct 2 ms 3028 KB Output is correct
13 Correct 2 ms 3028 KB Output is correct
14 Correct 2 ms 3028 KB Output is correct
15 Correct 2 ms 3028 KB Output is correct
16 Correct 2 ms 3028 KB Output is correct
17 Correct 3 ms 3028 KB Output is correct
18 Correct 2 ms 3028 KB Output is correct
19 Correct 2 ms 3028 KB Output is correct
20 Correct 2 ms 3028 KB Output is correct
21 Correct 2 ms 3156 KB Output is correct
22 Correct 2 ms 3156 KB Output is correct
23 Correct 2 ms 3156 KB Output is correct
24 Correct 19 ms 7112 KB Output is correct
25 Correct 18 ms 7016 KB Output is correct
26 Correct 17 ms 6996 KB Output is correct
27 Correct 9 ms 5076 KB Output is correct
28 Correct 10 ms 5116 KB Output is correct
29 Correct 8 ms 5096 KB Output is correct
30 Correct 7 ms 5076 KB Output is correct
31 Correct 9 ms 5088 KB Output is correct
32 Correct 9 ms 5076 KB Output is correct
33 Correct 19 ms 6112 KB Output is correct
34 Correct 15 ms 6108 KB Output is correct
35 Correct 15 ms 6100 KB Output is correct
36 Correct 15 ms 6004 KB Output is correct
37 Correct 15 ms 6060 KB Output is correct
38 Correct 15 ms 6108 KB Output is correct
39 Correct 33 ms 9188 KB Output is correct
40 Correct 24 ms 9172 KB Output is correct
41 Correct 28 ms 9156 KB Output is correct
42 Correct 2 ms 3028 KB Output is correct
43 Correct 2 ms 3028 KB Output is correct
44 Correct 1 ms 3028 KB Output is correct
45 Correct 1 ms 3028 KB Output is correct
46 Correct 2 ms 3028 KB Output is correct
47 Correct 2 ms 3028 KB Output is correct
48 Correct 2 ms 3028 KB Output is correct
49 Correct 2 ms 3028 KB Output is correct
50 Correct 2 ms 3028 KB Output is correct
51 Correct 2 ms 3028 KB Output is correct
52 Correct 2 ms 3084 KB Output is correct
53 Correct 2 ms 3028 KB Output is correct
54 Correct 2 ms 3028 KB Output is correct
55 Correct 2 ms 3028 KB Output is correct
56 Correct 2 ms 3028 KB Output is correct
57 Correct 2 ms 3028 KB Output is correct
58 Correct 2 ms 3028 KB Output is correct
59 Correct 2 ms 3028 KB Output is correct
60 Correct 2 ms 3028 KB Output is correct
61 Correct 2 ms 3028 KB Output is correct
62 Correct 3 ms 3028 KB Output is correct
63 Correct 2 ms 3028 KB Output is correct
64 Correct 2 ms 3028 KB Output is correct
65 Correct 3 ms 3028 KB Output is correct
66 Correct 2 ms 3028 KB Output is correct
67 Correct 2 ms 3028 KB Output is correct
68 Correct 2 ms 3136 KB Output is correct
69 Correct 2 ms 3028 KB Output is correct
70 Correct 3 ms 3028 KB Output is correct
71 Correct 2 ms 3028 KB Output is correct
72 Correct 2 ms 3028 KB Output is correct
73 Correct 2 ms 3028 KB Output is correct
74 Correct 2 ms 3156 KB Output is correct
75 Correct 2 ms 3028 KB Output is correct
76 Correct 2 ms 3072 KB Output is correct
77 Correct 2 ms 3028 KB Output is correct
78 Correct 2 ms 3156 KB Output is correct
79 Correct 2 ms 3028 KB Output is correct
80 Correct 4 ms 3028 KB Output is correct
81 Correct 3 ms 3028 KB Output is correct
82 Correct 4 ms 3028 KB Output is correct
83 Correct 3 ms 3028 KB Output is correct
84 Correct 5 ms 3028 KB Output is correct
85 Correct 4 ms 3284 KB Output is correct
86 Correct 4 ms 3284 KB Output is correct
87 Correct 4 ms 3156 KB Output is correct
88 Correct 3 ms 3180 KB Output is correct
89 Correct 4 ms 3156 KB Output is correct
90 Correct 3 ms 3156 KB Output is correct
91 Correct 20 ms 5740 KB Output is correct
92 Correct 17 ms 6168 KB Output is correct
93 Correct 31 ms 6540 KB Output is correct
94 Correct 6 ms 3028 KB Output is correct
95 Correct 6 ms 3156 KB Output is correct
96 Correct 6 ms 3028 KB Output is correct
97 Correct 6 ms 3156 KB Output is correct
98 Correct 6 ms 3156 KB Output is correct
99 Correct 4 ms 3284 KB Output is correct
100 Correct 4 ms 3284 KB Output is correct
101 Correct 4 ms 3284 KB Output is correct
102 Correct 7 ms 3284 KB Output is correct
103 Correct 4 ms 3284 KB Output is correct
104 Correct 4 ms 3284 KB Output is correct
105 Correct 25 ms 6740 KB Output is correct
106 Correct 27 ms 6776 KB Output is correct
107 Correct 26 ms 6740 KB Output is correct
108 Correct 11 ms 5128 KB Output is correct
109 Correct 422 ms 4724 KB Output is correct
110 Correct 314 ms 4444 KB Output is correct
111 Correct 263 ms 4492 KB Output is correct
112 Correct 306 ms 4788 KB Output is correct
113 Correct 214 ms 4328 KB Output is correct
114 Correct 18 ms 5332 KB Output is correct
115 Correct 17 ms 5112 KB Output is correct
116 Correct 22 ms 6088 KB Output is correct
117 Correct 18 ms 5204 KB Output is correct
118 Correct 19 ms 5588 KB Output is correct
119 Correct 17 ms 5408 KB Output is correct
120 Correct 19 ms 6672 KB Output is correct
121 Correct 11 ms 4700 KB Output is correct
122 Correct 24 ms 6828 KB Output is correct
123 Correct 12 ms 4624 KB Output is correct
124 Correct 27 ms 7948 KB Output is correct
125 Correct 18 ms 5460 KB Output is correct
126 Correct 12 ms 5332 KB Output is correct
127 Correct 13 ms 5748 KB Output is correct
128 Correct 9 ms 4964 KB Output is correct
129 Correct 14 ms 5076 KB Output is correct
130 Correct 10 ms 5076 KB Output is correct
131 Correct 536 ms 5280 KB Output is correct
132 Correct 637 ms 5360 KB Output is correct
133 Correct 538 ms 5292 KB Output is correct
134 Correct 465 ms 5336 KB Output is correct
135 Correct 490 ms 5324 KB Output is correct
136 Correct 24 ms 6604 KB Output is correct
137 Correct 25 ms 6612 KB Output is correct
138 Correct 25 ms 6476 KB Output is correct
139 Correct 32 ms 6568 KB Output is correct
140 Correct 25 ms 6612 KB Output is correct
141 Correct 25 ms 6516 KB Output is correct
142 Correct 38 ms 9024 KB Output is correct
143 Correct 16 ms 5872 KB Output is correct
144 Correct 38 ms 8992 KB Output is correct
145 Correct 17 ms 5808 KB Output is correct
146 Correct 35 ms 9048 KB Output is correct
147 Correct 16 ms 5808 KB Output is correct
148 Correct 13 ms 6116 KB Output is correct
149 Correct 17 ms 6100 KB Output is correct
150 Correct 18 ms 6100 KB Output is correct
151 Correct 12 ms 6000 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 3028 KB Output is correct
2 Correct 1 ms 3028 KB Output is correct
3 Correct 2 ms 3028 KB Output is correct
4 Correct 2 ms 3028 KB Output is correct
5 Correct 3 ms 3028 KB Output is correct
6 Correct 2 ms 3028 KB Output is correct
7 Correct 2 ms 3012 KB Output is correct
8 Correct 2 ms 3028 KB Output is correct
9 Correct 2 ms 3028 KB Output is correct
10 Correct 2 ms 3028 KB Output is correct
11 Correct 2 ms 3028 KB Output is correct
12 Correct 2 ms 3028 KB Output is correct
13 Correct 2 ms 3028 KB Output is correct
14 Correct 2 ms 3028 KB Output is correct
15 Correct 2 ms 3028 KB Output is correct
16 Correct 2 ms 3028 KB Output is correct
17 Correct 3 ms 3028 KB Output is correct
18 Correct 2 ms 3028 KB Output is correct
19 Correct 2 ms 3028 KB Output is correct
20 Correct 2 ms 3028 KB Output is correct
21 Correct 2 ms 3156 KB Output is correct
22 Correct 2 ms 3156 KB Output is correct
23 Correct 2 ms 3156 KB Output is correct
24 Correct 19 ms 7112 KB Output is correct
25 Correct 18 ms 7016 KB Output is correct
26 Correct 17 ms 6996 KB Output is correct
27 Correct 9 ms 5076 KB Output is correct
28 Correct 10 ms 5116 KB Output is correct
29 Correct 8 ms 5096 KB Output is correct
30 Correct 7 ms 5076 KB Output is correct
31 Correct 9 ms 5088 KB Output is correct
32 Correct 9 ms 5076 KB Output is correct
33 Correct 19 ms 6112 KB Output is correct
34 Correct 15 ms 6108 KB Output is correct
35 Correct 15 ms 6100 KB Output is correct
36 Correct 15 ms 6004 KB Output is correct
37 Correct 15 ms 6060 KB Output is correct
38 Correct 15 ms 6108 KB Output is correct
39 Correct 33 ms 9188 KB Output is correct
40 Correct 24 ms 9172 KB Output is correct
41 Correct 28 ms 9156 KB Output is correct
42 Correct 34 ms 12636 KB Output is correct
43 Correct 27 ms 9108 KB Output is correct
44 Correct 34 ms 13524 KB Output is correct
45 Correct 20 ms 9956 KB Output is correct
46 Correct 18 ms 9292 KB Output is correct
47 Correct 27 ms 13652 KB Output is correct
48 Correct 60 ms 20524 KB Output is correct
49 Correct 42 ms 13524 KB Output is correct
50 Correct 38 ms 15988 KB Output is correct
51 Correct 51 ms 16588 KB Output is correct
52 Correct 60 ms 17100 KB Output is correct
53 Correct 39 ms 15308 KB Output is correct
54 Correct 38 ms 13704 KB Output is correct
55 Correct 36 ms 13652 KB Output is correct
56 Correct 44 ms 13604 KB Output is correct
57 Correct 30 ms 13608 KB Output is correct
58 Correct 32 ms 13596 KB Output is correct
59 Correct 29 ms 13716 KB Output is correct
60 Correct 66 ms 22636 KB Output is correct
61 Correct 73 ms 22604 KB Output is correct
62 Correct 72 ms 22548 KB Output is correct
63 Correct 83 ms 22632 KB Output is correct
64 Correct 72 ms 22732 KB Output is correct
65 Correct 70 ms 22612 KB Output is correct
66 Correct 70 ms 21784 KB Output is correct
67 Correct 65 ms 21752 KB Output is correct
68 Correct 64 ms 21708 KB Output is correct
69 Correct 2 ms 3028 KB Output is correct
70 Correct 2 ms 3028 KB Output is correct
71 Correct 1 ms 3028 KB Output is correct
72 Correct 1 ms 3028 KB Output is correct
73 Correct 2 ms 3028 KB Output is correct
74 Correct 2 ms 3028 KB Output is correct
75 Correct 2 ms 3028 KB Output is correct
76 Correct 2 ms 3028 KB Output is correct
77 Correct 2 ms 3028 KB Output is correct
78 Correct 2 ms 3028 KB Output is correct
79 Correct 2 ms 3084 KB Output is correct
80 Correct 2 ms 3028 KB Output is correct
81 Correct 2 ms 3028 KB Output is correct
82 Correct 2 ms 3028 KB Output is correct
83 Correct 2 ms 3028 KB Output is correct
84 Correct 2 ms 3028 KB Output is correct
85 Correct 2 ms 3028 KB Output is correct
86 Correct 2 ms 3028 KB Output is correct
87 Correct 2 ms 3028 KB Output is correct
88 Correct 2 ms 3028 KB Output is correct
89 Correct 3 ms 3028 KB Output is correct
90 Correct 2 ms 3028 KB Output is correct
91 Correct 2 ms 3028 KB Output is correct
92 Correct 3 ms 3028 KB Output is correct
93 Correct 2 ms 3028 KB Output is correct
94 Correct 2 ms 3028 KB Output is correct
95 Correct 2 ms 3136 KB Output is correct
96 Correct 2 ms 3028 KB Output is correct
97 Correct 3 ms 3028 KB Output is correct
98 Correct 2 ms 3028 KB Output is correct
99 Correct 2 ms 3028 KB Output is correct
100 Correct 2 ms 3028 KB Output is correct
101 Correct 2 ms 3156 KB Output is correct
102 Correct 2 ms 3028 KB Output is correct
103 Correct 2 ms 3072 KB Output is correct
104 Correct 2 ms 3028 KB Output is correct
105 Correct 2 ms 3156 KB Output is correct
106 Correct 2 ms 3028 KB Output is correct
107 Correct 4 ms 3028 KB Output is correct
108 Correct 3 ms 3028 KB Output is correct
109 Correct 4 ms 3028 KB Output is correct
110 Correct 3 ms 3028 KB Output is correct
111 Correct 5 ms 3028 KB Output is correct
112 Correct 4 ms 3284 KB Output is correct
113 Correct 4 ms 3284 KB Output is correct
114 Correct 4 ms 3156 KB Output is correct
115 Correct 3 ms 3180 KB Output is correct
116 Correct 4 ms 3156 KB Output is correct
117 Correct 3 ms 3156 KB Output is correct
118 Correct 20 ms 5740 KB Output is correct
119 Correct 17 ms 6168 KB Output is correct
120 Correct 31 ms 6540 KB Output is correct
121 Correct 6 ms 3028 KB Output is correct
122 Correct 6 ms 3156 KB Output is correct
123 Correct 6 ms 3028 KB Output is correct
124 Correct 6 ms 3156 KB Output is correct
125 Correct 6 ms 3156 KB Output is correct
126 Correct 4 ms 3284 KB Output is correct
127 Correct 4 ms 3284 KB Output is correct
128 Correct 4 ms 3284 KB Output is correct
129 Correct 7 ms 3284 KB Output is correct
130 Correct 4 ms 3284 KB Output is correct
131 Correct 4 ms 3284 KB Output is correct
132 Correct 25 ms 6740 KB Output is correct
133 Correct 27 ms 6776 KB Output is correct
134 Correct 26 ms 6740 KB Output is correct
135 Correct 11 ms 5128 KB Output is correct
136 Correct 422 ms 4724 KB Output is correct
137 Correct 314 ms 4444 KB Output is correct
138 Correct 263 ms 4492 KB Output is correct
139 Correct 306 ms 4788 KB Output is correct
140 Correct 214 ms 4328 KB Output is correct
141 Correct 18 ms 5332 KB Output is correct
142 Correct 17 ms 5112 KB Output is correct
143 Correct 22 ms 6088 KB Output is correct
144 Correct 18 ms 5204 KB Output is correct
145 Correct 19 ms 5588 KB Output is correct
146 Correct 17 ms 5408 KB Output is correct
147 Correct 19 ms 6672 KB Output is correct
148 Correct 11 ms 4700 KB Output is correct
149 Correct 24 ms 6828 KB Output is correct
150 Correct 12 ms 4624 KB Output is correct
151 Correct 27 ms 7948 KB Output is correct
152 Correct 18 ms 5460 KB Output is correct
153 Correct 12 ms 5332 KB Output is correct
154 Correct 13 ms 5748 KB Output is correct
155 Correct 9 ms 4964 KB Output is correct
156 Correct 14 ms 5076 KB Output is correct
157 Correct 10 ms 5076 KB Output is correct
158 Correct 536 ms 5280 KB Output is correct
159 Correct 637 ms 5360 KB Output is correct
160 Correct 538 ms 5292 KB Output is correct
161 Correct 465 ms 5336 KB Output is correct
162 Correct 490 ms 5324 KB Output is correct
163 Correct 24 ms 6604 KB Output is correct
164 Correct 25 ms 6612 KB Output is correct
165 Correct 25 ms 6476 KB Output is correct
166 Correct 32 ms 6568 KB Output is correct
167 Correct 25 ms 6612 KB Output is correct
168 Correct 25 ms 6516 KB Output is correct
169 Correct 38 ms 9024 KB Output is correct
170 Correct 16 ms 5872 KB Output is correct
171 Correct 38 ms 8992 KB Output is correct
172 Correct 17 ms 5808 KB Output is correct
173 Correct 35 ms 9048 KB Output is correct
174 Correct 16 ms 5808 KB Output is correct
175 Correct 13 ms 6116 KB Output is correct
176 Correct 17 ms 6100 KB Output is correct
177 Correct 18 ms 6100 KB Output is correct
178 Correct 12 ms 6000 KB Output is correct
179 Correct 26 ms 9560 KB Output is correct
180 Correct 1095 ms 8672 KB Output is correct
181 Execution timed out 1596 ms 11092 KB Time limit exceeded
182 Halted 0 ms 0 KB -