| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1219307 | LIA | Detecting Molecules (IOI16_molecules) | C++17 | 0 ms | 324 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef tuple <ll,ll,ll> plll;
typedef vector <plll> vplll;
typedef pair <ll,ll> pll;
typedef vector <ll> vll;
typedef vector <pll> vpll;
typedef vector <vector <pll>> vvpll;
typedef vector <vector <ll>> vvll;
typedef vector <bool> vb;
typedef vector <vector <bool>> vvb;
#define loop(i, s, e) for (ll i = (s); i < (e); ++i)
#define loopr(i, e, s) for (ll i = (e)-1; i >= (s); --i)
#define all(a) a.begin(), a.end()
const ll inf = 1e9 + 7;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
ll n = w.size();
ll sum = 0;
vpll v(n);
loop(i,0,n) v[i] = {w[i], i};
sort(all(v));
loop(i,0,n) {
if (v[i].first == l || v[i].first == u) return {(int)v[i].second};
}
for (auto [x,idx] : v) {
if (x>=l && x<=u) {
return {(int)idx};
}
else {
auto it = lower_bound(v.begin(), v.end(), make_pair(u - x, -inf));
if (it!= v.end()){
ll sec = it->second;
return {(int)idx, (int)sec};
}
}
}
return {};
}
컴파일 시 표준 에러 (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... | ||||
