# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
260854 |
2020-08-11T05:57:59 Z |
임성재(#5066) |
Stray Cat (JOI20_stray) |
C++17 |
|
67 ms |
21092 KB |
#include "Anthony.h"
#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define em emplace
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INF = 1e18;
const int inf = 1e9;
namespace {
vector<int> g[200010];
int d[200010] = {};
int f(int x, int y) {
return min(x, y) % 3;
}
} // namespace
std::vector<int> Mark(int N, int M, int A, int B,
std::vector<int> U, std::vector<int> V) {
for(int i=0; i<M; i++) g[U[i]].eb(V[i]), g[V[i]].eb(U[i]);
queue<int> q;
q.em(0);
d[0] = 1;
while(q.size()) {
int x = q.front();
q.pop();
for(auto i : g[x]) {
if(d[i]) continue;
d[i] = d[x] + 1;
q.em(i);
}
}
std::vector<int> X(M);
for (int i = 0; i < M; ++i) {
X[i] = f(d[U[i]], d[V[i]]);
}
return X;
}
#include "Catherine.h"
#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define em emplace
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INF = 1e18;
const int inf = 1e9;
namespace {
int a, b;
} // namespace
void Init(int A, int B) {
a = A;
b = B;
}
int Move(std::vector<int> y) {
if(!y[0] && !y[1]) return 2;
else if(!y[1] && !y[2]) return 0;
else if(!y[2] && !y[0]) return 1;
else if(y[0] && y[1]) return 0;
else if(y[1] && y[2]) return 1;
else return 2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
54 ms |
19932 KB |
Output is correct |
2 |
Correct |
3 ms |
9984 KB |
Output is correct |
3 |
Correct |
51 ms |
19192 KB |
Output is correct |
4 |
Correct |
65 ms |
21092 KB |
Output is correct |
5 |
Correct |
63 ms |
21040 KB |
Output is correct |
6 |
Correct |
57 ms |
19652 KB |
Output is correct |
7 |
Correct |
51 ms |
19700 KB |
Output is correct |
8 |
Correct |
60 ms |
20444 KB |
Output is correct |
9 |
Correct |
60 ms |
20344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
54 ms |
19932 KB |
Output is correct |
2 |
Correct |
3 ms |
9984 KB |
Output is correct |
3 |
Correct |
51 ms |
19192 KB |
Output is correct |
4 |
Correct |
65 ms |
21092 KB |
Output is correct |
5 |
Correct |
63 ms |
21040 KB |
Output is correct |
6 |
Correct |
57 ms |
19652 KB |
Output is correct |
7 |
Correct |
51 ms |
19700 KB |
Output is correct |
8 |
Correct |
60 ms |
20444 KB |
Output is correct |
9 |
Correct |
60 ms |
20344 KB |
Output is correct |
10 |
Correct |
46 ms |
17648 KB |
Output is correct |
11 |
Correct |
48 ms |
17696 KB |
Output is correct |
12 |
Correct |
48 ms |
17716 KB |
Output is correct |
13 |
Correct |
48 ms |
17712 KB |
Output is correct |
14 |
Correct |
53 ms |
17784 KB |
Output is correct |
15 |
Correct |
56 ms |
18376 KB |
Output is correct |
16 |
Correct |
60 ms |
20524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
52 ms |
17516 KB |
Output is correct |
2 |
Correct |
4 ms |
9984 KB |
Output is correct |
3 |
Correct |
43 ms |
17120 KB |
Output is correct |
4 |
Correct |
65 ms |
18676 KB |
Output is correct |
5 |
Correct |
61 ms |
19060 KB |
Output is correct |
6 |
Correct |
56 ms |
17440 KB |
Output is correct |
7 |
Correct |
49 ms |
17492 KB |
Output is correct |
8 |
Correct |
67 ms |
18164 KB |
Output is correct |
9 |
Correct |
59 ms |
18260 KB |
Output is correct |
10 |
Correct |
64 ms |
18008 KB |
Output is correct |
11 |
Correct |
62 ms |
18000 KB |
Output is correct |
12 |
Correct |
57 ms |
17908 KB |
Output is correct |
13 |
Correct |
55 ms |
18136 KB |
Output is correct |
14 |
Correct |
63 ms |
18272 KB |
Output is correct |
15 |
Correct |
63 ms |
18180 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
52 ms |
17516 KB |
Output is correct |
2 |
Correct |
4 ms |
9984 KB |
Output is correct |
3 |
Correct |
43 ms |
17120 KB |
Output is correct |
4 |
Correct |
65 ms |
18676 KB |
Output is correct |
5 |
Correct |
61 ms |
19060 KB |
Output is correct |
6 |
Correct |
56 ms |
17440 KB |
Output is correct |
7 |
Correct |
49 ms |
17492 KB |
Output is correct |
8 |
Correct |
67 ms |
18164 KB |
Output is correct |
9 |
Correct |
59 ms |
18260 KB |
Output is correct |
10 |
Correct |
64 ms |
18008 KB |
Output is correct |
11 |
Correct |
62 ms |
18000 KB |
Output is correct |
12 |
Correct |
57 ms |
17908 KB |
Output is correct |
13 |
Correct |
55 ms |
18136 KB |
Output is correct |
14 |
Correct |
63 ms |
18272 KB |
Output is correct |
15 |
Correct |
63 ms |
18180 KB |
Output is correct |
16 |
Correct |
47 ms |
15964 KB |
Output is correct |
17 |
Correct |
44 ms |
15864 KB |
Output is correct |
18 |
Correct |
45 ms |
15736 KB |
Output is correct |
19 |
Correct |
46 ms |
15736 KB |
Output is correct |
20 |
Correct |
54 ms |
16468 KB |
Output is correct |
21 |
Correct |
47 ms |
16216 KB |
Output is correct |
22 |
Correct |
60 ms |
18356 KB |
Output is correct |
23 |
Correct |
46 ms |
15736 KB |
Output is correct |
24 |
Correct |
46 ms |
15924 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
9984 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
12288 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
12288 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |