Submission #921508

#TimeUsernameProblemLanguageResultExecution timeMemory
9215081075508020060209tcMeetings (JOI19_meetings)C++14
Compilation error
0 ms0 KiB
#pragma GCC optimize("O3") #include "meetings.h" #include<bits/stdc++.h> using namespace std; //#define int long long #define X first #define Y second #define SZ(x) (int)(x).size() map<vector<int>,int>mp; int n; void query(int a,int b,int c){ vector<int>vc={a,b,c}; sort(vc.begin(),vc.end()); if(mp[vc]){return mp[vc];} mp[vc]=Query(vc[0],vc[1],vc[2]); return mp[vc]; } pair<int,int>slv(int st,int en){ int ret=en; for(int i=1;i<=n;i++){ if(i==st||i==ret){continue;} int v=query(st-1,i-1,ret-1); //v++; if(v==st||v==ret){continue;} ret=v; } return {min(st,ret)-1,max(st,ret)-1}; } void Solve(int N){ set<pair<int,int>>ans; n=N; for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ ans.insert(slv(i,j)); } } for(auto it=ans.begin();it!=ans.end();it++){ Bridge((*it).first, (*it).second ); } } /* signed main(){ } */

Compilation message (stderr)

meetings.cpp: In function 'void query(int, int, int)':
meetings.cpp:14:24: error: return-statement with a value, in function returning 'void' [-fpermissive]
   14 | if(mp[vc]){return mp[vc];}
      |                        ^
meetings.cpp:16:13: error: return-statement with a value, in function returning 'void' [-fpermissive]
   16 | return mp[vc];
      |             ^
meetings.cpp: In function 'std::pair<int, int> slv(int, int)':
meetings.cpp:23:16: error: void value not ignored as it ought to be
   23 |     int v=query(st-1,i-1,ret-1);
      |           ~~~~~^~~~~~~~~~~~~~~~