# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
444851 |
2021-07-15T15:26:27 Z |
kig9981 |
Stray Cat (JOI20_stray) |
C++17 |
|
39 ms |
15552 KB |
#include "Anthony.h"
#include <bits/stdc++.h>
#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif
using namespace std;
vector<pair<int,int>> adj[20000];
int dist[20000];
std::vector<int> Mark(int N, int M, int A, int B, std::vector<int> U, std::vector<int> V) {
vector<int> X(M,-1);
queue<pair<int,int>> Q;
memset(dist,-1,sizeof(dist));
for(int i=0;i<M;i++) {
adj[U[i]].emplace_back(V[i],i);
adj[V[i]].emplace_back(U[i],i);
}
dist[0]=0;
for(auto[n,t]: adj[0]) Q.emplace(n,X[t]=0);
while(!Q.empty()) {
auto[c,p]=Q.front();
Q.pop();
for(auto[n,t]: adj[c]) {
if(dist[n]==-1) {
dist[n]=dist[c]+1;
if(A==2) {
}
else X[t]=min(dist[c],dist[n])%3;
Q.emplace(n,X[t]);
}
else if(X[t]==-1) X[t]=min(dist[c],dist[n])%3;
}
}
return X;
}
#include "Catherine.h"
#include <bits/stdc++.h>
#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif
using namespace std;
int A, r;
bool d;
void Init(int A, int B) {
::A = A;
r=-1; d=false;
}
int Move(std::vector<int> y) {
if(r!=-1) y[r]++;
if(A==2) {
}
else for(int i=0;i<3;i++) if(y[i]==0) return r=(i+2)%3;
}
Compilation message
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type]
28 | }
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
39 ms |
15552 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
39 ms |
15552 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
37 ms |
13384 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
37 ms |
13384 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1132 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
2628 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
2624 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |