Submission #596341

#TimeUsernameProblemLanguageResultExecution timeMemory
596341ibm2006Flights (JOI22_flights)C++17
Compilation error
0 ms0 KiB
#include "Ali.h" #include <string> #include <vector> #include<bits/stdc++.h> using namespace std; typedef int ll; ll n,i,h[110000]; vector<ll> v[110000]; void Init(int N,vector<int> U,vector<int> V) { n=N; for(i=0;i<(n-1);i++) { v[U[i]].push_back(V[i]); v[V[i]].push_back(U[i]); } for(i=0;i<n;i++) h[i]=v[i].size()-1; h[0]++; for(i=0;i<n;i++) SetID(i,i); } string s; string SendA(string S) { for(i=0;i<n;i++) { if(h[i]==0) s+="00"; else if(h[i]==1) s+="01"; else if(h[i]==2) s+="10"; else s+="11"; } return s; }
#include "Benjamin.h" #include <string> #include <vector> #include<bits/stdc++.h> using namespace std; typedef int ll; ll n,x,y,h[110000],t; vector<ll> v[110000]; string SendB(int N, int X, int Y) { n=N; x=X; y=Y; return "00000111110000011111"; } void f(ll x) { h[x]=(T[t]-'0')*2+T[t+1]-'0'; t+=2; ll i; for(i=0;i<h[x];i++) { v[x].push_back(t/2); f(t); } } ll g(ll z,ll w) { if(z==y) return 0; ll i,k; for(i=0;i<h[z];i++) { if(w==v[z][i]) continue; k=g(v[z][i],z); if(k!=-1) return k+1; } return -1; } int Answer(string T) { f(0); return g(x,-1); }

Compilation message (stderr)

grader_ali.cpp:10:8: warning: '{anonymous}::_randmem' defined but not used [-Wunused-variable]
   10 |   char _randmem[12379];
      |        ^~~~~~~~

Benjamin.cpp: In function 'void f(ll)':
Benjamin.cpp:15:11: error: 'T' was not declared in this scope
   15 |     h[x]=(T[t]-'0')*2+T[t+1]-'0';
      |           ^