제출 #419043

#제출 시각아이디문제언어결과실행 시간메모리
419043BlagojceDetecting Molecules (IOI16_molecules)C++11
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define fr(i, n, m) for(int i = (n); i < (m); i ++) #define pb push_back #define st first #define nd second #define pq priority_queue #define all(x) begin(x), end(x) using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const ll inf = 1e18; const int i_inf = 1e9; const ll mod = 1e9+7; mt19937 _rand(time(NULL)); const int mxn = 1e5+5; #include "molecules.h" std::vector<int> find_subset(int l, int r, std::vector<int> w){ if(l == 0) return std::vector<int>(0); /*vector<pii> v; int n = (int)w.size(); fr(i, 0, n) v.pb({w[i], i}); sort(all(v)); fr(i, 0, n){ ll s = 0; vector<int> pot; fr(j, i, n){ pot.pb(v[j].nd); s += v[j].st; if(l <= s && s <= r){ return pot; } } } return std::vector<int>(0);*/ int n = (int)w.size(); sort(all(w)); int lp = 0; int rp = 0; ll sum = 0; while(rp < n && sum < l){ sum += v[rp++].st; while(lp < rp && sum > r){ sum -= v[lp++].st; } } if(l <= sum && sum <= r){ vector<int> sol; while(lp < rp) sol.pb(v[lp++].nd); return sol; } return std::vector<int>(0);*/ }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:50:10: error: 'v' was not declared in this scope
   50 |   sum += v[rp++].st;
      |          ^
molecules.cpp:57:25: error: 'v' was not declared in this scope
   57 |   while(lp < rp) sol.pb(v[lp++].nd);
      |                         ^
molecules.cpp:62:30: error: expected primary-expression before '/' token
   62 |  return std::vector<int>(0);*/
      |                              ^
molecules.cpp:63:1: error: expected primary-expression before '}' token
   63 | }
      | ^