# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
516476 |
2022-01-21T11:45:18 Z |
jamezzz |
Stray Cat (JOI20_stray) |
C++17 |
|
45 ms |
16556 KB |
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
namespace{
int FunctionExample(int i, int A) {
return i % A;
}
} // namespace
vector<int> Mark(int N,int M,int A,int B,vector<int> U,vector<int> V){
if(A>=3){
vector<int> dist(N,-1);
vector<vector<int>> AL(N);
for(int i=0;i<M;++i){
AL[U[i]].push_back(V[i]);
AL[V[i]].push_back(U[i]);
}
queue<int> q;
dist[0]=0;q.push(0);
while(!q.empty()){
int u=q.front();q.pop();
for(int v:AL[u]){
if(dist[v]==-1){
dist[v]=dist[u]+1;
q.push(v);
}
}
}
//for(int i=0;i<N;++i)printf("%d %d\n",i,dist[i]);
vector<int> X(M);
for(int i=0;i<M;++i){
if(dist[U[i]]!=dist[V[i]])X[i]=(dist[U[i]]+dist[V[i]])%3;
else X[i]=(2*dist[U[i]]+1)%3;
//printf("%d %d %d %d %d\n",U[i],V[i],dist[U[i]],dist[V[i]],X[i]);
}
return X;
}
else{
vector<int> X(M);
return X;
}
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
bool tree=true;
void Init(int A, int B){
if(A>=3)tree=false;
}
int Move(vector<int> y){
if(!tree){
if(y[0]==0&&y[1]==0)return 2;
if(y[0]==0&&y[2]==0)return 1;
if(y[1]==0&&y[2]==0)return 0;
if(y[0]==0)return 2;
if(y[1]==0)return 0;
if(y[2]==0)return 1;
}
else{
return 0;
}
}
Compilation message
Anthony.cpp:6:6: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
6 | int FunctionExample(int i, int A) {
| ^~~~~~~~~~~~~~~
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type]
23 | }
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
37 ms |
15308 KB |
Output is correct |
2 |
Correct |
0 ms |
544 KB |
Output is correct |
3 |
Correct |
28 ms |
14708 KB |
Output is correct |
4 |
Correct |
44 ms |
16556 KB |
Output is correct |
5 |
Correct |
41 ms |
16464 KB |
Output is correct |
6 |
Correct |
34 ms |
15148 KB |
Output is correct |
7 |
Correct |
34 ms |
15236 KB |
Output is correct |
8 |
Correct |
41 ms |
15832 KB |
Output is correct |
9 |
Correct |
41 ms |
15852 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
37 ms |
15308 KB |
Output is correct |
2 |
Correct |
0 ms |
544 KB |
Output is correct |
3 |
Correct |
28 ms |
14708 KB |
Output is correct |
4 |
Correct |
44 ms |
16556 KB |
Output is correct |
5 |
Correct |
41 ms |
16464 KB |
Output is correct |
6 |
Correct |
34 ms |
15148 KB |
Output is correct |
7 |
Correct |
34 ms |
15236 KB |
Output is correct |
8 |
Correct |
41 ms |
15832 KB |
Output is correct |
9 |
Correct |
41 ms |
15852 KB |
Output is correct |
10 |
Correct |
32 ms |
13260 KB |
Output is correct |
11 |
Correct |
40 ms |
13168 KB |
Output is correct |
12 |
Correct |
31 ms |
13168 KB |
Output is correct |
13 |
Correct |
37 ms |
13168 KB |
Output is correct |
14 |
Correct |
33 ms |
13460 KB |
Output is correct |
15 |
Correct |
38 ms |
13772 KB |
Output is correct |
16 |
Correct |
40 ms |
15996 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
37 ms |
12980 KB |
Output is correct |
2 |
Correct |
1 ms |
584 KB |
Output is correct |
3 |
Correct |
26 ms |
12520 KB |
Output is correct |
4 |
Correct |
45 ms |
14316 KB |
Output is correct |
5 |
Correct |
45 ms |
14196 KB |
Output is correct |
6 |
Correct |
33 ms |
13052 KB |
Output is correct |
7 |
Correct |
32 ms |
13040 KB |
Output is correct |
8 |
Correct |
39 ms |
13636 KB |
Output is correct |
9 |
Correct |
38 ms |
13676 KB |
Output is correct |
10 |
Correct |
38 ms |
13448 KB |
Output is correct |
11 |
Correct |
39 ms |
13480 KB |
Output is correct |
12 |
Correct |
36 ms |
13452 KB |
Output is correct |
13 |
Correct |
35 ms |
13464 KB |
Output is correct |
14 |
Correct |
38 ms |
13668 KB |
Output is correct |
15 |
Correct |
37 ms |
13660 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
37 ms |
12980 KB |
Output is correct |
2 |
Correct |
1 ms |
584 KB |
Output is correct |
3 |
Correct |
26 ms |
12520 KB |
Output is correct |
4 |
Correct |
45 ms |
14316 KB |
Output is correct |
5 |
Correct |
45 ms |
14196 KB |
Output is correct |
6 |
Correct |
33 ms |
13052 KB |
Output is correct |
7 |
Correct |
32 ms |
13040 KB |
Output is correct |
8 |
Correct |
39 ms |
13636 KB |
Output is correct |
9 |
Correct |
38 ms |
13676 KB |
Output is correct |
10 |
Correct |
38 ms |
13448 KB |
Output is correct |
11 |
Correct |
39 ms |
13480 KB |
Output is correct |
12 |
Correct |
36 ms |
13452 KB |
Output is correct |
13 |
Correct |
35 ms |
13464 KB |
Output is correct |
14 |
Correct |
38 ms |
13668 KB |
Output is correct |
15 |
Correct |
37 ms |
13660 KB |
Output is correct |
16 |
Correct |
28 ms |
11404 KB |
Output is correct |
17 |
Correct |
28 ms |
11432 KB |
Output is correct |
18 |
Correct |
30 ms |
11352 KB |
Output is correct |
19 |
Correct |
35 ms |
11324 KB |
Output is correct |
20 |
Correct |
34 ms |
11904 KB |
Output is correct |
21 |
Correct |
32 ms |
11752 KB |
Output is correct |
22 |
Correct |
36 ms |
13844 KB |
Output is correct |
23 |
Correct |
32 ms |
11404 KB |
Output is correct |
24 |
Correct |
30 ms |
11316 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
728 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
26 ms |
9848 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
26 ms |
9800 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |