| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1289272 | hssaan_arif | Detecting Molecules (IOI16_molecules) | C++20 | 1 ms | 332 KiB |
#include <bits/stdc++.h>
#include "molecules.h"
using namespace std;
#define endl "\n"
#define pb push_back
// #define int long long
#define fi first
#define se second
const int N = 3e5 + 5, M = 1e9 + 7, LG = 20;
int n;
vector<int> find_subset(int l, int u, vector<int> w) {
int su = 0 , ls = w.size()-1;
vector<int> ans;
sort(w.rbegin(),w.rend());
for (int i=0 ; i <w.size() ; i++){
su += w[i];
ans.pb(w[i]);
if (l <= su && su <= u){
return ans;
}
if (su > u){
int f = i+1;
while(f--){
su -= w[i];
ans.pop_back();
su += w[ls];
ans.pb(w[ls]);
i--;
ls--;
if (l <= su && su <= u){
return ans;
}
}
return vector<int>(0);
}
}
}
컴파일 시 표준 에러 (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... | ||||
