# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1081401 |
2024-08-30T04:06:47 Z |
LCJLY |
Stray Cat (JOI20_stray) |
C++14 |
|
43 ms |
22588 KB |
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
//#define int long long
//#define ld long double
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << #i << " " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef pair<pii,int>pi2;
vector<int>adj[200005];
int d[200005];
bool visited[200005];
void dfs(int index, int par){
visited[index]=true;
for(auto it:adj[index]){
if(it==par) continue;
if(visited[it]) continue;
d[it]=d[index]+1;
dfs(it,index);
}
}
vector<int>Mark(int N, int M, int A, int B, vector<int>U, vector<int>V) {
vector<int>ans(M);
for(int x=0;x<M;x++){
adj[U[x]].push_back(V[x]);
adj[V[x]].push_back(U[x]);
}
dfs(0,-1);
for(int x=0;x<M;x++){
int hold=max(d[U[x]],d[V[x]]);
ans[x]=hold%3;
}
return ans;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
//#define int long long
//#define ld long double
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << #i << " " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef pair<pii,int>pi2;
int m;
void Init(int A, int B){
m=A;
}
int Move(vector<int>y){
vector<int>one;
for(int x=0;x<m;x++){
if(y[x]==1) one.push_back(x);
}
sort(one.begin(),one.end());
if(one.empty()) return -1;
if(one.size()==1) return one[0];
else{
if(one[0]==1&&one[1]==2){
return 1;
}
else if(one[0]==0&&one[1]==2){
return 2;
}
else return 0;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
38 ms |
20784 KB |
Output is correct |
2 |
Correct |
2 ms |
5416 KB |
Output is correct |
3 |
Correct |
26 ms |
19588 KB |
Output is correct |
4 |
Correct |
38 ms |
22516 KB |
Output is correct |
5 |
Correct |
35 ms |
22588 KB |
Output is correct |
6 |
Correct |
28 ms |
20308 KB |
Output is correct |
7 |
Correct |
31 ms |
20312 KB |
Output is correct |
8 |
Correct |
30 ms |
21416 KB |
Output is correct |
9 |
Correct |
40 ms |
21592 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
38 ms |
20784 KB |
Output is correct |
2 |
Correct |
2 ms |
5416 KB |
Output is correct |
3 |
Correct |
26 ms |
19588 KB |
Output is correct |
4 |
Correct |
38 ms |
22516 KB |
Output is correct |
5 |
Correct |
35 ms |
22588 KB |
Output is correct |
6 |
Correct |
28 ms |
20308 KB |
Output is correct |
7 |
Correct |
31 ms |
20312 KB |
Output is correct |
8 |
Correct |
30 ms |
21416 KB |
Output is correct |
9 |
Correct |
40 ms |
21592 KB |
Output is correct |
10 |
Incorrect |
26 ms |
17968 KB |
Wrong Answer [6] |
11 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
18400 KB |
Output is correct |
2 |
Correct |
3 ms |
5404 KB |
Output is correct |
3 |
Correct |
23 ms |
17212 KB |
Output is correct |
4 |
Correct |
33 ms |
20500 KB |
Output is correct |
5 |
Correct |
43 ms |
20572 KB |
Output is correct |
6 |
Correct |
33 ms |
17912 KB |
Output is correct |
7 |
Correct |
30 ms |
18008 KB |
Output is correct |
8 |
Correct |
33 ms |
19268 KB |
Output is correct |
9 |
Correct |
31 ms |
19292 KB |
Output is correct |
10 |
Correct |
36 ms |
18860 KB |
Output is correct |
11 |
Correct |
28 ms |
19028 KB |
Output is correct |
12 |
Correct |
31 ms |
19024 KB |
Output is correct |
13 |
Correct |
30 ms |
19040 KB |
Output is correct |
14 |
Correct |
31 ms |
19288 KB |
Output is correct |
15 |
Correct |
31 ms |
19300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
18400 KB |
Output is correct |
2 |
Correct |
3 ms |
5404 KB |
Output is correct |
3 |
Correct |
23 ms |
17212 KB |
Output is correct |
4 |
Correct |
33 ms |
20500 KB |
Output is correct |
5 |
Correct |
43 ms |
20572 KB |
Output is correct |
6 |
Correct |
33 ms |
17912 KB |
Output is correct |
7 |
Correct |
30 ms |
18008 KB |
Output is correct |
8 |
Correct |
33 ms |
19268 KB |
Output is correct |
9 |
Correct |
31 ms |
19292 KB |
Output is correct |
10 |
Correct |
36 ms |
18860 KB |
Output is correct |
11 |
Correct |
28 ms |
19028 KB |
Output is correct |
12 |
Correct |
31 ms |
19024 KB |
Output is correct |
13 |
Correct |
30 ms |
19040 KB |
Output is correct |
14 |
Correct |
31 ms |
19288 KB |
Output is correct |
15 |
Correct |
31 ms |
19300 KB |
Output is correct |
16 |
Incorrect |
22 ms |
16200 KB |
Wrong Answer [6] |
17 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
5416 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
7136 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
7160 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |