Submission #315321

#TimeUsernameProblemLanguageResultExecution timeMemory
315321NintsiChkhaidzeCity (JOI17_city)C++14
8 / 100
230 ms43248 KiB
#include "Encoder.h" #include <bits/stdc++.h> #define n 250000 #define pb push_back using namespace std; int ind,in[n+5],out[n+5]; vector <int> v[n+5]; void dfs(int x,int pr){ in[x] = ++ind; for (int j = 0; j < v[x].size(); j++){ int to = v[x][j]; if (to == pr) continue; dfs(to,x); } out[x] = ind; } void Encode(int N, int A[], int B[]) { for (int i=0;i<N;i++) v[A[i]].pb(B[i]),v[B[i]].pb(A[i]); ind=-1; dfs(0,0); for (int i = 0; i < N; ++i) Code(i, in[i]*n + out[i]); }
#include "Device.h" #include <bits/stdc++.h> #define n 250000 using namespace std; void InitDevice(){ } int Answer(long long S, long long T){ int Sout = S%n,Tout = T%n,Sin = (S - Sout)/n,Tin = (T - Tout)/n; if (Sin < Tin && Sout >= Tout) return 1; else if (Tin < Sin && Tout >= Sout) return 0; else return 2; }

Compilation message (stderr)

Encoder.cpp: In function 'void dfs(int, int)':
Encoder.cpp:12:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for (int j = 0; j < v[x].size(); j++){
      |                     ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...