답안 #293760

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
293760 2020-09-08T11:35:48 Z crossing0ver Interval Collection (CCO20_day2problem2) C++17
18 / 25
7000 ms 724408 KB
#include<bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define fi first
#define se second
#define pb push_back
using namespace std;
const int N = 1e6+6,inf = 1e8;
int F[N],ANS[N];
vector<pii> Q[N*4];
void qer(int v,int tl,int tr,int l,int r,int QL,int QR) {
    if (l > tr || r < tl) return;
    if (l <= tl && r  >= tr) {
        Q[v].pb({QL,QR});
        return;
    }
    int tm = (tl + tr)/2;
    qer(v*2,tl,tm,l,r,QL,QR);
    qer(v*2+1,tm+1,tr,l,r,QL,QR);
}
int cans=INT_MAX;
int t[2][4*N],timer;
int *H[100000000];
int val[100000000];
void change(int&x,int c) {
    ++timer;
    H[timer] = &x;
    val[timer] = x;
    x = c;
}
void rollback() {
    (*H[timer]) = val[timer];
    timer--;
}
bool type;
int VAL,pos,L,R;
void add(int v=1,int tl=1,int tr=1e6) {
    if (tl == tr) {
        if (type == 0)
            change(t[0][v],min(t[0][v],VAL));
        else change(t[1][v],max(t[1][v],VAL));
        return;
    }
    int tm = (tl + tr)/2;
    if (pos <= tm) {
    add(v*2,tl,tm);
    }
    else add(v*2+1,tm+1,tr);
    if (type == 0)
        change(t[0][v],min(t[0][v*2],t[0][v*2+1]));
    else
         change(t[1][v],max(t[1][v*2],t[1][v*2+1]));
}
int get(int v=1,int tl=1,int tr=1e6) {
    if (L> tr || R < tl) {
        if (type == 0) return inf;
        else return -inf;
    }
    if (L <= tl && R >= tr) return t[type][v];
    int tm = (tl + tr)/2;
    if (type == 0)
        return min(get(v*2,tl,tm),get(v*2+1,tm+1,tr));
    else return max(get(v*2,tl,tm),get(v*2+1,tm+1,tr));
}
char c;
int l,r,q,i,id,len,l1,r1;
void dfs(int v,int tl,int tr) {
    int in_ans = cans;
    int start_time = timer;
    for (auto i1 : Q[v]) {
         l = i1.fi;
        r = i1.se;

        type = 0;
        L = r;
        R = 1e6;
        type = 0;
        if (cans > r - l)
        cans = min(cans, -l + get());
        L = 1;
        R = l;type = 1;
        if (cans > r - l)
        cans = min(cans, r - get());
        pos = l;
        VAL = r;
        type = 0;
        add(); // l-ze patara r-ebshi udidesi l, r-ze did l-ebshi umciresi r
        pos = r;
        VAL = l;
        type = 1;
        add();
    }
    if (tl != tr) {
        int tm = (tl + tr)/2;
        dfs(v*2,tl,tm);
        dfs(v*2+1,tm+1,tr);
    }else {
        if (F[tl])
            ANS[tl] = cans;
    }
    while(start_time != timer) {
        rollback();
    }
    cans = in_ans;
}
pair<pii,char> query[500006];
multiset<int> AL[1000004],AR[1000004];
set<int> cnt[1000005];
main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    multiset<int> L,R;
    cin >> q;
    for (i = 0; i < 4*N;i ++)
        t[0][i] = inf, t[1][i] = -inf;

    vector<pii> t(q);
    for (int i = 1; i <= q; i++) {
        cin >> c >> l >> r;
        query[i] = {{l,r},c};
        t[i-1] = {l,r};
    }
    sort(all(t));
    t.resize(unique(all(t)) - t.begin());
    map<pii,int> ID;
    for (int i = 0; i < t.size(); i++) {
        ID[t[i]] = i;
    }
    for (i = 1; i <= q; i++) {
             c=  query[i].se;
     l = query[i].fi.fi;
     r = query[i].fi.se;
     id = ID[{l,r}];
        if (c == 'A') {
                cnt[id].insert(i);
            L.insert(l);
            R.insert(r);
            AR[l].insert(r);
            AL[r].insert(l);
        }else {
            qer(1,1,q,*cnt[id].begin(),i-1,l,r);
            cnt[id].erase(cnt[id].begin());
            AL[r].erase(AL[r].find(l));
            AR[l].erase(AR[l].find(r));
            L.erase(L.find(l));
            R.erase(R.find(r));
        }
        l = *L.rbegin();
        r = *R.begin();
         len = max(0,r - l);
        if (len) {
        l1 = l, r1 = r;
        r = *AR[l1].begin();
        l = *AL[r1].rbegin();
        ANS[i] = r-l;
        }else {
            F[i] = 1;
        }}
        for (i= 0; i < t.size(); i++)
            for (int j : cnt[i])
                qer(1,1,q,j,q,t[i].fi,t[i].se);
        dfs(1,1,q);
        for ( i = 1; i <= q; i++)
            cout << ANS[i] <<'\n';
}

Compilation message

Main.cpp:111:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  111 | main() {
      |      ^
Main.cpp: In function 'int main()':
Main.cpp:129:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  129 |     for (int i = 0; i < t.size(); i++) {
      |                     ~~^~~~~~~~~~
Main.cpp:162:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  162 |         for (i= 0; i < t.size(); i++)
      |                    ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 175 ms 266744 KB Output is correct
2 Correct 182 ms 266616 KB Output is correct
3 Correct 184 ms 266644 KB Output is correct
4 Correct 175 ms 266744 KB Output is correct
5 Correct 168 ms 266744 KB Output is correct
6 Correct 167 ms 266616 KB Output is correct
7 Correct 164 ms 266744 KB Output is correct
8 Correct 166 ms 266616 KB Output is correct
9 Correct 169 ms 266872 KB Output is correct
10 Correct 167 ms 266872 KB Output is correct
11 Correct 169 ms 266744 KB Output is correct
12 Correct 171 ms 266872 KB Output is correct
13 Correct 168 ms 267000 KB Output is correct
14 Correct 170 ms 266916 KB Output is correct
15 Correct 170 ms 267000 KB Output is correct
16 Correct 171 ms 267000 KB Output is correct
17 Correct 169 ms 266872 KB Output is correct
18 Correct 169 ms 266616 KB Output is correct
19 Correct 166 ms 266620 KB Output is correct
20 Correct 171 ms 266616 KB Output is correct
21 Correct 181 ms 266732 KB Output is correct
22 Correct 176 ms 266640 KB Output is correct
23 Correct 171 ms 266616 KB Output is correct
24 Correct 172 ms 266616 KB Output is correct
25 Correct 172 ms 266912 KB Output is correct
26 Correct 170 ms 266872 KB Output is correct
27 Correct 170 ms 266744 KB Output is correct
28 Correct 170 ms 266744 KB Output is correct
29 Correct 170 ms 267000 KB Output is correct
30 Correct 167 ms 267000 KB Output is correct
31 Correct 170 ms 267000 KB Output is correct
32 Correct 167 ms 267000 KB Output is correct
33 Correct 166 ms 266744 KB Output is correct
34 Correct 170 ms 266616 KB Output is correct
35 Correct 166 ms 266616 KB Output is correct
36 Correct 166 ms 266616 KB Output is correct
37 Correct 168 ms 266616 KB Output is correct
38 Correct 165 ms 266616 KB Output is correct
39 Correct 176 ms 266616 KB Output is correct
40 Correct 186 ms 266616 KB Output is correct
41 Correct 174 ms 266744 KB Output is correct
42 Correct 170 ms 266616 KB Output is correct
43 Correct 169 ms 266616 KB Output is correct
44 Correct 170 ms 266616 KB Output is correct
45 Correct 170 ms 266744 KB Output is correct
46 Correct 172 ms 266616 KB Output is correct
47 Correct 181 ms 266616 KB Output is correct
48 Correct 170 ms 266616 KB Output is correct
49 Correct 169 ms 266744 KB Output is correct
50 Correct 165 ms 266744 KB Output is correct
51 Correct 165 ms 266744 KB Output is correct
52 Correct 167 ms 266744 KB Output is correct
53 Correct 175 ms 266744 KB Output is correct
54 Correct 170 ms 266744 KB Output is correct
55 Correct 163 ms 266744 KB Output is correct
56 Correct 180 ms 266872 KB Output is correct
57 Correct 164 ms 266744 KB Output is correct
58 Correct 168 ms 266744 KB Output is correct
59 Correct 170 ms 267000 KB Output is correct
60 Correct 171 ms 267000 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 175 ms 266744 KB Output is correct
2 Correct 182 ms 266616 KB Output is correct
3 Correct 184 ms 266644 KB Output is correct
4 Correct 175 ms 266744 KB Output is correct
5 Correct 168 ms 266744 KB Output is correct
6 Correct 167 ms 266616 KB Output is correct
7 Correct 164 ms 266744 KB Output is correct
8 Correct 166 ms 266616 KB Output is correct
9 Correct 169 ms 266872 KB Output is correct
10 Correct 167 ms 266872 KB Output is correct
11 Correct 169 ms 266744 KB Output is correct
12 Correct 171 ms 266872 KB Output is correct
13 Correct 168 ms 267000 KB Output is correct
14 Correct 170 ms 266916 KB Output is correct
15 Correct 170 ms 267000 KB Output is correct
16 Correct 171 ms 267000 KB Output is correct
17 Correct 169 ms 266872 KB Output is correct
18 Correct 169 ms 266616 KB Output is correct
19 Correct 166 ms 266620 KB Output is correct
20 Correct 171 ms 266616 KB Output is correct
21 Correct 181 ms 266732 KB Output is correct
22 Correct 176 ms 266640 KB Output is correct
23 Correct 171 ms 266616 KB Output is correct
24 Correct 172 ms 266616 KB Output is correct
25 Correct 172 ms 266912 KB Output is correct
26 Correct 170 ms 266872 KB Output is correct
27 Correct 170 ms 266744 KB Output is correct
28 Correct 170 ms 266744 KB Output is correct
29 Correct 170 ms 267000 KB Output is correct
30 Correct 167 ms 267000 KB Output is correct
31 Correct 170 ms 267000 KB Output is correct
32 Correct 167 ms 267000 KB Output is correct
33 Correct 166 ms 266744 KB Output is correct
34 Correct 170 ms 266616 KB Output is correct
35 Correct 166 ms 266616 KB Output is correct
36 Correct 166 ms 266616 KB Output is correct
37 Correct 168 ms 266616 KB Output is correct
38 Correct 165 ms 266616 KB Output is correct
39 Correct 176 ms 266616 KB Output is correct
40 Correct 186 ms 266616 KB Output is correct
41 Correct 174 ms 266744 KB Output is correct
42 Correct 170 ms 266616 KB Output is correct
43 Correct 169 ms 266616 KB Output is correct
44 Correct 170 ms 266616 KB Output is correct
45 Correct 170 ms 266744 KB Output is correct
46 Correct 172 ms 266616 KB Output is correct
47 Correct 181 ms 266616 KB Output is correct
48 Correct 170 ms 266616 KB Output is correct
49 Correct 169 ms 266744 KB Output is correct
50 Correct 165 ms 266744 KB Output is correct
51 Correct 165 ms 266744 KB Output is correct
52 Correct 167 ms 266744 KB Output is correct
53 Correct 175 ms 266744 KB Output is correct
54 Correct 170 ms 266744 KB Output is correct
55 Correct 163 ms 266744 KB Output is correct
56 Correct 180 ms 266872 KB Output is correct
57 Correct 164 ms 266744 KB Output is correct
58 Correct 168 ms 266744 KB Output is correct
59 Correct 170 ms 267000 KB Output is correct
60 Correct 171 ms 267000 KB Output is correct
61 Correct 171 ms 266488 KB Output is correct
62 Correct 186 ms 266540 KB Output is correct
63 Correct 179 ms 266488 KB Output is correct
64 Correct 290 ms 273148 KB Output is correct
65 Correct 254 ms 269432 KB Output is correct
66 Correct 233 ms 268408 KB Output is correct
67 Correct 202 ms 267768 KB Output is correct
68 Correct 281 ms 273144 KB Output is correct
69 Correct 253 ms 269432 KB Output is correct
70 Correct 233 ms 268664 KB Output is correct
71 Correct 227 ms 268280 KB Output is correct
72 Correct 290 ms 275960 KB Output is correct
73 Correct 277 ms 274552 KB Output is correct
74 Correct 275 ms 274296 KB Output is correct
75 Correct 276 ms 274040 KB Output is correct
76 Correct 291 ms 277588 KB Output is correct
77 Correct 292 ms 277752 KB Output is correct
78 Correct 288 ms 277624 KB Output is correct
79 Correct 286 ms 277752 KB Output is correct
80 Correct 296 ms 273152 KB Output is correct
81 Correct 249 ms 269432 KB Output is correct
82 Correct 233 ms 268540 KB Output is correct
83 Correct 207 ms 267768 KB Output is correct
84 Correct 305 ms 273276 KB Output is correct
85 Correct 253 ms 269432 KB Output is correct
86 Correct 231 ms 268536 KB Output is correct
87 Correct 228 ms 268368 KB Output is correct
88 Correct 283 ms 275832 KB Output is correct
89 Correct 280 ms 274552 KB Output is correct
90 Correct 272 ms 274168 KB Output is correct
91 Correct 281 ms 273912 KB Output is correct
92 Correct 292 ms 277628 KB Output is correct
93 Correct 294 ms 277624 KB Output is correct
94 Correct 296 ms 277752 KB Output is correct
95 Correct 298 ms 277624 KB Output is correct
96 Correct 214 ms 267768 KB Output is correct
97 Correct 207 ms 267848 KB Output is correct
98 Correct 199 ms 267768 KB Output is correct
99 Correct 207 ms 267768 KB Output is correct
100 Correct 226 ms 268280 KB Output is correct
101 Correct 216 ms 268152 KB Output is correct
102 Correct 226 ms 268280 KB Output is correct
103 Correct 204 ms 267896 KB Output is correct
104 Correct 269 ms 272760 KB Output is correct
105 Correct 245 ms 269304 KB Output is correct
106 Correct 232 ms 268280 KB Output is correct
107 Correct 203 ms 267900 KB Output is correct
108 Correct 270 ms 272248 KB Output is correct
109 Correct 246 ms 269048 KB Output is correct
110 Correct 263 ms 268408 KB Output is correct
111 Correct 218 ms 267896 KB Output is correct
112 Correct 252 ms 272632 KB Output is correct
113 Correct 261 ms 272760 KB Output is correct
114 Correct 252 ms 272632 KB Output is correct
115 Correct 258 ms 272636 KB Output is correct
116 Correct 253 ms 272632 KB Output is correct
117 Correct 262 ms 272760 KB Output is correct
118 Correct 253 ms 272632 KB Output is correct
119 Correct 261 ms 272632 KB Output is correct
120 Correct 252 ms 272632 KB Output is correct
121 Correct 262 ms 272632 KB Output is correct
122 Correct 312 ms 277752 KB Output is correct
123 Correct 274 ms 277596 KB Output is correct
124 Correct 265 ms 269560 KB Output is correct
125 Correct 267 ms 268792 KB Output is correct
126 Correct 247 ms 268536 KB Output is correct
127 Correct 268 ms 270456 KB Output is correct
128 Correct 270 ms 268792 KB Output is correct
129 Correct 242 ms 268408 KB Output is correct
130 Correct 271 ms 270840 KB Output is correct
131 Correct 247 ms 268664 KB Output is correct
132 Correct 241 ms 268536 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 175 ms 266744 KB Output is correct
2 Correct 182 ms 266616 KB Output is correct
3 Correct 184 ms 266644 KB Output is correct
4 Correct 175 ms 266744 KB Output is correct
5 Correct 168 ms 266744 KB Output is correct
6 Correct 167 ms 266616 KB Output is correct
7 Correct 164 ms 266744 KB Output is correct
8 Correct 166 ms 266616 KB Output is correct
9 Correct 169 ms 266872 KB Output is correct
10 Correct 167 ms 266872 KB Output is correct
11 Correct 169 ms 266744 KB Output is correct
12 Correct 171 ms 266872 KB Output is correct
13 Correct 168 ms 267000 KB Output is correct
14 Correct 170 ms 266916 KB Output is correct
15 Correct 170 ms 267000 KB Output is correct
16 Correct 171 ms 267000 KB Output is correct
17 Correct 169 ms 266872 KB Output is correct
18 Correct 169 ms 266616 KB Output is correct
19 Correct 166 ms 266620 KB Output is correct
20 Correct 171 ms 266616 KB Output is correct
21 Correct 181 ms 266732 KB Output is correct
22 Correct 176 ms 266640 KB Output is correct
23 Correct 171 ms 266616 KB Output is correct
24 Correct 172 ms 266616 KB Output is correct
25 Correct 172 ms 266912 KB Output is correct
26 Correct 170 ms 266872 KB Output is correct
27 Correct 170 ms 266744 KB Output is correct
28 Correct 170 ms 266744 KB Output is correct
29 Correct 170 ms 267000 KB Output is correct
30 Correct 167 ms 267000 KB Output is correct
31 Correct 170 ms 267000 KB Output is correct
32 Correct 167 ms 267000 KB Output is correct
33 Correct 166 ms 266744 KB Output is correct
34 Correct 170 ms 266616 KB Output is correct
35 Correct 166 ms 266616 KB Output is correct
36 Correct 166 ms 266616 KB Output is correct
37 Correct 168 ms 266616 KB Output is correct
38 Correct 165 ms 266616 KB Output is correct
39 Correct 176 ms 266616 KB Output is correct
40 Correct 186 ms 266616 KB Output is correct
41 Correct 174 ms 266744 KB Output is correct
42 Correct 170 ms 266616 KB Output is correct
43 Correct 169 ms 266616 KB Output is correct
44 Correct 170 ms 266616 KB Output is correct
45 Correct 170 ms 266744 KB Output is correct
46 Correct 172 ms 266616 KB Output is correct
47 Correct 181 ms 266616 KB Output is correct
48 Correct 170 ms 266616 KB Output is correct
49 Correct 169 ms 266744 KB Output is correct
50 Correct 165 ms 266744 KB Output is correct
51 Correct 165 ms 266744 KB Output is correct
52 Correct 167 ms 266744 KB Output is correct
53 Correct 175 ms 266744 KB Output is correct
54 Correct 170 ms 266744 KB Output is correct
55 Correct 163 ms 266744 KB Output is correct
56 Correct 180 ms 266872 KB Output is correct
57 Correct 164 ms 266744 KB Output is correct
58 Correct 168 ms 266744 KB Output is correct
59 Correct 170 ms 267000 KB Output is correct
60 Correct 171 ms 267000 KB Output is correct
61 Correct 171 ms 266488 KB Output is correct
62 Correct 186 ms 266540 KB Output is correct
63 Correct 179 ms 266488 KB Output is correct
64 Correct 290 ms 273148 KB Output is correct
65 Correct 254 ms 269432 KB Output is correct
66 Correct 233 ms 268408 KB Output is correct
67 Correct 202 ms 267768 KB Output is correct
68 Correct 281 ms 273144 KB Output is correct
69 Correct 253 ms 269432 KB Output is correct
70 Correct 233 ms 268664 KB Output is correct
71 Correct 227 ms 268280 KB Output is correct
72 Correct 290 ms 275960 KB Output is correct
73 Correct 277 ms 274552 KB Output is correct
74 Correct 275 ms 274296 KB Output is correct
75 Correct 276 ms 274040 KB Output is correct
76 Correct 291 ms 277588 KB Output is correct
77 Correct 292 ms 277752 KB Output is correct
78 Correct 288 ms 277624 KB Output is correct
79 Correct 286 ms 277752 KB Output is correct
80 Correct 296 ms 273152 KB Output is correct
81 Correct 249 ms 269432 KB Output is correct
82 Correct 233 ms 268540 KB Output is correct
83 Correct 207 ms 267768 KB Output is correct
84 Correct 305 ms 273276 KB Output is correct
85 Correct 253 ms 269432 KB Output is correct
86 Correct 231 ms 268536 KB Output is correct
87 Correct 228 ms 268368 KB Output is correct
88 Correct 283 ms 275832 KB Output is correct
89 Correct 280 ms 274552 KB Output is correct
90 Correct 272 ms 274168 KB Output is correct
91 Correct 281 ms 273912 KB Output is correct
92 Correct 292 ms 277628 KB Output is correct
93 Correct 294 ms 277624 KB Output is correct
94 Correct 296 ms 277752 KB Output is correct
95 Correct 298 ms 277624 KB Output is correct
96 Correct 214 ms 267768 KB Output is correct
97 Correct 207 ms 267848 KB Output is correct
98 Correct 199 ms 267768 KB Output is correct
99 Correct 207 ms 267768 KB Output is correct
100 Correct 226 ms 268280 KB Output is correct
101 Correct 216 ms 268152 KB Output is correct
102 Correct 226 ms 268280 KB Output is correct
103 Correct 204 ms 267896 KB Output is correct
104 Correct 269 ms 272760 KB Output is correct
105 Correct 245 ms 269304 KB Output is correct
106 Correct 232 ms 268280 KB Output is correct
107 Correct 203 ms 267900 KB Output is correct
108 Correct 270 ms 272248 KB Output is correct
109 Correct 246 ms 269048 KB Output is correct
110 Correct 263 ms 268408 KB Output is correct
111 Correct 218 ms 267896 KB Output is correct
112 Correct 252 ms 272632 KB Output is correct
113 Correct 261 ms 272760 KB Output is correct
114 Correct 252 ms 272632 KB Output is correct
115 Correct 258 ms 272636 KB Output is correct
116 Correct 253 ms 272632 KB Output is correct
117 Correct 262 ms 272760 KB Output is correct
118 Correct 253 ms 272632 KB Output is correct
119 Correct 261 ms 272632 KB Output is correct
120 Correct 252 ms 272632 KB Output is correct
121 Correct 262 ms 272632 KB Output is correct
122 Correct 312 ms 277752 KB Output is correct
123 Correct 274 ms 277596 KB Output is correct
124 Correct 265 ms 269560 KB Output is correct
125 Correct 267 ms 268792 KB Output is correct
126 Correct 247 ms 268536 KB Output is correct
127 Correct 268 ms 270456 KB Output is correct
128 Correct 270 ms 268792 KB Output is correct
129 Correct 242 ms 268408 KB Output is correct
130 Correct 271 ms 270840 KB Output is correct
131 Correct 247 ms 268664 KB Output is correct
132 Correct 241 ms 268536 KB Output is correct
133 Correct 787 ms 294392 KB Output is correct
134 Correct 630 ms 279032 KB Output is correct
135 Correct 512 ms 275192 KB Output is correct
136 Correct 367 ms 272504 KB Output is correct
137 Correct 762 ms 294312 KB Output is correct
138 Correct 664 ms 279164 KB Output is correct
139 Correct 555 ms 275320 KB Output is correct
140 Correct 451 ms 273868 KB Output is correct
141 Correct 829 ms 306036 KB Output is correct
142 Correct 790 ms 299892 KB Output is correct
143 Correct 760 ms 298488 KB Output is correct
144 Correct 771 ms 298360 KB Output is correct
145 Correct 834 ms 313216 KB Output is correct
146 Correct 843 ms 313212 KB Output is correct
147 Correct 853 ms 313332 KB Output is correct
148 Correct 847 ms 313236 KB Output is correct
149 Correct 772 ms 294416 KB Output is correct
150 Correct 631 ms 278920 KB Output is correct
151 Correct 506 ms 275064 KB Output is correct
152 Correct 377 ms 272504 KB Output is correct
153 Correct 767 ms 294392 KB Output is correct
154 Correct 653 ms 279160 KB Output is correct
155 Correct 516 ms 275064 KB Output is correct
156 Correct 448 ms 273784 KB Output is correct
157 Correct 819 ms 306164 KB Output is correct
158 Correct 773 ms 300024 KB Output is correct
159 Correct 760 ms 298616 KB Output is correct
160 Correct 770 ms 298436 KB Output is correct
161 Correct 820 ms 313208 KB Output is correct
162 Correct 835 ms 313076 KB Output is correct
163 Correct 826 ms 313080 KB Output is correct
164 Correct 856 ms 313076 KB Output is correct
165 Correct 324 ms 271992 KB Output is correct
166 Correct 318 ms 271916 KB Output is correct
167 Correct 327 ms 271952 KB Output is correct
168 Correct 323 ms 271992 KB Output is correct
169 Correct 461 ms 274040 KB Output is correct
170 Correct 416 ms 273528 KB Output is correct
171 Correct 407 ms 273272 KB Output is correct
172 Correct 352 ms 272376 KB Output is correct
173 Correct 745 ms 292868 KB Output is correct
174 Correct 607 ms 278520 KB Output is correct
175 Correct 493 ms 274680 KB Output is correct
176 Correct 358 ms 272248 KB Output is correct
177 Correct 720 ms 290592 KB Output is correct
178 Correct 611 ms 277880 KB Output is correct
179 Correct 518 ms 274424 KB Output is correct
180 Correct 399 ms 272248 KB Output is correct
181 Correct 561 ms 292444 KB Output is correct
182 Correct 623 ms 292344 KB Output is correct
183 Correct 530 ms 292340 KB Output is correct
184 Correct 630 ms 292444 KB Output is correct
185 Correct 544 ms 292324 KB Output is correct
186 Correct 622 ms 292340 KB Output is correct
187 Correct 546 ms 292368 KB Output is correct
188 Correct 619 ms 292340 KB Output is correct
189 Correct 551 ms 292340 KB Output is correct
190 Correct 617 ms 292468 KB Output is correct
191 Correct 800 ms 313076 KB Output is correct
192 Correct 628 ms 313076 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2776 ms 452804 KB Output is correct
2 Correct 2255 ms 452460 KB Output is correct
3 Correct 5517 ms 638104 KB Output is correct
4 Correct 5540 ms 637284 KB Output is correct
5 Correct 6819 ms 724408 KB Output is correct
6 Execution timed out 7084 ms 724180 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 175 ms 266744 KB Output is correct
2 Correct 182 ms 266616 KB Output is correct
3 Correct 184 ms 266644 KB Output is correct
4 Correct 175 ms 266744 KB Output is correct
5 Correct 168 ms 266744 KB Output is correct
6 Correct 167 ms 266616 KB Output is correct
7 Correct 164 ms 266744 KB Output is correct
8 Correct 166 ms 266616 KB Output is correct
9 Correct 169 ms 266872 KB Output is correct
10 Correct 167 ms 266872 KB Output is correct
11 Correct 169 ms 266744 KB Output is correct
12 Correct 171 ms 266872 KB Output is correct
13 Correct 168 ms 267000 KB Output is correct
14 Correct 170 ms 266916 KB Output is correct
15 Correct 170 ms 267000 KB Output is correct
16 Correct 171 ms 267000 KB Output is correct
17 Correct 169 ms 266872 KB Output is correct
18 Correct 169 ms 266616 KB Output is correct
19 Correct 166 ms 266620 KB Output is correct
20 Correct 171 ms 266616 KB Output is correct
21 Correct 181 ms 266732 KB Output is correct
22 Correct 176 ms 266640 KB Output is correct
23 Correct 171 ms 266616 KB Output is correct
24 Correct 172 ms 266616 KB Output is correct
25 Correct 172 ms 266912 KB Output is correct
26 Correct 170 ms 266872 KB Output is correct
27 Correct 170 ms 266744 KB Output is correct
28 Correct 170 ms 266744 KB Output is correct
29 Correct 170 ms 267000 KB Output is correct
30 Correct 167 ms 267000 KB Output is correct
31 Correct 170 ms 267000 KB Output is correct
32 Correct 167 ms 267000 KB Output is correct
33 Correct 166 ms 266744 KB Output is correct
34 Correct 170 ms 266616 KB Output is correct
35 Correct 166 ms 266616 KB Output is correct
36 Correct 166 ms 266616 KB Output is correct
37 Correct 168 ms 266616 KB Output is correct
38 Correct 165 ms 266616 KB Output is correct
39 Correct 176 ms 266616 KB Output is correct
40 Correct 186 ms 266616 KB Output is correct
41 Correct 174 ms 266744 KB Output is correct
42 Correct 170 ms 266616 KB Output is correct
43 Correct 169 ms 266616 KB Output is correct
44 Correct 170 ms 266616 KB Output is correct
45 Correct 170 ms 266744 KB Output is correct
46 Correct 172 ms 266616 KB Output is correct
47 Correct 181 ms 266616 KB Output is correct
48 Correct 170 ms 266616 KB Output is correct
49 Correct 169 ms 266744 KB Output is correct
50 Correct 165 ms 266744 KB Output is correct
51 Correct 165 ms 266744 KB Output is correct
52 Correct 167 ms 266744 KB Output is correct
53 Correct 175 ms 266744 KB Output is correct
54 Correct 170 ms 266744 KB Output is correct
55 Correct 163 ms 266744 KB Output is correct
56 Correct 180 ms 266872 KB Output is correct
57 Correct 164 ms 266744 KB Output is correct
58 Correct 168 ms 266744 KB Output is correct
59 Correct 170 ms 267000 KB Output is correct
60 Correct 171 ms 267000 KB Output is correct
61 Correct 171 ms 266488 KB Output is correct
62 Correct 186 ms 266540 KB Output is correct
63 Correct 179 ms 266488 KB Output is correct
64 Correct 290 ms 273148 KB Output is correct
65 Correct 254 ms 269432 KB Output is correct
66 Correct 233 ms 268408 KB Output is correct
67 Correct 202 ms 267768 KB Output is correct
68 Correct 281 ms 273144 KB Output is correct
69 Correct 253 ms 269432 KB Output is correct
70 Correct 233 ms 268664 KB Output is correct
71 Correct 227 ms 268280 KB Output is correct
72 Correct 290 ms 275960 KB Output is correct
73 Correct 277 ms 274552 KB Output is correct
74 Correct 275 ms 274296 KB Output is correct
75 Correct 276 ms 274040 KB Output is correct
76 Correct 291 ms 277588 KB Output is correct
77 Correct 292 ms 277752 KB Output is correct
78 Correct 288 ms 277624 KB Output is correct
79 Correct 286 ms 277752 KB Output is correct
80 Correct 296 ms 273152 KB Output is correct
81 Correct 249 ms 269432 KB Output is correct
82 Correct 233 ms 268540 KB Output is correct
83 Correct 207 ms 267768 KB Output is correct
84 Correct 305 ms 273276 KB Output is correct
85 Correct 253 ms 269432 KB Output is correct
86 Correct 231 ms 268536 KB Output is correct
87 Correct 228 ms 268368 KB Output is correct
88 Correct 283 ms 275832 KB Output is correct
89 Correct 280 ms 274552 KB Output is correct
90 Correct 272 ms 274168 KB Output is correct
91 Correct 281 ms 273912 KB Output is correct
92 Correct 292 ms 277628 KB Output is correct
93 Correct 294 ms 277624 KB Output is correct
94 Correct 296 ms 277752 KB Output is correct
95 Correct 298 ms 277624 KB Output is correct
96 Correct 214 ms 267768 KB Output is correct
97 Correct 207 ms 267848 KB Output is correct
98 Correct 199 ms 267768 KB Output is correct
99 Correct 207 ms 267768 KB Output is correct
100 Correct 226 ms 268280 KB Output is correct
101 Correct 216 ms 268152 KB Output is correct
102 Correct 226 ms 268280 KB Output is correct
103 Correct 204 ms 267896 KB Output is correct
104 Correct 269 ms 272760 KB Output is correct
105 Correct 245 ms 269304 KB Output is correct
106 Correct 232 ms 268280 KB Output is correct
107 Correct 203 ms 267900 KB Output is correct
108 Correct 270 ms 272248 KB Output is correct
109 Correct 246 ms 269048 KB Output is correct
110 Correct 263 ms 268408 KB Output is correct
111 Correct 218 ms 267896 KB Output is correct
112 Correct 252 ms 272632 KB Output is correct
113 Correct 261 ms 272760 KB Output is correct
114 Correct 252 ms 272632 KB Output is correct
115 Correct 258 ms 272636 KB Output is correct
116 Correct 253 ms 272632 KB Output is correct
117 Correct 262 ms 272760 KB Output is correct
118 Correct 253 ms 272632 KB Output is correct
119 Correct 261 ms 272632 KB Output is correct
120 Correct 252 ms 272632 KB Output is correct
121 Correct 262 ms 272632 KB Output is correct
122 Correct 312 ms 277752 KB Output is correct
123 Correct 274 ms 277596 KB Output is correct
124 Correct 265 ms 269560 KB Output is correct
125 Correct 267 ms 268792 KB Output is correct
126 Correct 247 ms 268536 KB Output is correct
127 Correct 268 ms 270456 KB Output is correct
128 Correct 270 ms 268792 KB Output is correct
129 Correct 242 ms 268408 KB Output is correct
130 Correct 271 ms 270840 KB Output is correct
131 Correct 247 ms 268664 KB Output is correct
132 Correct 241 ms 268536 KB Output is correct
133 Correct 787 ms 294392 KB Output is correct
134 Correct 630 ms 279032 KB Output is correct
135 Correct 512 ms 275192 KB Output is correct
136 Correct 367 ms 272504 KB Output is correct
137 Correct 762 ms 294312 KB Output is correct
138 Correct 664 ms 279164 KB Output is correct
139 Correct 555 ms 275320 KB Output is correct
140 Correct 451 ms 273868 KB Output is correct
141 Correct 829 ms 306036 KB Output is correct
142 Correct 790 ms 299892 KB Output is correct
143 Correct 760 ms 298488 KB Output is correct
144 Correct 771 ms 298360 KB Output is correct
145 Correct 834 ms 313216 KB Output is correct
146 Correct 843 ms 313212 KB Output is correct
147 Correct 853 ms 313332 KB Output is correct
148 Correct 847 ms 313236 KB Output is correct
149 Correct 772 ms 294416 KB Output is correct
150 Correct 631 ms 278920 KB Output is correct
151 Correct 506 ms 275064 KB Output is correct
152 Correct 377 ms 272504 KB Output is correct
153 Correct 767 ms 294392 KB Output is correct
154 Correct 653 ms 279160 KB Output is correct
155 Correct 516 ms 275064 KB Output is correct
156 Correct 448 ms 273784 KB Output is correct
157 Correct 819 ms 306164 KB Output is correct
158 Correct 773 ms 300024 KB Output is correct
159 Correct 760 ms 298616 KB Output is correct
160 Correct 770 ms 298436 KB Output is correct
161 Correct 820 ms 313208 KB Output is correct
162 Correct 835 ms 313076 KB Output is correct
163 Correct 826 ms 313080 KB Output is correct
164 Correct 856 ms 313076 KB Output is correct
165 Correct 324 ms 271992 KB Output is correct
166 Correct 318 ms 271916 KB Output is correct
167 Correct 327 ms 271952 KB Output is correct
168 Correct 323 ms 271992 KB Output is correct
169 Correct 461 ms 274040 KB Output is correct
170 Correct 416 ms 273528 KB Output is correct
171 Correct 407 ms 273272 KB Output is correct
172 Correct 352 ms 272376 KB Output is correct
173 Correct 745 ms 292868 KB Output is correct
174 Correct 607 ms 278520 KB Output is correct
175 Correct 493 ms 274680 KB Output is correct
176 Correct 358 ms 272248 KB Output is correct
177 Correct 720 ms 290592 KB Output is correct
178 Correct 611 ms 277880 KB Output is correct
179 Correct 518 ms 274424 KB Output is correct
180 Correct 399 ms 272248 KB Output is correct
181 Correct 561 ms 292444 KB Output is correct
182 Correct 623 ms 292344 KB Output is correct
183 Correct 530 ms 292340 KB Output is correct
184 Correct 630 ms 292444 KB Output is correct
185 Correct 544 ms 292324 KB Output is correct
186 Correct 622 ms 292340 KB Output is correct
187 Correct 546 ms 292368 KB Output is correct
188 Correct 619 ms 292340 KB Output is correct
189 Correct 551 ms 292340 KB Output is correct
190 Correct 617 ms 292468 KB Output is correct
191 Correct 800 ms 313076 KB Output is correct
192 Correct 628 ms 313076 KB Output is correct
193 Correct 2776 ms 452804 KB Output is correct
194 Correct 2255 ms 452460 KB Output is correct
195 Correct 5517 ms 638104 KB Output is correct
196 Correct 5540 ms 637284 KB Output is correct
197 Correct 6819 ms 724408 KB Output is correct
198 Execution timed out 7084 ms 724180 KB Time limit exceeded
199 Halted 0 ms 0 KB -