Submission #1081411

#TimeUsernameProblemLanguageResultExecution timeMemory
1081411LCJLYStray Cat (JOI20_stray)C++14
0 / 100
28 ms20852 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...