| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1106437 | SonicML | Detecting Molecules (IOI16_molecules) | C++14 | 42 ms | 5712 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <vector>
#include <algorithm>
#include "molecules.h"
using namespace std;
int const NMAX = 2e5;
int arr[1 + NMAX];
int ind[1 + NMAX];
bool compareIndex(int a, int b) {
return (arr[a] < arr[b]);
}
vector <int> find_subset(int l, int u, vector<int> w) {
vector <int> result;
int n = w.size();
for(int i = 0;i < w.size();i++) {
ind[i] = i;
arr[i] = w[i];
}
sort(ind, ind+n, compareIndex);
int from = 0;
long long sum = 0;
bool foundSol = false;
for(int to = 0;to < n && !foundSol;to++) {
sum += arr[ind[to]];
while(sum > u) {
sum -= arr[ind[from]];
from++;
}
if(l <= sum && sum <= u) {
foundSol = true;
for(int i = from;i <= to;i++) {
result.push_back(ind[i]);
}
}
}
return result;
}
컴파일 시 표준 에러 (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... | ||||
