# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
260825 |
2020-08-11T04:34:19 Z |
반딧불(#5074) |
Stray Cat (JOI20_stray) |
C++17 |
|
71 ms |
17352 KB |
#include <bits/stdc++.h>
#include "Anthony.h"
using namespace std;
namespace {
struct dat{
int x, y;
dat(){}
dat(int x, int y): x(x), y(y){}
};
int n, k;
vector<pair<int, int> > link[20002];
int dist[20002];
bool visited[20002];
}
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
vector<int> ret (M, -1);
n = N;
k = M;
for(int i=0; i<k; i++){
link[U[i]].push_back(make_pair(V[i], i));
link[V[i]].push_back(make_pair(U[i], i));
}
queue<dat> que;
que.push(dat(0, 0));
visited[0] = 1;
while(!que.empty()){
dat tmp = que.front();
que.pop();
for(auto &nxt: link[tmp.x]){
if(visited[nxt.first]) continue;
visited[nxt.first] = 1;
dist[nxt.first] = tmp.y+1;
ret[nxt.second] = tmp.y % 3;
que.push(dat(nxt.first, tmp.y+1));
}
}
for(int i=0; i<k; i++){
if(ret[i] != -1) continue;
ret[i] = min(dist[U[i]], dist[V[i]]) % 3;
}
return ret;
}
#include <bits/stdc++.h>
#include "Catherine.h"
using namespace std;
namespace {
int a, b;
}
void Init(int A, int B) {
a = A;
b = B;
}
int Move(vector<int> y) {
int c0 = !!y[0];
int c1 = !!y[1];
int c2 = !!y[2];
if(c0 + c1 + c2 == 1){
if(c0) return 0;
if(c1) return 1;
return 2;
}
if(!c0) return 1;
if(!c1) return 2;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
56 ms |
16120 KB |
Output is correct |
2 |
Correct |
2 ms |
1536 KB |
Output is correct |
3 |
Correct |
44 ms |
15640 KB |
Output is correct |
4 |
Correct |
71 ms |
17352 KB |
Output is correct |
5 |
Correct |
71 ms |
17288 KB |
Output is correct |
6 |
Correct |
53 ms |
15840 KB |
Output is correct |
7 |
Correct |
61 ms |
15852 KB |
Output is correct |
8 |
Correct |
62 ms |
16696 KB |
Output is correct |
9 |
Correct |
60 ms |
16788 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
56 ms |
16120 KB |
Output is correct |
2 |
Correct |
2 ms |
1536 KB |
Output is correct |
3 |
Correct |
44 ms |
15640 KB |
Output is correct |
4 |
Correct |
71 ms |
17352 KB |
Output is correct |
5 |
Correct |
71 ms |
17288 KB |
Output is correct |
6 |
Correct |
53 ms |
15840 KB |
Output is correct |
7 |
Correct |
61 ms |
15852 KB |
Output is correct |
8 |
Correct |
62 ms |
16696 KB |
Output is correct |
9 |
Correct |
60 ms |
16788 KB |
Output is correct |
10 |
Correct |
50 ms |
14016 KB |
Output is correct |
11 |
Correct |
46 ms |
14088 KB |
Output is correct |
12 |
Correct |
47 ms |
14112 KB |
Output is correct |
13 |
Correct |
52 ms |
14000 KB |
Output is correct |
14 |
Correct |
51 ms |
14372 KB |
Output is correct |
15 |
Correct |
60 ms |
14660 KB |
Output is correct |
16 |
Correct |
60 ms |
16728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
53 ms |
13816 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
42 ms |
13368 KB |
Output is correct |
4 |
Correct |
64 ms |
14940 KB |
Output is correct |
5 |
Correct |
63 ms |
14956 KB |
Output is correct |
6 |
Correct |
50 ms |
13928 KB |
Output is correct |
7 |
Correct |
51 ms |
13676 KB |
Output is correct |
8 |
Correct |
62 ms |
14488 KB |
Output is correct |
9 |
Correct |
58 ms |
14480 KB |
Output is correct |
10 |
Correct |
56 ms |
14036 KB |
Output is correct |
11 |
Correct |
56 ms |
14228 KB |
Output is correct |
12 |
Correct |
50 ms |
14236 KB |
Output is correct |
13 |
Correct |
53 ms |
14236 KB |
Output is correct |
14 |
Correct |
60 ms |
14676 KB |
Output is correct |
15 |
Correct |
61 ms |
14488 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
53 ms |
13816 KB |
Output is correct |
2 |
Correct |
1 ms |
1536 KB |
Output is correct |
3 |
Correct |
42 ms |
13368 KB |
Output is correct |
4 |
Correct |
64 ms |
14940 KB |
Output is correct |
5 |
Correct |
63 ms |
14956 KB |
Output is correct |
6 |
Correct |
50 ms |
13928 KB |
Output is correct |
7 |
Correct |
51 ms |
13676 KB |
Output is correct |
8 |
Correct |
62 ms |
14488 KB |
Output is correct |
9 |
Correct |
58 ms |
14480 KB |
Output is correct |
10 |
Correct |
56 ms |
14036 KB |
Output is correct |
11 |
Correct |
56 ms |
14228 KB |
Output is correct |
12 |
Correct |
50 ms |
14236 KB |
Output is correct |
13 |
Correct |
53 ms |
14236 KB |
Output is correct |
14 |
Correct |
60 ms |
14676 KB |
Output is correct |
15 |
Correct |
61 ms |
14488 KB |
Output is correct |
16 |
Correct |
46 ms |
12140 KB |
Output is correct |
17 |
Correct |
43 ms |
12236 KB |
Output is correct |
18 |
Correct |
48 ms |
12188 KB |
Output is correct |
19 |
Correct |
44 ms |
12312 KB |
Output is correct |
20 |
Correct |
53 ms |
12860 KB |
Output is correct |
21 |
Correct |
50 ms |
12532 KB |
Output is correct |
22 |
Correct |
58 ms |
14412 KB |
Output is correct |
23 |
Correct |
46 ms |
12108 KB |
Output is correct |
24 |
Correct |
52 ms |
12236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1680 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
4608 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
4608 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |