| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1319051 | tkm_algorithms | Detecting Molecules (IOI16_molecules) | C++20 | 0 ms | 332 KiB |
#include <bits/stdc++.h>
#include "molecules.h"
using namespace std;
using ll = long long;
//#define int ll
using P = pair<int, int>;
#define all(x) x.begin(), x.end()
#define rep(i, l, n) for (int i = l; i < (n); ++i)
#define sz(x) (int)x.size()
const char nl = '\n';
const int mod = 1e9+7;
vector<int> find_subset(int l, int u, vector<int> w) {
sort(all(w));
int sm = 0;
vector<int> res;
for (int i = sz(w)-1; i >= 0; --i) {
sm += w[i];
res.push_back(i);
if (sm >= l)break;
}
if (sm >= l && sm <= u)return res;
res.erase(res.begin());
if (res.back() == 0)return {};
sm = sm-w.back()+w[0];
if (sm < l || sm>u)return {};
res.push_back(0);
return res;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
