Submission #974063

#TimeUsernameProblemLanguageResultExecution timeMemory
974063Ooops_sorryStray Cat (JOI20_stray)C++14
11 / 100
40 ms28420 KiB
#ifndef LOCAL #include "Anthony.h" #endif #include<iostream> #include<deque> #include<algorithm> #include<vector> #include<map> #include<random> #include<time.h> #include<cassert> #include<chrono> #include<set> #include<unordered_set> #include<array> using namespace std; #define ull unsigned long long #define pb push_back #define ll long long #define all(a) a.begin(), a.end() #define ld long double mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count()); const int N = 2e4 + 10; vector<pair<int, int>> g[N]; vector<int> Mark(int n, int m, int a, int b, vector<int> u, vector<int> v) { for (int i = 0; i < m; i++) { g[u[i]].pb({v[i], i}); g[v[i]].pb({u[i], i}); } if (a == 3) { vector<int> d(n, -1); d[0] = 0; deque<int> q{0}; while (q.size() > 0) { int v = q.front(); q.pop_front(); for (auto [u, i] : g[v]) { if (d[u] == -1) { d[u] = d[v] + 1; q.pb(u); } } } vector<int> ans(m, -1); for (int v = 0; v < n; v++) { for (auto [u, i] : g[v]) { if (d[u] == d[v]) { ans[i] = d[u] % 3; } else { ans[i] = min(d[u], d[v]) % 3; } } } return ans; } }
#ifndef LOCAL #include "Catherine.h" #endif #include<iostream> #include<deque> #include<algorithm> #include<vector> #include<map> #include<random> #include<time.h> #include<cassert> #include<chrono> #include<set> #include<unordered_set> #include<array> using namespace std; #define ull unsigned long long #define pb push_back #define ll long long #define all(a) a.begin(), a.end() #define ld long double mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count()); int A, B; void Init(int A_, int B_) { A = A_; B = B_; } int Move(std::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; } } } assert(0); }

Compilation message (stderr)

Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:42:17: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   42 |       for (auto [u, i] : g[v]) {
      |                 ^
Anthony.cpp:51:17: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   51 |       for (auto [u, i] : g[v]) {
      |                 ^
Anthony.cpp:61:1: warning: control reaches end of non-void function [-Wreturn-type]
   61 | }
      | ^
#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...