Submission #1258127

#TimeUsernameProblemLanguageResultExecution timeMemory
1258127garam1732Festival (IOI25_festival)C++20
Compilation error
0 ms0 KiB
#include "festival.h" #include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define bl ' ' #define endl '\n' #define all(v) (v).begin(), (v).end() #define comp(v) (v).erase(unique(all(v)), (v).end()) #define lbd(v,x) lower_bound(all(v), (x))-(v).begin() #define ubd(v,x) upper_bound(all(v), (x))-(v).begin() typedef long long ll; typedef pair<int, int> pi; typedef pair<pi, int> pii; typedef pair<int, pi> ipi; typedef pair<pi, pi> pipi; typedef pair<ll, ll> pll; const int MAXN = 100100*2; const ll MOD = 1e9+7; const ll INF = 1e9+10; struct Garam { ll p, t, n; bool operator < (const Garam& x) const { if((t==1)^(x.t==1)) return x.t==1; if(t==1) return p<x.p; return p*t*(x.t-1) < x.p*x.t*(t-1); } } arr[MAXN]; vector<int> res; std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) { int n = P.size(); for(int i=0; i<n; i++) arr[i] = {P[i],T[i], i}; sort(arr, arr+n); for(int i=0;i<n;i++) res.push_back(arr[i].n);

Compilation message (stderr)

festival.cpp: In function 'std::vector<int> max_coupons(int, std::vector<int>, std::vector<int>)':
festival.cpp:41:50: error: expected '}' at end of input
   41 |     for(int i=0;i<n;i++) res.push_back(arr[i].n);
      |                                                  ^
festival.cpp:36:77: note: to match this '{'
   36 | std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) {
      |                                                                             ^
festival.cpp:41:50: warning: no return statement in function returning non-void [-Wreturn-type]
   41 |     for(int i=0;i<n;i++) res.push_back(arr[i].n);
      |                                                  ^