Submission #563905

#TimeUsernameProblemLanguageResultExecution timeMemory
563905blueCity (JOI17_city)C++17
Compilation error
0 ms0 KiB
#include "Encoder.h" #include <vector> #include <algorithm> using namespace std; namespace { using vi = vector<int>; using vvi = vector<vi>; #define sz(x) int(x.size()) const int mx = 250'000; using ll = long long; using vll = vector<ll>; int N; vi edge[mx]; vi children[mx]; vll code(mx, 0); void dfs(int u, int p) { int vct = 0; for(int v : edge[u]) { if(v == p) continue; children[u].push_back(v); vct++; } int vp = 0; while((1<<vp) < vct) vp++; int ci = -1; for(int v : children[u]) { ci++; code[v] = (code[u] << vp) + ci; dfs(v, u); } } } void Encode(int N_, int A[], int B[]) { N = N_; for(int e = 0; e < N-1; e++) { edge[A[e]].push_back(B[e]); edge[B[e]].push_back(A[e]); } code[0] = 1; dfs(0, -1); for(int i = 0; i < N; i++) Code(i, code[i]); }
#include "Device.h" #include <vector> using namespace std; namespace { using vi = vector<int>; using vvi = vector<vi>; #define sz(x) int(x.size()) } void InitDevice() { ; } int Answer(long long S, long long T) { vi sv, tv; while(S != 0) { sv.push_back(S & 1); S >>= 1; } while(T != 0) { tv.push_back(T & 1); T >>= 1; } reverse(sv.begin(), sv.end()); reverse(tv.begin(), tv.end()); for(int i = 0; i < min(sz(sv), sz(tv)); i++) { if(sv[i] != tv[i]) return 2; } if(sz(sv) > sz(tv)) return 0; else return 1; }

Compilation message (stderr)

Device.cpp: In function 'int Answer(long long int, long long int)':
Device.cpp:33:2: error: 'reverse' was not declared in this scope
   33 |  reverse(sv.begin(), sv.end());
      |  ^~~~~~~