제출 #432508

#제출 시각아이디문제언어결과실행 시간메모리
432508MarcoMeijerDetecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; // macros typedef long long ll; typedef long double ld; typedef pair<int, int> ii; typedef pair<ll, ll> lll; typedef tuple<int, int, int> iii; typedef vector<int> vi; typedef vector<ii> vii; typedef vector<iii> viii; typedef vector<ll> vll; typedef vector<lll> vlll; #define REP(a,b,c) for(int a=int(b); a<int(c); a++) #define RE(a,c) REP(a,0,c) #define RE1(a,c) REP(a,1,c+1) #define REI(a,b,c) REP(a,b,c+1) #define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--) #define FOR(a,b) for(auto& a : b) #define all(a) a.begin(), a.end() #define INF 1e9 #define EPS 1e-9 #define pb push_back #define popb pop_back #define fi first #define se second #define sz size() mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); vi find_subset(int l, int u, vi w) { sort(all(w)); REP(j,w.size()) { ll total = 0; vi ans; REP(i,j,w.size()) { total += w[i]; ans.pb(i); if(total >= l && total <= u) return ans; } } return {}; }

컴파일 시 표준 에러 (stderr) 메시지

molecules.cpp:34:19: error: macro "REP" requires 3 arguments, but only 2 given
   34 |     REP(j,w.size()) {
      |                   ^
molecules.cpp:16: note: macro "REP" defined here
   16 | #define REP(a,b,c) for(int a=int(b); a<int(c); a++)
      | 
molecules.cpp: In function 'vi find_subset(int, int, vi)':
molecules.cpp:34:5: error: 'REP' was not declared in this scope
   34 |     REP(j,w.size()) {
      |     ^~~