제출 #410848

#제출 시각아이디문제언어결과실행 시간메모리
410848EJOI2019AndrewDetecting Molecules (IOI16_molecules)C++14
100 / 100
76 ms8220 KiB
#include <bits/stdc++.h> #include "molecules.h"; using namespace std; typedef long long ll; typedef pair <ll, int> pii; vector <int> find_subset (int l, int u, vector <int> w) { int n = w.size(); vector <pii> v; for (int i = 0; i < n; ++i) { v.push_back(pii(w[i], i)); } sort(v.begin(), v.end()); ll sum = 0; vector <int> r; for (int i = 0, j = 0; j < n; ++j) { sum += v[j].first; while (sum > u) { sum -= v[i++].first; } if (sum >= l) { for (int k = i; k <= j; ++k) { r.push_back(v[k].second); } break; } } return r; }

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

molecules.cpp:2:23: warning: extra tokens at end of #include directive
    2 | #include "molecules.h";
      |                       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...