Submission #212356

#TimeUsernameProblemLanguageResultExecution timeMemory
212356JustasZStray Cat (JOI20_stray)C++14
15 / 100
88 ms17476 KiB
#include "Anthony.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define x first #define y second #define all(a) a.begin(), a.end() #define sz(a) (int)a.size() #define rd() abs((int)rng()) typedef long long ll; typedef long double ld; typedef pair<int, int>pii; const int maxn = 2e4 + 100; const int mod = 1e9 + 7; namespace { int n, m, A, B; vector<int>U, V, label, adj[maxn]; void solve1() { queue<int>Q; vector<int>dist(n, mod); dist[0] = 0; Q.push(0); while (sz(Q)) { int v = Q.front(); Q.pop(); for (int to : adj[v]) { if (dist[to] > dist[v] + 1) { dist[to] = dist[v] + 1; Q.push(to); } } } for (int i = 0; i < m; i++) { label[i] = min(dist[V[i]], dist[U[i]]) % 3; } } void solve2() { } vector<int> solve(int N, int M, int AA, int BB, vector<int>UU, vector<int>VV) { n = N, m = M, A = AA, B = BB; U = UU, V = VV; label.resize(m); for (int i = 0; i < m; i++) { adj[U[i]].pb(V[i]); adj[V[i]].pb(U[i]); } if (A >= 3) { solve1(); } else { solve2(); } return label; } } // namespace vector<int>Mark(int N, int M, int A, int B, vector<int>U, vector<int>V) { return solve(N, M, A, B, U, V); }
#include "Catherine.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define x first #define y second #define all(a) a.begin(), a.end() #define sz(a) (int)a.size() #define rd() abs((int)rng()) typedef long long ll; typedef long double ld; typedef pair<int, int>pii; const int maxn = 2e4 + 100; const int mod = 1e9 + 7; namespace { int A, B; int variable_example = 0; } // namespace void Init(int A, int B) { ::A = A; ::B = B; } int Move(vector<int> y) { if (A >= 3) { for (int i = 0; i < 3; i++) { if (y[i] > 0 && y[(i + 1) % 3] > 0) { return i; } } for (int i = 0; i < 3; i++) { if (y[i] > 0) { return i; } } return -1; } else { } }

Compilation message (stderr)

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:44:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
Catherine.cpp: At global scope:
Catherine.cpp:19:6: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
  int variable_example = 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...