이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC diagnostic warning "-std=c++11"
#include <bits/stdc++.h>
#include "molecules.h"
#define pb push_back
#define f first
#define s second
#define MOD 1000000007
#define flush fflush(stdout)
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define pii pair<int,int>
using namespace std;
int n,T,k;
vector<int> find_subset(int l, int u, vector<int> W) {
vector<int> v;
n=W.size();
pii arr[n+1];
int pref[n+1],suf[n+2]; pref[0]=0; suf[n+1]=0;
for (int i=1; i<=n; i++) {
arr[i].f=W[i-1];
arr[i].s=i-1;
}
sort(arr+1,arr+n+1);
for (int i=1; i<=n; i++) {
pref[i]=pref[i-1]+arr[i].f;
}
for (int i=n; i>=1; i--) {
suf[i]=suf[i+1]+arr[i].f;
}
for (int sz=1; sz<=n; sz++) {
if (suf[n-sz+1]<l) continue;
else {
for (int i=0; i<=sz; i++) {
if (pref[sz-i]+suf[n-i+1]>=l && pref[sz-i]+suf[n-i+1]<=u) {
for (int j=1; j<=sz-i; j++) v.pb(arr[j].s);
for (int j=n-i+1; j<=n; j++) v.pb(arr[j].s);
return v;
}
}
break;
}
}
return v;
}
컴파일 시 표준 에러 (stderr) 메시지
molecules.cpp:1:32: warning: '-std=c++11' is not an option that controls warnings [-Wpragmas]
1 | #pragma GCC diagnostic warning "-std=c++11"
| ^~~~~~~~~~~~
# | 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... |