제출 #112311

#제출 시각아이디문제언어결과실행 시간메모리
112311ioilolcomDetecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; #define ll long long int std::vector<int> find_subset(int l, int u, std::vector<int> w) { sort(w.begin(),w.end()); vector<int> ans; int a=0; int r=0; int n=(int)w.size(); ll sum=0; while(r<n&&a<n) { sum+=w[r]; while(sum>u) { sum-=w[a] a++; } if(sum>=l&&sum<=u) { for(int i=a; i<=r; i++) { ans.push_back(w[i]); } } r++; } if(ans.size()) return ans; return std::vector<int>(0); }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:17:10: error: expected ';' before 'a'
          a++;
          ^