# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
260860 |
2020-08-11T06:09:03 Z |
송준혁(#5049) |
Stray Cat (JOI20_stray) |
C++17 |
|
55 ms |
15620 KB |
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
std::vector<int> adj[20202];
int D[20202], P[20202];
queue<int> Q;
}
std::vector<int> Mark(int N, int M, int A, int B, std::vector<int> U, std::vector<int> V) {
std::vector<int> X(M);
memset(P, -1, sizeof P);
for (int i=0; i<M; i++){
adj[U[i]].push_back(V[i]);
adj[V[i]].push_back(U[i]);
}
Q.push(0);
while (Q.size()){
int u = Q.front();
Q.pop();
for (int v : adj[u]) if (P[v]<0){
P[v] = u, D[v]=D[u]+1;
Q.push(v);
}
}
for (int i=0; i<M; i++){
int u=U[i], v=V[i];
if (D[u] < D[v]) X[i] = D[v] % 3;
else if (D[u] > D[v]) X[i] = D[u] % 3;
else X[i] = (D[v]+1) % 3;
}
return X;
}
#include "Catherine.h"
#include <vector>
void Init(int A, int B) {
}
int Move(std::vector<int> y) {
if (y[0] && y[1]) return 0;
if (y[1] && y[2]) return 1;
if (y[0] && y[2]) return 2;
if (y[0]) return 0;
if (y[1]) return 1;
if (y[2]) return 2;
}
Compilation message
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
15620 KB |
Output is correct |
2 |
Correct |
1 ms |
1792 KB |
Output is correct |
3 |
Incorrect |
37 ms |
14968 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
15620 KB |
Output is correct |
2 |
Correct |
1 ms |
1792 KB |
Output is correct |
3 |
Incorrect |
37 ms |
14968 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
13180 KB |
Output is correct |
2 |
Correct |
1 ms |
1792 KB |
Output is correct |
3 |
Incorrect |
41 ms |
12888 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
13180 KB |
Output is correct |
2 |
Correct |
1 ms |
1792 KB |
Output is correct |
3 |
Incorrect |
41 ms |
12888 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1664 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
4096 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
4096 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |