Submission #195568

#TimeUsernameProblemLanguageResultExecution timeMemory
195568theStaticMindMeetings (JOI19_meetings)C++14
Compilation error
0 ms0 KiB
#include "meetings.h" #define pb push_back #define ii pair<int,int> #define all(x) (x).begin(),(x).end() #define INF 100000000000000000 #define modulo 1000000007 #define mod 998244353 #define int long long int using namespace std; void dp(vector<int> data,int curr){ if(data.empty())return; int big=data[0]; vector<int>sub,other; sub.pb(big); for(int i=1;i<data.size();i++){ if(data[i]==big)continue; int q=Query(big,curr,data[i]); if(q==curr)other.pb(data[i]); else{ sub.pb(data[i]); big=q; } } Bridge(curr,big); sub.erase(find(all(sub),big)); dp(sub,big); dp(other,curr); } void Solve(int N){ vector<int>arr(N); for(int i=1;i<N;i++)cin>>arr[i]; dp(arr,0); }

Compilation message (stderr)

meetings.cpp:10:9: error: variable or field 'dp' declared void
 void dp(vector<int> data,int curr){
         ^~~~~~
meetings.cpp:10:9: error: 'vector' was not declared in this scope
meetings.cpp:8:13: error: expected primary-expression before 'long'
 #define int long long int
             ^
meetings.cpp:10:16: note: in expansion of macro 'int'
 void dp(vector<int> data,int curr){
                ^~~
meetings.cpp:8:13: error: expected primary-expression before 'long'
 #define int long long int
             ^
meetings.cpp:10:26: note: in expansion of macro 'int'
 void dp(vector<int> data,int curr){
                          ^~~
meetings.cpp: In function 'void Solve(long long int)':
meetings.cpp:30:7: error: 'vector' was not declared in this scope
       vector<int>arr(N);
       ^~~~~~
meetings.cpp:8:13: error: expected primary-expression before 'long'
 #define int long long int
             ^
meetings.cpp:30:14: note: in expansion of macro 'int'
       vector<int>arr(N);
              ^~~
meetings.cpp:31:27: error: 'cin' was not declared in this scope
       for(int i=1;i<N;i++)cin>>arr[i];
                           ^~~
meetings.cpp:31:32: error: 'arr' was not declared in this scope
       for(int i=1;i<N;i++)cin>>arr[i];
                                ^~~
meetings.cpp:32:10: error: 'arr' was not declared in this scope
       dp(arr,0);
          ^~~
meetings.cpp:32:7: error: 'dp' was not declared in this scope
       dp(arr,0);
       ^~