# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1262312 | califrastico_09 | Detecting Molecules (IOI16_molecules) | C++20 | 33 ms | 3756 KiB |
#include "molecules.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w){
long long k=0, f=0; int n=w.size(); vector<int> o; bool sp=true;
for(int i=0; i<n; i++){if(w[i]!=w[0])sp=false;}
if(!sp)
{
long long y=0, l1=0, r1=0; vector<int> g; vector<pair<int, int>> a(n);
for(int i=0; i<n; i++){a[i].first=w[i]; a[i].second=i;} sort(a.begin(), a.end());
bool t=false;
while(r1<n)
{
y+=a[r1].first; r1++;
while(y>u&&l1<r1)
{y-=a[l1].first; l1++;} if(y>=l&&y<=u){t=true;break;}
}
if(t)for(int i=l1; i<r1; i++) g.push_back(a[i].second);
return g;
}
else
{
for(long long i=1; i<=n; i++)
{
if(w[0]*i>=l&&w[0]*i<=u){f=i; break;}
}
for(long long i=0; i<f; i++)o.push_back(i);
return o;
}
}
컴파일 시 표준 에러 (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... |