답안 #1041755

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1041755 2024-08-02T07:47:06 Z EaglesV7(#11051) Brought Down the Grading Server? (CEOI23_balance) C++17
100 / 100
542 ms 392964 KB
#include <bits/stdc++.h>
using namespace std;

vector<vector<int>> vec;
typedef pair<int,int> P;
vector<P> save;
int cnt[500005];
int c2[500005]; //assistant
int n,s,t;
stack<P> adj[500005];
bool used[500005];
int dir[500005];
vector<vector<int>> ret;

void solve(int s,int e,vector<vector<int>> v) {
    int l=v[0].size();
    if (l==1) {
        for(int i=0;i<n;i++) {
            ret[i][s]=v[i][0];
        }
        return;
    }
    vector<vector<int>> vl;
    vector<vector<int>> vr;
    vl.resize(n);
    vr.resize(n);
    for(int i=0;i<n;i++) {
        int ps=save.size();
        for(int j=0;j<l;j++) {
            cnt[v[i][j]]++;
        }
        for(int j=0;j<l;j++) {
            if (c2[v[i][j]]==0) {
                for(int m=0;m<cnt[v[i][j]]/2;m++) {
                    vl[i].push_back(v[i][j]);
                    vr[i].push_back(v[i][j]);
                }
                if (cnt[v[i][j]]%2==1) {
                    save.push_back(P(v[i][j],i));
                }
                c2[v[i][j]]=1;
            }
        }
        for(int j=0;j<l;j++) {
            cnt[v[i][j]]=0;
            c2[v[i][j]]=0;
        }
        for(int j=ps;j<save.size();j+=2) {
            adj[save[j].first].push(P(save[j+1].first,j));
            adj[save[j+1].first].push(P(save[j].first,j));
        }
    }
	int a=-1;
    int b=-1;
    for(int i=0;i<save.size();i+=2) {
        if (used[i]) {
            continue;
        }
        a=save[i].first;
        b=save[i+1].first;
        dir[i]=0; //���� ��
        used[i]=true;
        while(a!=-1&&!adj[a].empty()) {
            P nt=adj[a].top();
            adj[a].pop();
            if (used[nt.second]) {
                continue;
            }
            used[nt.second]=true;
            if (save[nt.second].first==nt.first) {
                dir[nt.second]=0;
            }
            else {
                dir[nt.second]=1;
            }
            if (b==nt.first) {
                a=-1;
                b=-1;
                break;
            }
            a=nt.first;
        }
        while(b!=-1&&!adj[b].empty()) {
            P nt=adj[b].top();
            adj[b].pop();
            if (used[nt.second]) {
                continue;
            }
            used[nt.second]=true;
            if (save[nt.second].first==nt.first) {
                dir[nt.second]=1;
            }
            else {
                dir[nt.second]=0;
            }
            b=nt.first;
        }
    }
    for(int i=0;i<save.size();i+=2) {
        if (dir[i]==0) {
            vl[save[i].second].push_back(save[i].first);
            vr[save[i].second].push_back(save[i+1].first);
        }
        else {
            vl[save[i].second].push_back(save[i+1].first);
            vr[save[i].second].push_back(save[i].first);
        }
    }
    for(int i=0;i<save.size();i++) {
        used[i]=false;
        dir[i]=0;
        while (!adj[save[i].first].empty()) {
            adj[save[i].first].pop();
        }
    }
    save.clear();
    int mid=(s+e)/2;
    solve(s,mid,vl);
    solve(mid+1,e,vr);
}

int main(void) {
    scanf("%d %d %d",&n,&s,&t);
    vec.resize(n);
    for(int i=0;i<n;i++) {
        vec[i].resize(s);
        for(int j=0;j<s;j++) {
            scanf("%d",&vec[i][j]);
        }
    }
    ret.resize(n);
    for(int i=0;i<n;i++) {
        ret[i].resize(s);
    }
    solve(0,s-1,vec);
    for(int i=0;i<n;i++) {
        for(int j=0;j<s;j++) {
            printf("%d ",ret[i][j]);
        }
        printf("\n");
    }
}

Compilation message

balance.cpp: In function 'void solve(int, int, std::vector<std::vector<int> >)':
balance.cpp:48: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]
   48 |         for(int j=ps;j<save.size();j+=2) {
      |                      ~^~~~~~~~~~~~
balance.cpp:55:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   55 |     for(int i=0;i<save.size();i+=2) {
      |                 ~^~~~~~~~~~~~
balance.cpp:99:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   99 |     for(int i=0;i<save.size();i+=2) {
      |                 ~^~~~~~~~~~~~
balance.cpp:109:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  109 |     for(int i=0;i<save.size();i++) {
      |                 ~^~~~~~~~~~~~
balance.cpp: In function 'int main()':
balance.cpp:123:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  123 |     scanf("%d %d %d",&n,&s,&t);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~
balance.cpp:128:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  128 |             scanf("%d",&vec[i][j]);
      |             ~~~~~^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 138 ms 340820 KB Correct
2 Correct 183 ms 340880 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 125 ms 340892 KB Correct
2 Correct 184 ms 340816 KB Correct
3 Correct 167 ms 340736 KB Correct
4 Correct 175 ms 340868 KB Correct
5 Correct 162 ms 340924 KB Correct
6 Correct 140 ms 340872 KB Correct
7 Correct 166 ms 340856 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 220 ms 376260 KB Correct
2 Correct 243 ms 375764 KB Correct
3 Correct 244 ms 372812 KB Correct
4 Correct 216 ms 375744 KB Correct
5 Correct 281 ms 376408 KB Correct
6 Correct 233 ms 376260 KB Correct
7 Correct 239 ms 376156 KB Correct
8 Correct 294 ms 376256 KB Correct
9 Correct 276 ms 376120 KB Correct
10 Correct 194 ms 376260 KB Correct
11 Correct 228 ms 376260 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 220 ms 376260 KB Correct
2 Correct 243 ms 375764 KB Correct
3 Correct 244 ms 372812 KB Correct
4 Correct 216 ms 375744 KB Correct
5 Correct 281 ms 376408 KB Correct
6 Correct 233 ms 376260 KB Correct
7 Correct 239 ms 376156 KB Correct
8 Correct 294 ms 376256 KB Correct
9 Correct 276 ms 376120 KB Correct
10 Correct 194 ms 376260 KB Correct
11 Correct 228 ms 376260 KB Correct
12 Correct 285 ms 376344 KB Correct
13 Correct 260 ms 375668 KB Correct
14 Correct 244 ms 372660 KB Correct
15 Correct 203 ms 375724 KB Correct
16 Correct 252 ms 376260 KB Correct
17 Correct 249 ms 376412 KB Correct
18 Correct 257 ms 376136 KB Correct
19 Correct 250 ms 376208 KB Correct
20 Correct 292 ms 376256 KB Correct
21 Correct 195 ms 376260 KB Correct
22 Correct 226 ms 376124 KB Correct
23 Correct 240 ms 376256 KB Correct
24 Correct 300 ms 376000 KB Correct
25 Correct 254 ms 376048 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 125 ms 340892 KB Correct
2 Correct 184 ms 340816 KB Correct
3 Correct 167 ms 340736 KB Correct
4 Correct 175 ms 340868 KB Correct
5 Correct 162 ms 340924 KB Correct
6 Correct 140 ms 340872 KB Correct
7 Correct 166 ms 340856 KB Correct
8 Correct 220 ms 376260 KB Correct
9 Correct 243 ms 375764 KB Correct
10 Correct 244 ms 372812 KB Correct
11 Correct 216 ms 375744 KB Correct
12 Correct 281 ms 376408 KB Correct
13 Correct 233 ms 376260 KB Correct
14 Correct 239 ms 376156 KB Correct
15 Correct 294 ms 376256 KB Correct
16 Correct 276 ms 376120 KB Correct
17 Correct 194 ms 376260 KB Correct
18 Correct 228 ms 376260 KB Correct
19 Correct 285 ms 376344 KB Correct
20 Correct 260 ms 375668 KB Correct
21 Correct 244 ms 372660 KB Correct
22 Correct 203 ms 375724 KB Correct
23 Correct 252 ms 376260 KB Correct
24 Correct 249 ms 376412 KB Correct
25 Correct 257 ms 376136 KB Correct
26 Correct 250 ms 376208 KB Correct
27 Correct 292 ms 376256 KB Correct
28 Correct 195 ms 376260 KB Correct
29 Correct 226 ms 376124 KB Correct
30 Correct 240 ms 376256 KB Correct
31 Correct 300 ms 376000 KB Correct
32 Correct 254 ms 376048 KB Correct
33 Correct 131 ms 340964 KB Correct
34 Correct 157 ms 340820 KB Correct
35 Correct 149 ms 341076 KB Correct
36 Correct 169 ms 340820 KB Correct
37 Correct 130 ms 340820 KB Correct
38 Correct 152 ms 340820 KB Correct
39 Correct 133 ms 340820 KB Correct
40 Correct 225 ms 376340 KB Correct
41 Correct 278 ms 375500 KB Correct
42 Correct 301 ms 372680 KB Correct
43 Correct 309 ms 375696 KB Correct
44 Correct 244 ms 376324 KB Correct
45 Correct 279 ms 376324 KB Correct
46 Correct 287 ms 376224 KB Correct
47 Correct 240 ms 376256 KB Correct
48 Correct 231 ms 376264 KB Correct
49 Correct 253 ms 376332 KB Correct
50 Correct 232 ms 376208 KB Correct
51 Correct 277 ms 376256 KB Correct
52 Correct 258 ms 376124 KB Correct
53 Correct 227 ms 375972 KB Correct
54 Correct 195 ms 358692 KB Correct
55 Correct 164 ms 341264 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 158 ms 340900 KB Correct
2 Correct 186 ms 341372 KB Correct
3 Correct 177 ms 341072 KB Correct
4 Correct 188 ms 342092 KB Correct
5 Correct 191 ms 342608 KB Correct
6 Correct 187 ms 342772 KB Correct
7 Correct 166 ms 342192 KB Correct
8 Correct 141 ms 341844 KB Correct
9 Correct 166 ms 342064 KB Correct
10 Correct 138 ms 342308 KB Correct
11 Correct 179 ms 342288 KB Correct
12 Correct 180 ms 342744 KB Correct
13 Correct 163 ms 342612 KB Correct
14 Correct 166 ms 342696 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 158 ms 340900 KB Correct
2 Correct 186 ms 341372 KB Correct
3 Correct 177 ms 341072 KB Correct
4 Correct 188 ms 342092 KB Correct
5 Correct 191 ms 342608 KB Correct
6 Correct 187 ms 342772 KB Correct
7 Correct 166 ms 342192 KB Correct
8 Correct 141 ms 341844 KB Correct
9 Correct 166 ms 342064 KB Correct
10 Correct 138 ms 342308 KB Correct
11 Correct 179 ms 342288 KB Correct
12 Correct 180 ms 342744 KB Correct
13 Correct 163 ms 342612 KB Correct
14 Correct 166 ms 342696 KB Correct
15 Correct 139 ms 340820 KB Correct
16 Correct 160 ms 341396 KB Correct
17 Correct 179 ms 341096 KB Correct
18 Correct 165 ms 342196 KB Correct
19 Correct 212 ms 342616 KB Correct
20 Correct 189 ms 342716 KB Correct
21 Correct 218 ms 342100 KB Correct
22 Correct 172 ms 341984 KB Correct
23 Correct 173 ms 341844 KB Correct
24 Correct 158 ms 342132 KB Correct
25 Correct 234 ms 342100 KB Correct
26 Correct 164 ms 342744 KB Correct
27 Correct 188 ms 342620 KB Correct
28 Correct 174 ms 342608 KB Correct
29 Correct 176 ms 341652 KB Correct
30 Correct 169 ms 342352 KB Correct
31 Correct 185 ms 341840 KB Correct
32 Correct 156 ms 342576 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 158 ms 340900 KB Correct
2 Correct 186 ms 341372 KB Correct
3 Correct 177 ms 341072 KB Correct
4 Correct 188 ms 342092 KB Correct
5 Correct 191 ms 342608 KB Correct
6 Correct 187 ms 342772 KB Correct
7 Correct 166 ms 342192 KB Correct
8 Correct 141 ms 341844 KB Correct
9 Correct 166 ms 342064 KB Correct
10 Correct 138 ms 342308 KB Correct
11 Correct 179 ms 342288 KB Correct
12 Correct 180 ms 342744 KB Correct
13 Correct 163 ms 342612 KB Correct
14 Correct 166 ms 342696 KB Correct
15 Correct 139 ms 340820 KB Correct
16 Correct 160 ms 341396 KB Correct
17 Correct 179 ms 341096 KB Correct
18 Correct 165 ms 342196 KB Correct
19 Correct 212 ms 342616 KB Correct
20 Correct 189 ms 342716 KB Correct
21 Correct 218 ms 342100 KB Correct
22 Correct 172 ms 341984 KB Correct
23 Correct 173 ms 341844 KB Correct
24 Correct 158 ms 342132 KB Correct
25 Correct 234 ms 342100 KB Correct
26 Correct 164 ms 342744 KB Correct
27 Correct 188 ms 342620 KB Correct
28 Correct 174 ms 342608 KB Correct
29 Correct 176 ms 341652 KB Correct
30 Correct 169 ms 342352 KB Correct
31 Correct 185 ms 341840 KB Correct
32 Correct 156 ms 342576 KB Correct
33 Correct 154 ms 340820 KB Correct
34 Correct 155 ms 341444 KB Correct
35 Correct 186 ms 341092 KB Correct
36 Correct 190 ms 342100 KB Correct
37 Correct 208 ms 342576 KB Correct
38 Correct 216 ms 342732 KB Correct
39 Correct 217 ms 342100 KB Correct
40 Correct 142 ms 341844 KB Correct
41 Correct 171 ms 341808 KB Correct
42 Correct 155 ms 342292 KB Correct
43 Correct 157 ms 342296 KB Correct
44 Correct 160 ms 342592 KB Correct
45 Correct 188 ms 342680 KB Correct
46 Correct 164 ms 342712 KB Correct
47 Correct 172 ms 341328 KB Correct
48 Correct 172 ms 342352 KB Correct
49 Correct 175 ms 342016 KB Correct
50 Correct 174 ms 342352 KB Correct
51 Correct 170 ms 340820 KB Correct
52 Correct 150 ms 340812 KB Correct
53 Correct 138 ms 340984 KB Correct
54 Correct 157 ms 340740 KB Correct
55 Correct 131 ms 340892 KB Correct
56 Correct 165 ms 340944 KB Correct
57 Correct 163 ms 340820 KB Correct
58 Correct 167 ms 341292 KB Correct
59 Correct 192 ms 341516 KB Correct
60 Correct 143 ms 341844 KB Correct
61 Correct 187 ms 341876 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 220 ms 376260 KB Correct
2 Correct 243 ms 375764 KB Correct
3 Correct 244 ms 372812 KB Correct
4 Correct 216 ms 375744 KB Correct
5 Correct 281 ms 376408 KB Correct
6 Correct 233 ms 376260 KB Correct
7 Correct 239 ms 376156 KB Correct
8 Correct 294 ms 376256 KB Correct
9 Correct 276 ms 376120 KB Correct
10 Correct 194 ms 376260 KB Correct
11 Correct 228 ms 376260 KB Correct
12 Correct 158 ms 340900 KB Correct
13 Correct 186 ms 341372 KB Correct
14 Correct 177 ms 341072 KB Correct
15 Correct 188 ms 342092 KB Correct
16 Correct 191 ms 342608 KB Correct
17 Correct 187 ms 342772 KB Correct
18 Correct 166 ms 342192 KB Correct
19 Correct 141 ms 341844 KB Correct
20 Correct 166 ms 342064 KB Correct
21 Correct 138 ms 342308 KB Correct
22 Correct 179 ms 342288 KB Correct
23 Correct 180 ms 342744 KB Correct
24 Correct 163 ms 342612 KB Correct
25 Correct 166 ms 342696 KB Correct
26 Correct 260 ms 376504 KB Correct
27 Correct 218 ms 375632 KB Correct
28 Correct 217 ms 372732 KB Correct
29 Correct 203 ms 375904 KB Correct
30 Correct 249 ms 376264 KB Correct
31 Correct 217 ms 376324 KB Correct
32 Correct 272 ms 376156 KB Correct
33 Correct 256 ms 376544 KB Correct
34 Correct 239 ms 376152 KB Correct
35 Correct 222 ms 376588 KB Correct
36 Correct 198 ms 376264 KB Correct
37 Correct 174 ms 340840 KB Correct
38 Correct 208 ms 341268 KB Correct
39 Correct 154 ms 341076 KB Correct
40 Correct 172 ms 342140 KB Correct
41 Correct 225 ms 342612 KB Correct
42 Correct 172 ms 342672 KB Correct
43 Correct 191 ms 342100 KB Correct
44 Correct 168 ms 341892 KB Correct
45 Correct 170 ms 341988 KB Correct
46 Correct 178 ms 342172 KB Correct
47 Correct 160 ms 342176 KB Correct
48 Correct 207 ms 342720 KB Correct
49 Correct 163 ms 342608 KB Correct
50 Correct 185 ms 342608 KB Correct
51 Correct 407 ms 390940 KB Correct
52 Correct 460 ms 356296 KB Correct
53 Correct 230 ms 343472 KB Correct
54 Correct 242 ms 351728 KB Correct
55 Correct 426 ms 354476 KB Correct
56 Correct 405 ms 387624 KB Correct
57 Correct 375 ms 390980 KB Correct
58 Correct 396 ms 354056 KB Correct
59 Correct 377 ms 351752 KB Correct
60 Correct 383 ms 385732 KB Correct
61 Correct 379 ms 387780 KB Correct
62 Correct 316 ms 392792 KB Correct
63 Correct 338 ms 392800 KB Correct
64 Correct 312 ms 392772 KB Correct
65 Correct 331 ms 392776 KB Correct
66 Correct 304 ms 392788 KB Correct
67 Correct 284 ms 392768 KB Correct
68 Correct 357 ms 392808 KB Correct
69 Correct 336 ms 392776 KB Correct
70 Correct 331 ms 386624 KB Correct
71 Correct 313 ms 386504 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 220 ms 376260 KB Correct
2 Correct 243 ms 375764 KB Correct
3 Correct 244 ms 372812 KB Correct
4 Correct 216 ms 375744 KB Correct
5 Correct 281 ms 376408 KB Correct
6 Correct 233 ms 376260 KB Correct
7 Correct 239 ms 376156 KB Correct
8 Correct 294 ms 376256 KB Correct
9 Correct 276 ms 376120 KB Correct
10 Correct 194 ms 376260 KB Correct
11 Correct 228 ms 376260 KB Correct
12 Correct 285 ms 376344 KB Correct
13 Correct 260 ms 375668 KB Correct
14 Correct 244 ms 372660 KB Correct
15 Correct 203 ms 375724 KB Correct
16 Correct 252 ms 376260 KB Correct
17 Correct 249 ms 376412 KB Correct
18 Correct 257 ms 376136 KB Correct
19 Correct 250 ms 376208 KB Correct
20 Correct 292 ms 376256 KB Correct
21 Correct 195 ms 376260 KB Correct
22 Correct 226 ms 376124 KB Correct
23 Correct 240 ms 376256 KB Correct
24 Correct 300 ms 376000 KB Correct
25 Correct 254 ms 376048 KB Correct
26 Correct 158 ms 340900 KB Correct
27 Correct 186 ms 341372 KB Correct
28 Correct 177 ms 341072 KB Correct
29 Correct 188 ms 342092 KB Correct
30 Correct 191 ms 342608 KB Correct
31 Correct 187 ms 342772 KB Correct
32 Correct 166 ms 342192 KB Correct
33 Correct 141 ms 341844 KB Correct
34 Correct 166 ms 342064 KB Correct
35 Correct 138 ms 342308 KB Correct
36 Correct 179 ms 342288 KB Correct
37 Correct 180 ms 342744 KB Correct
38 Correct 163 ms 342612 KB Correct
39 Correct 166 ms 342696 KB Correct
40 Correct 139 ms 340820 KB Correct
41 Correct 160 ms 341396 KB Correct
42 Correct 179 ms 341096 KB Correct
43 Correct 165 ms 342196 KB Correct
44 Correct 212 ms 342616 KB Correct
45 Correct 189 ms 342716 KB Correct
46 Correct 218 ms 342100 KB Correct
47 Correct 172 ms 341984 KB Correct
48 Correct 173 ms 341844 KB Correct
49 Correct 158 ms 342132 KB Correct
50 Correct 234 ms 342100 KB Correct
51 Correct 164 ms 342744 KB Correct
52 Correct 188 ms 342620 KB Correct
53 Correct 174 ms 342608 KB Correct
54 Correct 176 ms 341652 KB Correct
55 Correct 169 ms 342352 KB Correct
56 Correct 185 ms 341840 KB Correct
57 Correct 156 ms 342576 KB Correct
58 Correct 260 ms 376504 KB Correct
59 Correct 218 ms 375632 KB Correct
60 Correct 217 ms 372732 KB Correct
61 Correct 203 ms 375904 KB Correct
62 Correct 249 ms 376264 KB Correct
63 Correct 217 ms 376324 KB Correct
64 Correct 272 ms 376156 KB Correct
65 Correct 256 ms 376544 KB Correct
66 Correct 239 ms 376152 KB Correct
67 Correct 222 ms 376588 KB Correct
68 Correct 198 ms 376264 KB Correct
69 Correct 174 ms 340840 KB Correct
70 Correct 208 ms 341268 KB Correct
71 Correct 154 ms 341076 KB Correct
72 Correct 172 ms 342140 KB Correct
73 Correct 225 ms 342612 KB Correct
74 Correct 172 ms 342672 KB Correct
75 Correct 191 ms 342100 KB Correct
76 Correct 168 ms 341892 KB Correct
77 Correct 170 ms 341988 KB Correct
78 Correct 178 ms 342172 KB Correct
79 Correct 160 ms 342176 KB Correct
80 Correct 207 ms 342720 KB Correct
81 Correct 163 ms 342608 KB Correct
82 Correct 185 ms 342608 KB Correct
83 Correct 407 ms 390940 KB Correct
84 Correct 460 ms 356296 KB Correct
85 Correct 230 ms 343472 KB Correct
86 Correct 242 ms 351728 KB Correct
87 Correct 426 ms 354476 KB Correct
88 Correct 405 ms 387624 KB Correct
89 Correct 375 ms 390980 KB Correct
90 Correct 396 ms 354056 KB Correct
91 Correct 377 ms 351752 KB Correct
92 Correct 383 ms 385732 KB Correct
93 Correct 379 ms 387780 KB Correct
94 Correct 316 ms 392792 KB Correct
95 Correct 338 ms 392800 KB Correct
96 Correct 312 ms 392772 KB Correct
97 Correct 331 ms 392776 KB Correct
98 Correct 304 ms 392788 KB Correct
99 Correct 284 ms 392768 KB Correct
100 Correct 357 ms 392808 KB Correct
101 Correct 336 ms 392776 KB Correct
102 Correct 331 ms 386624 KB Correct
103 Correct 313 ms 386504 KB Correct
104 Correct 205 ms 376292 KB Correct
105 Correct 253 ms 375616 KB Correct
106 Correct 298 ms 372704 KB Correct
107 Correct 276 ms 375744 KB Correct
108 Correct 228 ms 376312 KB Correct
109 Correct 223 ms 376392 KB Correct
110 Correct 247 ms 376156 KB Correct
111 Correct 223 ms 376400 KB Correct
112 Correct 242 ms 376232 KB Correct
113 Correct 217 ms 376380 KB Correct
114 Correct 222 ms 376184 KB Correct
115 Correct 151 ms 340764 KB Correct
116 Correct 181 ms 341212 KB Correct
117 Correct 165 ms 341080 KB Correct
118 Correct 171 ms 342172 KB Correct
119 Correct 201 ms 342612 KB Correct
120 Correct 164 ms 342744 KB Correct
121 Correct 168 ms 342188 KB Correct
122 Correct 130 ms 341840 KB Correct
123 Correct 174 ms 342040 KB Correct
124 Correct 155 ms 342356 KB Correct
125 Correct 200 ms 342080 KB Correct
126 Correct 174 ms 342608 KB Correct
127 Correct 174 ms 342616 KB Correct
128 Correct 164 ms 342612 KB Correct
129 Correct 400 ms 390852 KB Correct
130 Correct 453 ms 356264 KB Correct
131 Correct 208 ms 343380 KB Correct
132 Correct 270 ms 351716 KB Correct
133 Correct 433 ms 354476 KB Correct
134 Correct 388 ms 388136 KB Correct
135 Correct 453 ms 390940 KB Correct
136 Correct 379 ms 354132 KB Correct
137 Correct 353 ms 351872 KB Correct
138 Correct 385 ms 384432 KB Correct
139 Correct 414 ms 387764 KB Correct
140 Correct 350 ms 392748 KB Correct
141 Correct 357 ms 392812 KB Correct
142 Correct 275 ms 392812 KB Correct
143 Correct 357 ms 392784 KB Correct
144 Correct 268 ms 392804 KB Correct
145 Correct 295 ms 392856 KB Correct
146 Correct 297 ms 392844 KB Correct
147 Correct 319 ms 392920 KB Correct
148 Correct 345 ms 386636 KB Correct
149 Correct 420 ms 386572 KB Correct
150 Correct 295 ms 376252 KB Correct
151 Correct 220 ms 376124 KB Correct
152 Correct 297 ms 376000 KB Correct
153 Correct 154 ms 341280 KB Correct
154 Correct 131 ms 342352 KB Correct
155 Correct 143 ms 341844 KB Correct
156 Correct 219 ms 342300 KB Correct
157 Correct 459 ms 391092 KB Correct
158 Correct 463 ms 356808 KB Correct
159 Correct 245 ms 347104 KB Correct
160 Correct 446 ms 391008 KB Correct
161 Correct 409 ms 390928 KB Correct
162 Correct 328 ms 354244 KB Correct
163 Correct 438 ms 391084 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 138 ms 340820 KB Correct
2 Correct 183 ms 340880 KB Correct
3 Correct 125 ms 340892 KB Correct
4 Correct 184 ms 340816 KB Correct
5 Correct 167 ms 340736 KB Correct
6 Correct 175 ms 340868 KB Correct
7 Correct 162 ms 340924 KB Correct
8 Correct 140 ms 340872 KB Correct
9 Correct 166 ms 340856 KB Correct
10 Correct 220 ms 376260 KB Correct
11 Correct 243 ms 375764 KB Correct
12 Correct 244 ms 372812 KB Correct
13 Correct 216 ms 375744 KB Correct
14 Correct 281 ms 376408 KB Correct
15 Correct 233 ms 376260 KB Correct
16 Correct 239 ms 376156 KB Correct
17 Correct 294 ms 376256 KB Correct
18 Correct 276 ms 376120 KB Correct
19 Correct 194 ms 376260 KB Correct
20 Correct 228 ms 376260 KB Correct
21 Correct 285 ms 376344 KB Correct
22 Correct 260 ms 375668 KB Correct
23 Correct 244 ms 372660 KB Correct
24 Correct 203 ms 375724 KB Correct
25 Correct 252 ms 376260 KB Correct
26 Correct 249 ms 376412 KB Correct
27 Correct 257 ms 376136 KB Correct
28 Correct 250 ms 376208 KB Correct
29 Correct 292 ms 376256 KB Correct
30 Correct 195 ms 376260 KB Correct
31 Correct 226 ms 376124 KB Correct
32 Correct 240 ms 376256 KB Correct
33 Correct 300 ms 376000 KB Correct
34 Correct 254 ms 376048 KB Correct
35 Correct 131 ms 340964 KB Correct
36 Correct 157 ms 340820 KB Correct
37 Correct 149 ms 341076 KB Correct
38 Correct 169 ms 340820 KB Correct
39 Correct 130 ms 340820 KB Correct
40 Correct 152 ms 340820 KB Correct
41 Correct 133 ms 340820 KB Correct
42 Correct 225 ms 376340 KB Correct
43 Correct 278 ms 375500 KB Correct
44 Correct 301 ms 372680 KB Correct
45 Correct 309 ms 375696 KB Correct
46 Correct 244 ms 376324 KB Correct
47 Correct 279 ms 376324 KB Correct
48 Correct 287 ms 376224 KB Correct
49 Correct 240 ms 376256 KB Correct
50 Correct 231 ms 376264 KB Correct
51 Correct 253 ms 376332 KB Correct
52 Correct 232 ms 376208 KB Correct
53 Correct 277 ms 376256 KB Correct
54 Correct 258 ms 376124 KB Correct
55 Correct 227 ms 375972 KB Correct
56 Correct 195 ms 358692 KB Correct
57 Correct 164 ms 341264 KB Correct
58 Correct 158 ms 340900 KB Correct
59 Correct 186 ms 341372 KB Correct
60 Correct 177 ms 341072 KB Correct
61 Correct 188 ms 342092 KB Correct
62 Correct 191 ms 342608 KB Correct
63 Correct 187 ms 342772 KB Correct
64 Correct 166 ms 342192 KB Correct
65 Correct 141 ms 341844 KB Correct
66 Correct 166 ms 342064 KB Correct
67 Correct 138 ms 342308 KB Correct
68 Correct 179 ms 342288 KB Correct
69 Correct 180 ms 342744 KB Correct
70 Correct 163 ms 342612 KB Correct
71 Correct 166 ms 342696 KB Correct
72 Correct 139 ms 340820 KB Correct
73 Correct 160 ms 341396 KB Correct
74 Correct 179 ms 341096 KB Correct
75 Correct 165 ms 342196 KB Correct
76 Correct 212 ms 342616 KB Correct
77 Correct 189 ms 342716 KB Correct
78 Correct 218 ms 342100 KB Correct
79 Correct 172 ms 341984 KB Correct
80 Correct 173 ms 341844 KB Correct
81 Correct 158 ms 342132 KB Correct
82 Correct 234 ms 342100 KB Correct
83 Correct 164 ms 342744 KB Correct
84 Correct 188 ms 342620 KB Correct
85 Correct 174 ms 342608 KB Correct
86 Correct 176 ms 341652 KB Correct
87 Correct 169 ms 342352 KB Correct
88 Correct 185 ms 341840 KB Correct
89 Correct 156 ms 342576 KB Correct
90 Correct 154 ms 340820 KB Correct
91 Correct 155 ms 341444 KB Correct
92 Correct 186 ms 341092 KB Correct
93 Correct 190 ms 342100 KB Correct
94 Correct 208 ms 342576 KB Correct
95 Correct 216 ms 342732 KB Correct
96 Correct 217 ms 342100 KB Correct
97 Correct 142 ms 341844 KB Correct
98 Correct 171 ms 341808 KB Correct
99 Correct 155 ms 342292 KB Correct
100 Correct 157 ms 342296 KB Correct
101 Correct 160 ms 342592 KB Correct
102 Correct 188 ms 342680 KB Correct
103 Correct 164 ms 342712 KB Correct
104 Correct 172 ms 341328 KB Correct
105 Correct 172 ms 342352 KB Correct
106 Correct 175 ms 342016 KB Correct
107 Correct 174 ms 342352 KB Correct
108 Correct 170 ms 340820 KB Correct
109 Correct 150 ms 340812 KB Correct
110 Correct 138 ms 340984 KB Correct
111 Correct 157 ms 340740 KB Correct
112 Correct 131 ms 340892 KB Correct
113 Correct 165 ms 340944 KB Correct
114 Correct 163 ms 340820 KB Correct
115 Correct 167 ms 341292 KB Correct
116 Correct 192 ms 341516 KB Correct
117 Correct 143 ms 341844 KB Correct
118 Correct 187 ms 341876 KB Correct
119 Correct 260 ms 376504 KB Correct
120 Correct 218 ms 375632 KB Correct
121 Correct 217 ms 372732 KB Correct
122 Correct 203 ms 375904 KB Correct
123 Correct 249 ms 376264 KB Correct
124 Correct 217 ms 376324 KB Correct
125 Correct 272 ms 376156 KB Correct
126 Correct 256 ms 376544 KB Correct
127 Correct 239 ms 376152 KB Correct
128 Correct 222 ms 376588 KB Correct
129 Correct 198 ms 376264 KB Correct
130 Correct 174 ms 340840 KB Correct
131 Correct 208 ms 341268 KB Correct
132 Correct 154 ms 341076 KB Correct
133 Correct 172 ms 342140 KB Correct
134 Correct 225 ms 342612 KB Correct
135 Correct 172 ms 342672 KB Correct
136 Correct 191 ms 342100 KB Correct
137 Correct 168 ms 341892 KB Correct
138 Correct 170 ms 341988 KB Correct
139 Correct 178 ms 342172 KB Correct
140 Correct 160 ms 342176 KB Correct
141 Correct 207 ms 342720 KB Correct
142 Correct 163 ms 342608 KB Correct
143 Correct 185 ms 342608 KB Correct
144 Correct 407 ms 390940 KB Correct
145 Correct 460 ms 356296 KB Correct
146 Correct 230 ms 343472 KB Correct
147 Correct 242 ms 351728 KB Correct
148 Correct 426 ms 354476 KB Correct
149 Correct 405 ms 387624 KB Correct
150 Correct 375 ms 390980 KB Correct
151 Correct 396 ms 354056 KB Correct
152 Correct 377 ms 351752 KB Correct
153 Correct 383 ms 385732 KB Correct
154 Correct 379 ms 387780 KB Correct
155 Correct 316 ms 392792 KB Correct
156 Correct 338 ms 392800 KB Correct
157 Correct 312 ms 392772 KB Correct
158 Correct 331 ms 392776 KB Correct
159 Correct 304 ms 392788 KB Correct
160 Correct 284 ms 392768 KB Correct
161 Correct 357 ms 392808 KB Correct
162 Correct 336 ms 392776 KB Correct
163 Correct 331 ms 386624 KB Correct
164 Correct 313 ms 386504 KB Correct
165 Correct 205 ms 376292 KB Correct
166 Correct 253 ms 375616 KB Correct
167 Correct 298 ms 372704 KB Correct
168 Correct 276 ms 375744 KB Correct
169 Correct 228 ms 376312 KB Correct
170 Correct 223 ms 376392 KB Correct
171 Correct 247 ms 376156 KB Correct
172 Correct 223 ms 376400 KB Correct
173 Correct 242 ms 376232 KB Correct
174 Correct 217 ms 376380 KB Correct
175 Correct 222 ms 376184 KB Correct
176 Correct 151 ms 340764 KB Correct
177 Correct 181 ms 341212 KB Correct
178 Correct 165 ms 341080 KB Correct
179 Correct 171 ms 342172 KB Correct
180 Correct 201 ms 342612 KB Correct
181 Correct 164 ms 342744 KB Correct
182 Correct 168 ms 342188 KB Correct
183 Correct 130 ms 341840 KB Correct
184 Correct 174 ms 342040 KB Correct
185 Correct 155 ms 342356 KB Correct
186 Correct 200 ms 342080 KB Correct
187 Correct 174 ms 342608 KB Correct
188 Correct 174 ms 342616 KB Correct
189 Correct 164 ms 342612 KB Correct
190 Correct 400 ms 390852 KB Correct
191 Correct 453 ms 356264 KB Correct
192 Correct 208 ms 343380 KB Correct
193 Correct 270 ms 351716 KB Correct
194 Correct 433 ms 354476 KB Correct
195 Correct 388 ms 388136 KB Correct
196 Correct 453 ms 390940 KB Correct
197 Correct 379 ms 354132 KB Correct
198 Correct 353 ms 351872 KB Correct
199 Correct 385 ms 384432 KB Correct
200 Correct 414 ms 387764 KB Correct
201 Correct 350 ms 392748 KB Correct
202 Correct 357 ms 392812 KB Correct
203 Correct 275 ms 392812 KB Correct
204 Correct 357 ms 392784 KB Correct
205 Correct 268 ms 392804 KB Correct
206 Correct 295 ms 392856 KB Correct
207 Correct 297 ms 392844 KB Correct
208 Correct 319 ms 392920 KB Correct
209 Correct 345 ms 386636 KB Correct
210 Correct 420 ms 386572 KB Correct
211 Correct 295 ms 376252 KB Correct
212 Correct 220 ms 376124 KB Correct
213 Correct 297 ms 376000 KB Correct
214 Correct 154 ms 341280 KB Correct
215 Correct 131 ms 342352 KB Correct
216 Correct 143 ms 341844 KB Correct
217 Correct 219 ms 342300 KB Correct
218 Correct 459 ms 391092 KB Correct
219 Correct 463 ms 356808 KB Correct
220 Correct 245 ms 347104 KB Correct
221 Correct 446 ms 391008 KB Correct
222 Correct 409 ms 390928 KB Correct
223 Correct 328 ms 354244 KB Correct
224 Correct 438 ms 391084 KB Correct
225 Correct 225 ms 376260 KB Correct
226 Correct 240 ms 375724 KB Correct
227 Correct 241 ms 372804 KB Correct
228 Correct 278 ms 375748 KB Correct
229 Correct 294 ms 376280 KB Correct
230 Correct 295 ms 376260 KB Correct
231 Correct 262 ms 376236 KB Correct
232 Correct 248 ms 376256 KB Correct
233 Correct 253 ms 376248 KB Correct
234 Correct 216 ms 376328 KB Correct
235 Correct 200 ms 376264 KB Correct
236 Correct 150 ms 340816 KB Correct
237 Correct 154 ms 341328 KB Correct
238 Correct 200 ms 341332 KB Correct
239 Correct 195 ms 342096 KB Correct
240 Correct 207 ms 342628 KB Correct
241 Correct 155 ms 342720 KB Correct
242 Correct 164 ms 342332 KB Correct
243 Correct 137 ms 341844 KB Correct
244 Correct 138 ms 341844 KB Correct
245 Correct 190 ms 342496 KB Correct
246 Correct 179 ms 342100 KB Correct
247 Correct 158 ms 342736 KB Correct
248 Correct 164 ms 342612 KB Correct
249 Correct 146 ms 342716 KB Correct
250 Correct 415 ms 391064 KB Correct
251 Correct 433 ms 356292 KB Correct
252 Correct 217 ms 343388 KB Correct
253 Correct 249 ms 351716 KB Correct
254 Correct 426 ms 354528 KB Correct
255 Correct 445 ms 388532 KB Correct
256 Correct 478 ms 390912 KB Correct
257 Correct 516 ms 354056 KB Correct
258 Correct 340 ms 351648 KB Correct
259 Correct 401 ms 385600 KB Correct
260 Correct 492 ms 387948 KB Correct
261 Correct 341 ms 392856 KB Correct
262 Correct 382 ms 392772 KB Correct
263 Correct 401 ms 392856 KB Correct
264 Correct 331 ms 392964 KB Correct
265 Correct 332 ms 392756 KB Correct
266 Correct 317 ms 392856 KB Correct
267 Correct 291 ms 392776 KB Correct
268 Correct 311 ms 392772 KB Correct
269 Correct 320 ms 386572 KB Correct
270 Correct 375 ms 386640 KB Correct
271 Correct 222 ms 376384 KB Correct
272 Correct 227 ms 376060 KB Correct
273 Correct 278 ms 376004 KB Correct
274 Correct 155 ms 341332 KB Correct
275 Correct 166 ms 342356 KB Correct
276 Correct 150 ms 341840 KB Correct
277 Correct 158 ms 342188 KB Correct
278 Correct 487 ms 391084 KB Correct
279 Correct 506 ms 356804 KB Correct
280 Correct 215 ms 347104 KB Correct
281 Correct 500 ms 391032 KB Correct
282 Correct 429 ms 391104 KB Correct
283 Correct 395 ms 354272 KB Correct
284 Correct 419 ms 391024 KB Correct
285 Correct 138 ms 340904 KB Correct
286 Correct 133 ms 340856 KB Correct
287 Correct 186 ms 341116 KB Correct
288 Correct 155 ms 340820 KB Correct
289 Correct 179 ms 340816 KB Correct
290 Correct 152 ms 340820 KB Correct
291 Correct 134 ms 340820 KB Correct
292 Correct 233 ms 358644 KB Correct
293 Correct 181 ms 341328 KB Correct
294 Correct 167 ms 341460 KB Correct
295 Correct 220 ms 341104 KB Correct
296 Correct 141 ms 341888 KB Correct
297 Correct 163 ms 341984 KB Correct
298 Correct 490 ms 391048 KB Correct
299 Correct 542 ms 360588 KB Correct
300 Correct 393 ms 354640 KB Correct
301 Correct 343 ms 354052 KB Correct
302 Correct 350 ms 354376 KB Correct
303 Correct 460 ms 390964 KB Correct
304 Correct 437 ms 391108 KB Correct
305 Correct 455 ms 391164 KB Correct
306 Correct 450 ms 379304 KB Correct
307 Correct 503 ms 388164 KB Correct