# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
260839 |
2020-08-11T05:14:57 Z |
문홍윤(#5067) |
Stray Cat (JOI20_stray) |
C++17 |
|
63 ms |
16980 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(int i=1; i<n; i++)d[i]=INF;
for(fr=1; fr<=re; fr++){
for(auto i:link[que[fr]]){
if(d[i.F]<d[que[fr]])continue;
col[i.S]=d[que[fr]]%3+1;
if(d[i.F]==d[que[fr]])continue;
d[i.F]=d[que[fr]]+1;
que[++re]=i.F;
}
}
}
static void col_typeB(){
}
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;
}
/*
7 6 3 6 1
0 2
0 4
1 2
1 3
1 5
4 6
*/
#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 prvmv=-1;
static int ch[3];
static int move_typeA(vector<int> vc){
if(prvmv>=0)vc[prvmv]++;
ch[0]=ch[1]=ch[2]=0;
int tmp=0;
for(int i=0; i<3; i++){
if(vc[i])ch[i]=1, tmp++;
}
if(tmp==1){
for(int i=0; i<3; i++){
if(ch[i]){
prvmv=i;
return i;
}
}
}
if(ch[0]&&ch[1])prvmv=0;
if(ch[1]&&ch[2])prvmv=1;
if(ch[2]&&ch[0])prvmv=2;
return prvmv;
}
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);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
53 ms |
15976 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
44 ms |
15024 KB |
Output is correct |
4 |
Correct |
61 ms |
16968 KB |
Output is correct |
5 |
Correct |
62 ms |
16980 KB |
Output is correct |
6 |
Correct |
49 ms |
15680 KB |
Output is correct |
7 |
Correct |
50 ms |
15732 KB |
Output is correct |
8 |
Correct |
57 ms |
16292 KB |
Output is correct |
9 |
Correct |
60 ms |
16272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
53 ms |
15976 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
44 ms |
15024 KB |
Output is correct |
4 |
Correct |
61 ms |
16968 KB |
Output is correct |
5 |
Correct |
62 ms |
16980 KB |
Output is correct |
6 |
Correct |
49 ms |
15680 KB |
Output is correct |
7 |
Correct |
50 ms |
15732 KB |
Output is correct |
8 |
Correct |
57 ms |
16292 KB |
Output is correct |
9 |
Correct |
60 ms |
16272 KB |
Output is correct |
10 |
Runtime error |
12 ms |
3968 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
11 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
49 ms |
13556 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
39 ms |
12976 KB |
Output is correct |
4 |
Correct |
62 ms |
14824 KB |
Output is correct |
5 |
Correct |
63 ms |
14800 KB |
Output is correct |
6 |
Correct |
46 ms |
13532 KB |
Output is correct |
7 |
Correct |
47 ms |
13540 KB |
Output is correct |
8 |
Correct |
57 ms |
14088 KB |
Output is correct |
9 |
Correct |
53 ms |
13948 KB |
Output is correct |
10 |
Correct |
50 ms |
13836 KB |
Output is correct |
11 |
Correct |
50 ms |
14092 KB |
Output is correct |
12 |
Correct |
56 ms |
13832 KB |
Output is correct |
13 |
Correct |
58 ms |
13836 KB |
Output is correct |
14 |
Correct |
57 ms |
14096 KB |
Output is correct |
15 |
Correct |
56 ms |
14100 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
49 ms |
13556 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
39 ms |
12976 KB |
Output is correct |
4 |
Correct |
62 ms |
14824 KB |
Output is correct |
5 |
Correct |
63 ms |
14800 KB |
Output is correct |
6 |
Correct |
46 ms |
13532 KB |
Output is correct |
7 |
Correct |
47 ms |
13540 KB |
Output is correct |
8 |
Correct |
57 ms |
14088 KB |
Output is correct |
9 |
Correct |
53 ms |
13948 KB |
Output is correct |
10 |
Correct |
50 ms |
13836 KB |
Output is correct |
11 |
Correct |
50 ms |
14092 KB |
Output is correct |
12 |
Correct |
56 ms |
13832 KB |
Output is correct |
13 |
Correct |
58 ms |
13836 KB |
Output is correct |
14 |
Correct |
57 ms |
14096 KB |
Output is correct |
15 |
Correct |
56 ms |
14100 KB |
Output is correct |
16 |
Runtime error |
12 ms |
4096 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
17 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1536 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
3840 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
3840 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |