| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1226730 | Jer | Detecting Molecules (IOI16_molecules) | C++20 | 1 ms | 328 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w)
{
int a = INT_MAX, b = 0;
int c1 = 0, c2 = 0;
for (auto i : w)
a = min(a, i), b = max(b, i);
if (a == b)
b = -1;
for (auto i : w)
c1 += (i == a), c2 += (i == b);
int o1 = c1, o2 = c2, sum = 0;
while ((sum + a <= l or sum + a <= u) and c1 > 0)
sum += a, c1--;
while ((sum + b <= l or sum + b <= u) and c2 > 0)
sum += b, c2--;
while (sum <= l and c2 > 0)
sum++, c2--, c1++;
if (sum < l)
return {};
vector<int> res;
for (int i = 0; i < w.size(); i++)
{
if (o1 > c1 and w[i] == a)
res.push_back(i), o1--;
if (o2 > c2 and w[i] == b)
res.push_back(i), o2--;
}
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... | ||||
