# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
260845 |
2020-08-11T05:35:34 Z |
문홍윤(#5067) |
길고양이 (JOI20_stray) |
C++17 |
|
70 ms |
17136 KB |
#include "Anthony.h"
#include <bits/stdc++.h>
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
using namespace std;
typedef pair<int, int> pii;
static const int INF=1e9;
static int n, m, col[20010];
static vector<pii> link[20010];
static int que[20010], fr, re, d[20010];
static void col_typeA(){
que[++re]=0;
d[0]=1;
for(fr=1; fr<=re; fr++){
for(auto i:link[que[fr]]){
if(d[i.F])continue;
d[i.F]=d[que[fr]]+1;
que[++re]=i.F;
}
}
for(int i=0; i<n; i++){
for(auto j:link[i]){
int tmp=min(d[i], d[j.F]);
col[j.S]=tmp%3+1;
}
}
}
static int rpt[6]={0, 0, 1, 1, 0, 1};
static void dfs(int num, int par, int dist){
for(auto i:link[num]){
if(i.F==par)continue;
col[i.S]=rpt[dist%6];
dfs(i.F, num, dist+1);
}
}
static void col_typeB(){dfs(0, -1, 0);}
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V){
n=N, m=M;
vector<int> ret(m);
for(int i=0; i<m; i++){
link[U[i]].eb(V[i], i);
link[V[i]].eb(U[i], i);
}
if(A>=3)col_typeA();
else col_typeB();
for(int i=0; i<m; i++)ret[i]=col[i]-1;
return ret;
}
#include "Catherine.h"
#include <bits/stdc++.h>
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
using namespace std;
typedef pair<int, int> pii;
static int typ;
void Init(int A, int B){
if(A>=3)typ=1;
else typ=2;
}
static int move_typeA(vector<int> vc){
for(int i=0; i<3; i++)if(vc[i]&&!vc[(i+2)%3])return i;
}
static int move_typeB(vector<int> vc){
return 0;
}
int Move(vector<int> y){
if(typ==1)return move_typeA(y);
return move_typeB(y);
}
Compilation message
Catherine.cpp: In function 'int move_typeA(std::vector<int>)':
Catherine.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
66 ms |
15936 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
41 ms |
14968 KB |
Output is correct |
4 |
Correct |
62 ms |
17136 KB |
Output is correct |
5 |
Correct |
62 ms |
16976 KB |
Output is correct |
6 |
Correct |
51 ms |
15644 KB |
Output is correct |
7 |
Correct |
52 ms |
15556 KB |
Output is correct |
8 |
Correct |
58 ms |
16320 KB |
Output is correct |
9 |
Correct |
65 ms |
16360 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
66 ms |
15936 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
41 ms |
14968 KB |
Output is correct |
4 |
Correct |
62 ms |
17136 KB |
Output is correct |
5 |
Correct |
62 ms |
16976 KB |
Output is correct |
6 |
Correct |
51 ms |
15644 KB |
Output is correct |
7 |
Correct |
52 ms |
15556 KB |
Output is correct |
8 |
Correct |
58 ms |
16320 KB |
Output is correct |
9 |
Correct |
65 ms |
16360 KB |
Output is correct |
10 |
Correct |
49 ms |
13704 KB |
Output is correct |
11 |
Correct |
52 ms |
13680 KB |
Output is correct |
12 |
Correct |
45 ms |
13728 KB |
Output is correct |
13 |
Correct |
44 ms |
13728 KB |
Output is correct |
14 |
Correct |
63 ms |
13808 KB |
Output is correct |
15 |
Correct |
56 ms |
14380 KB |
Output is correct |
16 |
Correct |
70 ms |
16628 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
53 ms |
13552 KB |
Output is correct |
2 |
Correct |
2 ms |
1536 KB |
Output is correct |
3 |
Correct |
39 ms |
12796 KB |
Output is correct |
4 |
Correct |
62 ms |
14824 KB |
Output is correct |
5 |
Correct |
59 ms |
14680 KB |
Output is correct |
6 |
Correct |
45 ms |
13408 KB |
Output is correct |
7 |
Correct |
47 ms |
13668 KB |
Output is correct |
8 |
Correct |
55 ms |
14024 KB |
Output is correct |
9 |
Correct |
58 ms |
14060 KB |
Output is correct |
10 |
Correct |
52 ms |
13692 KB |
Output is correct |
11 |
Correct |
51 ms |
13840 KB |
Output is correct |
12 |
Correct |
51 ms |
13836 KB |
Output is correct |
13 |
Correct |
50 ms |
13692 KB |
Output is correct |
14 |
Correct |
57 ms |
14096 KB |
Output is correct |
15 |
Correct |
56 ms |
14068 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
53 ms |
13552 KB |
Output is correct |
2 |
Correct |
2 ms |
1536 KB |
Output is correct |
3 |
Correct |
39 ms |
12796 KB |
Output is correct |
4 |
Correct |
62 ms |
14824 KB |
Output is correct |
5 |
Correct |
59 ms |
14680 KB |
Output is correct |
6 |
Correct |
45 ms |
13408 KB |
Output is correct |
7 |
Correct |
47 ms |
13668 KB |
Output is correct |
8 |
Correct |
55 ms |
14024 KB |
Output is correct |
9 |
Correct |
58 ms |
14060 KB |
Output is correct |
10 |
Correct |
52 ms |
13692 KB |
Output is correct |
11 |
Correct |
51 ms |
13840 KB |
Output is correct |
12 |
Correct |
51 ms |
13836 KB |
Output is correct |
13 |
Correct |
50 ms |
13692 KB |
Output is correct |
14 |
Correct |
57 ms |
14096 KB |
Output is correct |
15 |
Correct |
56 ms |
14068 KB |
Output is correct |
16 |
Correct |
40 ms |
11632 KB |
Output is correct |
17 |
Correct |
40 ms |
11900 KB |
Output is correct |
18 |
Correct |
45 ms |
12072 KB |
Output is correct |
19 |
Correct |
45 ms |
11812 KB |
Output is correct |
20 |
Correct |
51 ms |
12272 KB |
Output is correct |
21 |
Correct |
45 ms |
12192 KB |
Output is correct |
22 |
Correct |
54 ms |
14284 KB |
Output is correct |
23 |
Correct |
44 ms |
11944 KB |
Output is correct |
24 |
Correct |
44 ms |
11888 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1792 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
10 ms |
4096 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
10 ms |
4096 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |