Submission #1081400

#TimeUsernameProblemLanguageResultExecution timeMemory
1081400LCJLYStray Cat (JOI20_stray)C++14
0 / 100
38 ms20472 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%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; void Init(int A, int B){ } int Move(vector<int>y){ vector<int>one; for(auto it:y){ if(it==1) one.push_back(it); } 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 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...