| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1317924 | _unknown_2010 | Detecting Molecules (IOI16_molecules) | C++20 | 1 ms | 332 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
#define vi vector
// #define int long long
#define all(x) (x).begin(), (x).end()
mt19937 rng(363636);
vector<int> find_subset(int l, int u, vector<int> w) {
vi<pair<int,int>> v;
for(int i=0; i<w.size(); i++){
v.push_back({w[i], i});
}
sort(all(v));
int n=w.size(), thre=40;
for(int _=0; _<100; _++){
for(int i=0; i<n; i+=thre){
int r=min(n-1, i+thre-1);
shuffle(v.begin()+i, v.begin()+r+1, rng);
}
int sum=0;
vi<int> ans;
for(int i=0; i<n; i++){
sum+=v[i].first;
ans.push_back(v[i].second);
if(sum>=l && sum<=u){
return ans;
}
}
}
return vi<int>{};
}
컴파일 시 표준 에러 (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... | ||||
