제출 #942363

#제출 시각아이디문제언어결과실행 시간메모리
942363Nika533Detecting Molecules (IOI16_molecules)C++14
69 / 100
36 ms6712 KiB
#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; const int N=3e5+5; 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 { if (pref[sz]>u) break; for (int i=0; i<=sz; i++) { if (pref[sz-i]+suf[n-i+1]>=l) { 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...