Submission #710334

#TimeUsernameProblemLanguageResultExecution timeMemory
710334blackscreen1Stray Cat (JOI20_stray)C++17
15 / 100
52 ms16440 KiB
#include "Anthony.h" #include <bits//stdc++.h> using namespace std; #define ll long long #define iloop(m, h) for (auto i = m; i != h; i+=(m<h?1:-1)) #define jloop(m, h) for (auto j = m; j != h; j+=(m<h?1:-1)) #define kloop(m, h) for (auto k = m; k != h; k+=(m<h?1:-1)) #define lloop(m, h) for (auto l = m; l != h; l+=(m<h?1:-1)) #define iloop_(m, h, g) for (auto i = m; i != h; i+=g) #define jloop_(m, h, g) for (auto j = m; j != h; j+=g) #define kloop_(m, h, g) for (auto k = m; k != h; k+=g) #define lloop_(m, h, g) for (auto l = m; l != h; l+=g) #define getchar_unlocked _getchar_nolock // comment before submission #define pll pair<ll,ll> #define plll pair<ll, pll> #define pllll pair<pll, pll> #define vll vector<ll> #define qll queue<ll> #define dll deque<ll> #define pqll priority_queue<ll> #define gll greater<ll> #define INF 1000000000000000 #define MOD1 1000000007 #define MOD2 998244353 #define MOD3 1000000009 vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) { vector<int> X(M); vector<int> adj[N]; iloop(0, M) { adj[U[i]].push_back(V[i]); adj[V[i]].push_back(U[i]); } queue<int> q, nq; q.push(0); int dist = 1; bool vis[N] = {}; int dis[N]; dis[0] = 0; vis[0] = 1; while (q.size()) { while (q.size()) { int nd = q.front(); q.pop(); for (auto it : adj[nd]) { if (!vis[it]) { vis[it] = 1; nq.push(it); } } } while (nq.size()) { dis[nq.front()] = dist; q.push(nq.front()); nq.pop(); } dist++; } //iloop(0, N) cout << dis[i] << " "; //cout << "\n"; iloop(0, M) { X[i] = min(dis[U[i]], dis[V[i]])%3; //cout << X[i] << " "; } //cout << "\n"; return X; }
#include "Catherine.h" #include <bits//stdc++.h> using namespace std; #define ll long long #define iloop(m, h) for (auto i = m; i != h; i+=(m<h?1:-1)) #define jloop(m, h) for (auto j = m; j != h; j+=(m<h?1:-1)) #define kloop(m, h) for (auto k = m; k != h; k+=(m<h?1:-1)) #define lloop(m, h) for (auto l = m; l != h; l+=(m<h?1:-1)) #define iloop_(m, h, g) for (auto i = m; i != h; i+=g) #define jloop_(m, h, g) for (auto j = m; j != h; j+=g) #define kloop_(m, h, g) for (auto k = m; k != h; k+=g) #define lloop_(m, h, g) for (auto l = m; l != h; l+=g) #define getchar_unlocked _getchar_nolock // comment before submission #define pll pair<ll,ll> #define plll pair<ll, pll> #define pllll pair<pll, pll> #define vll vector<ll> #define qll queue<ll> #define dll deque<ll> #define pqll priority_queue<ll> #define gll greater<ll> #define INF 1000000000000000 #define MOD1 1000000007 #define MOD2 998244353 #define MOD3 1000000009 int oa, ob; void Init(int A, int B) { oa = A, ob = B; } int Move(vector<int> y) { //iloop(0, 3) cout << y[i] << " "; //cout << "\n"; if (y[0] == 0) { if (y[1] == 0) return 2; return 1; } if (y[1] == 0) { if (y[2] == 0) return 0; return 2; } if (y[2] == 0) { if (y[0] == 0) return 1; return 0; } abort(); }
#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...