Submission #925937

#TimeUsernameProblemLanguageResultExecution timeMemory
925937mickey080929Stray Cat (JOI20_stray)C++17
0 / 100
31 ms26676 KiB
#include "Anthony.h" #include <bits/stdc++.h> using namespace std; int seq[] = {1, 1, 0, 1, 0, 0}; vector<int> adj[20010]; int dist[20010]; vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) { for (int i=0; i<M; i++) { adj[U[i]].push_back(V[i]); adj[V[i]].push_back(U[i]); } memset(dist, -1, sizeof(dist)); queue<int> q; q.push(0); dist[0] = 0; while (!q.empty()) { int x = q.front(); q.pop(); for (auto &y : adj[x]) { if (dist[y] != -1) { dist[y] = dist[x] + 1; q.push(y); } } } vector<int> ret(M); if (B >= 3) { for (int i=0; i<M; i++) { ret[i] = min(dist[U[i]], dist[V[i]]) % 3; } } else { for (int i=0; i<M; i++) { ret[i] = seq[min(dist[U[i]], dist[V[i]]) % 6]; } } return ret; }
#include "Catherine.h" #include <bits/stdc++.h> using namespace std; int A, B; void Init(int _A, int _B) { A = _A; B = _B; } int Move(vector<int> y) { if (B >= 3) { if (y[0] && y[1]) return 0; if (y[1] && y[2]) return 1; if (y[2] && y[0]) return 2; if (y[0]) return 0; if (y[1]) return 1; if (y[2]) return 2; assert(0); } }

Compilation message (stderr)

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^
#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...