Submission #994544

#TimeUsernameProblemLanguageResultExecution timeMemory
994544TimDeeStray Cat (JOI20_stray)C++17
0 / 100
23 ms15472 KiB
#include "Anthony.h" #include <bits/stdc++.h> using namespace std; #define forn(i,n) for(int i=0; i<(n); ++i) #define pb push_back #define pi pair<int,int> #define f first #define s second const int N=2e4+5; vector<pi> adj[N]; int z[N]; vector<int> Mark(int n, int m, int A, int B, vector<int> u, vector<int> v) { if (A<3) exit(0); forn(i,m) { adj[u[i]].pb({v[i],i}); adj[v[i]].pb({u[i],i}); } queue<int> q; q.push(0); vector<int> vis(n); vis[0]=1; vector<int> d(n); while (q.size()) { int u=q.front(); q.pop(); for(auto&e:adj[u]) { int v=e.f, i=e.s; if (!z[i]) { z[i] = (d[u]%3)+1; } if (vis[v]) continue; vis[v]=1; q.push(v); d[v]=d[u]+1; } } vector<int> ans(m); forn(i,m) ans[i]=z[i]-1; return ans; }
#include "Catherine.h" #include <bits/stdc++.h> using namespace std; #define forn(i,n) for(int i=0; i<(n); ++i) #define pb push_back #define pi pair<int,int> #define f first #define s second void Init(int A, int B) { if (A<3) exit(0); } int Move(vector<int> a) { if (a[0]&&a[2]) return 2; if (a[0]&&a[1]) return 0; return 1; }
#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...