| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1001672 | vjudge1 | Detecting Molecules (IOI16_molecules) | C++17 | 1 ms | 604 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include<bits/stdc++.h>
#pragma GCC optimize("-O3")
#define ll int
#define ld long double
#define vl vector<ll>
#define vi vector<int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define f first
#define s second
#define pb push_back
#define p_b pop_back
using namespace std;
vector<int> find_subset(int f, int u, vector<int> w) {
vi ans;
int cnt = 0, sum = 0;
for(int i = 0; i < w.size(); i++)
{
if(w[i] > u)
cnt++;
sum += w[i];
if(f <= w[i] && w[i] <= u)
{
ans.pb(i);
return ans;
}
}
if(cnt == (int)w.size() || sum < f)
return ans;
vector<pii>vect;
for(int i = 0; i < w.size(); i++)
vect.pb({w[i], i});
sort(all(vect));
for(int i = vect.size()-1; i >= 0; i--)
{
if(vect[i].f > u)
continue;
ans.pb(vect[i].s);
f -= vect[i].f;
u -= vect[i].f;
if(f <= 0)
break;
}
vl res;
if(f > 0)
return res;
reverse(all(ans));
return ans;
}
컴파일 시 표준 에러 (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... | ||||
