제출 #995681

#제출 시각아이디문제언어결과실행 시간메모리
995681kokoueDetecting Molecules (IOI16_molecules)C++14
0 / 100
168 ms65536 KiB
#include<bits/stdc++.h> using namespace std; set<long long> is; unordered_map<long long,long long> idx; vector<int> find_subset(int l,int u,vector<int> w) { int n=w.size(); is.insert(0); idx[0]=0; int sum=0; bool fl=0; for(int i=1;i<n;i++) { for(auto e:is) { is.insert(e+w[i]); idx[e+w[i]]=i; if(e+w[i]>=l && e+w[i]<=u) { sum=e+w[i]; fl=1; break; } } if(fl) break; } int h=0; vector<int> res; while(sum!=0) { res.push_back(idx[sum]); sum-=w[idx[sum]]; } return res; }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:27:9: warning: unused variable 'h' [-Wunused-variable]
   27 |     int h=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...