# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
335569 | 2020-12-13T07:02:33 Z | inwbear | 기지국 (IOI20_stations) | C++14 | 1134 ms | 1292 KB |
#include "stations.h" #include<bits/stdc++.h> using namespace std; #define pb push_back #define all(x) (x).begin(),(x).end() #define MEM(x,a) memset((x),a,sizeof((x))) #define F first #define S second #define imx INT_MAX const long long MMX = (long long)(1e18); typedef long long LL; typedef pair<int,int> pii; int nn,co[1005]; bitset<1005>go; vector<int>v[1005]; void dfs(int N,int h) { go[N]=true; if(h%2==0) { co[N]=nn; nn++; } for(int i=0;i<v[N].size();i++) { if(!go[v[N][i]]) { dfs(v[N][i],h+1); } } if(h%2==1) { co[N]=nn; nn++; } return; } vector<int>label(int n,int k,vector<int>a,vector<int>b) { vector<int>labels(n); nn=0; for(int i=0;i<1005;i++)v[i].clear(),go[i]=false; for(int i=0;i<a.size();i++) { v[a[i]].pb(b[i]); v[b[i]].pb(a[i]); } dfs(0,0); for(int i=0;i<n;i++)labels[i]=co[i]; return labels; } int find_next_station(int s,int t,vector<int>c) { int st,ed,rech,repr,mxpr=0,mnch=imx; bool ch=false; for(int i=0;i<c.size();i++) { st=s,ed=c[i]; if(ed<st)swap(st,ed); if(st<=t&&ed>=t) { if(mnch>ed-st) { ch=true; mnch=ed-st; rech=c[i]; } } else { if(mxpr<ed-st) { mxpr=ed-st; repr=c[i]; } } } if(ch)return rech; else return repr; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 649 ms | 1092 KB | Output is correct |
2 | Correct | 531 ms | 1036 KB | Output is correct |
3 | Correct | 1039 ms | 864 KB | Output is correct |
4 | Correct | 786 ms | 948 KB | Output is correct |
5 | Correct | 762 ms | 948 KB | Output is correct |
6 | Correct | 548 ms | 1096 KB | Output is correct |
7 | Correct | 591 ms | 1116 KB | Output is correct |
8 | Correct | 3 ms | 864 KB | Output is correct |
9 | Correct | 6 ms | 956 KB | Output is correct |
10 | Correct | 2 ms | 864 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 476 ms | 736 KB | Output is correct |
2 | Correct | 718 ms | 716 KB | Output is correct |
3 | Correct | 912 ms | 948 KB | Output is correct |
4 | Correct | 656 ms | 864 KB | Output is correct |
5 | Correct | 710 ms | 864 KB | Output is correct |
6 | Correct | 495 ms | 864 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 600 ms | 1096 KB | Output is correct |
2 | Correct | 482 ms | 1088 KB | Output is correct |
3 | Correct | 884 ms | 968 KB | Output is correct |
4 | Correct | 686 ms | 712 KB | Output is correct |
5 | Correct | 575 ms | 1108 KB | Output is correct |
6 | Correct | 572 ms | 1292 KB | Output is correct |
7 | Correct | 554 ms | 1112 KB | Output is correct |
8 | Correct | 2 ms | 996 KB | Output is correct |
9 | Correct | 4 ms | 736 KB | Output is correct |
10 | Correct | 2 ms | 736 KB | Output is correct |
11 | Correct | 679 ms | 736 KB | Output is correct |
12 | Correct | 593 ms | 1088 KB | Output is correct |
13 | Correct | 643 ms | 992 KB | Output is correct |
14 | Correct | 511 ms | 864 KB | Output is correct |
15 | Correct | 64 ms | 784 KB | Output is correct |
16 | Correct | 81 ms | 916 KB | Output is correct |
17 | Correct | 98 ms | 864 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1134 ms | 736 KB | Output is correct |
2 | Correct | 658 ms | 956 KB | Output is correct |
3 | Correct | 597 ms | 948 KB | Output is correct |
4 | Correct | 3 ms | 956 KB | Output is correct |
5 | Correct | 4 ms | 864 KB | Output is correct |
6 | Correct | 2 ms | 736 KB | Output is correct |
7 | Correct | 609 ms | 1076 KB | Output is correct |
8 | Correct | 933 ms | 1076 KB | Output is correct |
9 | Correct | 693 ms | 864 KB | Output is correct |
10 | Correct | 652 ms | 736 KB | Output is correct |
11 | Correct | 6 ms | 956 KB | Output is correct |
12 | Correct | 6 ms | 736 KB | Output is correct |
13 | Correct | 5 ms | 864 KB | Output is correct |
14 | Correct | 4 ms | 736 KB | Output is correct |
15 | Correct | 2 ms | 948 KB | Output is correct |
16 | Correct | 562 ms | 992 KB | Output is correct |
17 | Correct | 512 ms | 948 KB | Output is correct |
18 | Correct | 504 ms | 948 KB | Output is correct |
19 | Correct | 515 ms | 908 KB | Output is correct |
20 | Correct | 495 ms | 864 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 542 ms | 1124 KB | Output is correct |
2 | Correct | 475 ms | 996 KB | Output is correct |
3 | Correct | 858 ms | 948 KB | Output is correct |
4 | Correct | 669 ms | 864 KB | Output is correct |
5 | Correct | 622 ms | 736 KB | Output is correct |
6 | Correct | 462 ms | 864 KB | Output is correct |
7 | Correct | 536 ms | 872 KB | Output is correct |
8 | Correct | 3 ms | 948 KB | Output is correct |
9 | Correct | 3 ms | 736 KB | Output is correct |
10 | Correct | 2 ms | 736 KB | Output is correct |
11 | Correct | 542 ms | 884 KB | Output is correct |
12 | Correct | 521 ms | 736 KB | Output is correct |
13 | Correct | 996 ms | 864 KB | Output is correct |
14 | Correct | 694 ms | 948 KB | Output is correct |
15 | Correct | 631 ms | 948 KB | Output is correct |
16 | Correct | 449 ms | 900 KB | Output is correct |
17 | Correct | 648 ms | 864 KB | Output is correct |
18 | Correct | 558 ms | 992 KB | Output is correct |
19 | Correct | 526 ms | 1228 KB | Output is correct |
20 | Correct | 438 ms | 900 KB | Output is correct |
21 | Correct | 71 ms | 912 KB | Output is correct |
22 | Correct | 86 ms | 736 KB | Output is correct |
23 | Correct | 108 ms | 892 KB | Output is correct |
24 | Correct | 6 ms | 736 KB | Output is correct |
25 | Correct | 5 ms | 736 KB | Output is correct |
26 | Correct | 5 ms | 736 KB | Output is correct |
27 | Correct | 4 ms | 864 KB | Output is correct |
28 | Correct | 2 ms | 736 KB | Output is correct |
29 | Correct | 487 ms | 956 KB | Output is correct |
30 | Correct | 551 ms | 1236 KB | Output is correct |
31 | Correct | 627 ms | 864 KB | Output is correct |
32 | Correct | 572 ms | 948 KB | Output is correct |
33 | Correct | 493 ms | 736 KB | Output is correct |
34 | Correct | 321 ms | 864 KB | Output is correct |
35 | Correct | 415 ms | 1080 KB | Output is correct |
36 | Correct | 433 ms | 1232 KB | Output is correct |
37 | Correct | 545 ms | 1008 KB | Output is correct |
38 | Correct | 491 ms | 1128 KB | Output is correct |
39 | Correct | 530 ms | 1228 KB | Output is correct |
40 | Correct | 534 ms | 1100 KB | Output is correct |
41 | Correct | 443 ms | 1120 KB | Output is correct |
42 | Correct | 69 ms | 904 KB | Output is correct |
43 | Correct | 106 ms | 884 KB | Output is correct |
44 | Correct | 141 ms | 864 KB | Output is correct |
45 | Correct | 157 ms | 872 KB | Output is correct |
46 | Correct | 421 ms | 896 KB | Output is correct |
47 | Correct | 391 ms | 868 KB | Output is correct |
48 | Correct | 64 ms | 992 KB | Output is correct |
49 | Correct | 59 ms | 1088 KB | Output is correct |