제출 #882186

#제출 시각아이디문제언어결과실행 시간메모리
882186AndreiBOTODetecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms440 KiB
#include <bits/stdc++.h> #pragma optimize GCC ("Ofast") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") ///#include <tryhardmode> ///#include <GODMODE::ON> using namespace std; vector<int>find_subset(int l,int u,vector<int>w) { int n,i,j,kon=0; n=w.size(); vector<pair<int,int>>a; vector<int>ans; for(i=0;i<n;i++) a.push_back(make_pair(w[i],i)); sort(a.begin(),a.end()); int left=0,right=0; while(right<n) { kon+=a[right].first; if(kon<l) right++; else { if(kon>u) { kon-=a[left].first; left++; right++; } if(kon>=l && kon<=u) { for(i=left;i<right;i++) ans.push_back(a[i].second); return ans; } } } return ans; } /*int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); vector<int>a; vector<int>w; int n,i,st,dr; cin>>n; cin>>st>>dr; for(i=0;i<n;i++) { int x; cin>>x; w.push_back(x); } a=find_subset(st,dr,w); for(auto i:a) cout<<i<<" "; return 0; }*/

컴파일 시 표준 에러 (stderr) 메시지

molecules.cpp:3: warning: ignoring '#pragma optimize GCC' [-Wunknown-pragmas]
    3 | #pragma optimize GCC ("Ofast")
      | 
molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:14:13: warning: unused variable 'j' [-Wunused-variable]
   14 |     int n,i,j,kon=0;
      |             ^
#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...