Submission #513246

#TimeUsernameProblemLanguageResultExecution timeMemory
513246wiwihoStray Cat (JOI20_stray)C++14
15 / 100
48 ms16028 KiB
#include "Anthony.h" #include <bits/stdc++.h> #define mp make_pair #define F first #define S second #define iter(a) a.begin(), a.end() #define lsort(a) sort(iter(a)) #define gsort(a) sort(iter(a), greater<>()) #define eb emplace_back #define printv(a, b) { \ for(auto pv : a) b << pv << " "; \ b << "\n"; \ } using namespace std; namespace { } // namespace vector<int> Mark(int n, int m, int A, int B, vector<int> U, vector<int> V) { assert(A >= 3); vector<int> ans(m); vector<vector<int>> g(n); for(int i = 0; i < m; i++){ int u = U[i], v = V[i]; g[u].eb(v); g[v].eb(u); } vector<int> dis(n, -1); dis[0] = 0; queue<int> q; q.push(0); while(!q.empty()){ int now = q.front(); q.pop(); for(int i : g[now]){ if(dis[i] != -1) continue; dis[i] = dis[now] + 1; q.push(i); } } for(int i = 0; i < m; i++){ int u = U[i], v = V[i]; if(dis[u] > dis[v]) swap(u, v); int t = dis[u] == dis[v] ? dis[v] + 1 : dis[v]; t %= 3; ans[i] = t; } return ans; }
#include "Catherine.h" #include <bits/stdc++.h> #define mp make_pair #define F first #define S second #define iter(a) a.begin(), a.end() #define lsort(a) sort(iter(a)) #define gsort(a) sort(iter(a), greater<>()) #define eb emplace_back #define printv(a, b) { \ for(auto pv : a) b << pv << " "; \ b << "\n"; \ } using namespace std; namespace { int A, B; } // namespace void Init(int A, int B) { ::A = A; ::B = B; } int Move(vector<int> y) { vector<int> t; for(int i = 0; i < A; i++){ if(y[i]) t.eb(i); } if(t.size() == 1) return t[0]; if(t[0] == 0 && t[1] == 2) return 2; return t[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...