제출 #206342

#제출 시각아이디문제언어결과실행 시간메모리
206342autumn_eelDetecting Molecules (IOI16_molecules)C++14
19 / 100
10 ms760 KiB
#include <bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) #include "molecules.h" using namespace std; std::vector<int> find_subset(int l, int u, std::vector<int> w) { bitset<500001>bit; bit[0]=1; rep(i,w.size()){ bit|=bit<<w[i]; } for(int i=l;i<=u;i++){ if(bit[i]==1){ int x=w.size(),y=i; vector<int>ans; while(x){ x--; if(y>=w[x]&&bit[y-w[x]]){ ans.push_back(x); y-=w[x]; } } assert(y==0); reverse(ans.begin(),ans.end()); return ans; } } return {}; }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:2:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define rep(i,n)for(int i=0;i<(n);i++)
                              ^
molecules.cpp:9:2: note: in expansion of macro 'rep'
  rep(i,w.size()){
  ^~~
#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...