Submission #565933

#TimeUsernameProblemLanguageResultExecution timeMemory
565933errorgornStray Cat (JOI20_stray)C++17
0 / 100
42 ms3836 KiB
#include "Anthony.h" #include <bits/stdc++.h> using namespace std; #define int long long #define ii pair<int,int> #define fi first #define se second #define puf push_front #define pof pop_front #define pub push_back #define pob pop_back #define lb lower_bound #define ub upper_bound #define rep(x,s,e) for (int x=(s)-((s)>(e));x!=(e)-((s)>(e));((s)<(e))?x++:x--) #define all(x) (x).begin(),(x).end() #define sz(x) (int) (x).size() namespace { bool st; int n,m; vector<int> al[20005]; int w[20005]; queue<int> q; } vector<signed> Mark(signed N, signed M, signed A, signed B, vector<signed> U, vector<signed> V) { st=(A>=3); n=N,m=M; if (st){ rep(x,0,m){ al[U[x]].pub(V[x]); al[V[x]].pub(U[x]); } memset(w,-1,sizeof(w)); q.push(0); w[0]=0; while (!q.empty()){ int u=q.front(); q.pop(); for (auto it:al[u]) if (w[it]==-1){ w[it]=w[u]+1; q.push(it); } } vector<signed> res; rep(x,0,m){ res.pub(min(w[U[x]],w[V[x]])%3); cout<<res.back()<<" "<<U[x]<<" "<<V[x]<<endl; } return res; } else{ return {}; } }
#include "Catherine.h" #include <bits/stdc++.h> using namespace std; #define int long long #define ii pair<int,int> #define fi first #define se second #define puf push_front #define pof pop_front #define pub push_back #define pob pop_back #define lb lower_bound #define ub upper_bound #define rep(x,s,e) for (int x=(s)-((s)>(e));x!=(e)-((s)>(e));((s)<(e))?x++:x--) #define all(x) (x).begin(),(x).end() #define sz(x) (int) (x).size() namespace { bool st; int PREV=-1; } void Init(signed A, signed B) { st=(A>=3); } signed Move(vector<signed> y) { if (st){ vector<int> v; rep(x,0,3) if (y[x] || PREV==x) v.pub(x); sort(all(v)); if (sz(v)==1){ return PREV=v[0]; } else if (v[1]==1){ return PREV=0; } else if (v[0]==1){ return PREV=1; } else{ return PREV=2; } } else{ return 69; } }
#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...