Submission #415865

#TimeUsernameProblemLanguageResultExecution timeMemory
415865abdzagCarnival Tickets (IOI20_tickets)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "tickets.h" #define rep(i,a,b) for(int i=int(a);i<int(b);i++) #define rrep(i,a,b) for(int i=int(a);i>int(b);i--) #define trav(a,v) for(auto& a: v) #define sz(v) v.size() #define all(v) v.begin(),v.end() #define vi vector<int> typedef long long ll; typedef long double ld; typedef unsigned long long ull; const long long inf = 1e15; using namespace std; vector<bool> visited(1e6); vector<vector<ll>> g; vector<ll> v; ll curr = 0; bool done = 1; long long find_maximum(int k, std::vector<std::vector<int>> x) { vector<ll> v; rep(i, x.size())v.push_back(x[i][0]); sort(all(v)); ll b = v[v.size() / 2]; ll ans = 0; std::vector<std::vector<int>> answer(x.size()); rep(i, 0, x.size())answer[i].push_back(0); trav(a, v)ans += abs(a - b); allocate_tickets(answer); return ans; }

Compilation message (stderr)

tickets.cpp:24:17: error: macro "rep" requires 3 arguments, but only 2 given
   24 |  rep(i, x.size())v.push_back(x[i][0]);
      |                 ^
tickets.cpp:3: note: macro "rep" defined here
    3 | #define rep(i,a,b) for(int i=int(a);i<int(b);i++)
      | 
tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:24:2: error: 'rep' was not declared in this scope
   24 |  rep(i, x.size())v.push_back(x[i][0]);
      |  ^~~