# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1273873 | almaz | Detecting Molecules (IOI16_molecules) | C++20 | 2 ms | 348 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
// #define int long long
// #define endl '\n'
#define ff first
#define ss second
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ar array
const int MOD = 1e9 + 7,INF = 1e9, N = 2e5 + 5;
vector<int> find_subset(int x, int y, vector<int> w) {
sort(all(w));
int n = w.size();
vector <int> ans;
int sum = w[0];
int l = 0, r = 0;
while(l < n && r < n){
if(x <= sum && sum <= y){
for(int i = l;i <= r;i++){
ans.pb(i);
}
return ans;
}
else if(sum < x){
r++;
sum += w[r];
}
else{
sum -= w[l];
l++;
}
}
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... |