Submission #315322

#TimeUsernameProblemLanguageResultExecution timeMemory
315322NintsiChkhaidzeCity (JOI17_city)C++14
Compilation error
0 ms0 KiB
#include "Encoder.h"
#include <bits/stdc++.h>
#define n 250000
#define pb push_back
#define int long long
using namespace std;
 
int ind,in[n+5],out[n+5];
vector <ll> v[n+5];
 
void dfs(ll x,ll 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){
    long long 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:9:9: error: 'll' was not declared in this scope
    9 | vector <ll> v[n+5];
      |         ^~
Encoder.cpp:9:11: error: template argument 1 is invalid
    9 | vector <ll> v[n+5];
      |           ^
Encoder.cpp:9:11: error: template argument 2 is invalid
Encoder.cpp:11:10: error: variable or field 'dfs' declared void
   11 | void dfs(ll x,ll pr){
      |          ^~
Encoder.cpp:11:10: error: 'll' was not declared in this scope
Encoder.cpp:11:15: error: 'll' was not declared in this scope
   11 | void dfs(ll x,ll pr){
      |               ^~
Encoder.cpp: In function 'void Encode(long long int, long long int*, long long int*)':
Encoder.cpp:4:12: error: request for member 'push_back' in 'v[(*(A + ((sizetype)(((long unsigned int)i) * 8))))]', which is of non-class type 'int'
    4 | #define pb push_back
      |            ^~~~~~~~~
Encoder.cpp:25:17: note: in expansion of macro 'pb'
   25 |         v[A[i]].pb(B[i]),v[B[i]].pb(A[i]);
      |                 ^~
Encoder.cpp:4:12: error: request for member 'push_back' in 'v[(*(B + ((sizetype)(((long unsigned int)i) * 8))))]', which is of non-class type 'int'
    4 | #define pb push_back
      |            ^~~~~~~~~
Encoder.cpp:25:34: note: in expansion of macro 'pb'
   25 |         v[A[i]].pb(B[i]),v[B[i]].pb(A[i]);
      |                                  ^~
Encoder.cpp:27:5: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   27 |     dfs(0,0);
      |     ^~~
      |     ffs