# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1081411 |
2024-08-30T04:15:14 Z |
LCJLY |
Stray Cat (JOI20_stray) |
C++14 |
|
28 ms |
20852 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%2;
}
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 lst=-1;
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;
}
else if(one.size()==1){
lst=one[0];
return one[0];
}
else{
if(lst==-1){
lst=1;
return 1;
}
else{
lst=!lst;
return !lst;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
27 ms |
20852 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
27 ms |
20852 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
28 ms |
17848 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
28 ms |
17848 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6424 KB |
Output is correct |
2 |
Correct |
2 ms |
6160 KB |
Output is correct |
3 |
Correct |
3 ms |
5672 KB |
Output is correct |
4 |
Correct |
2 ms |
6680 KB |
Output is correct |
5 |
Correct |
2 ms |
6676 KB |
Output is correct |
6 |
Correct |
2 ms |
6684 KB |
Output is correct |
7 |
Correct |
5 ms |
6676 KB |
Output is correct |
8 |
Correct |
2 ms |
6692 KB |
Output is correct |
9 |
Correct |
3 ms |
6684 KB |
Output is correct |
10 |
Correct |
2 ms |
6688 KB |
Output is correct |
11 |
Correct |
3 ms |
6684 KB |
Output is correct |
12 |
Incorrect |
3 ms |
6428 KB |
Wrong Answer [6] |
13 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
28 ms |
16196 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
25 ms |
16264 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |