제출 #999331

#제출 시각아이디문제언어결과실행 시간메모리
999331vuhDetecting Molecules (IOI16_molecules)C++14
0 / 100
1068 ms348 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; #define inf INT_MAX std::vector<int> find_subset(int l, int u, std::vector<int> w){ int n = w.size(),mini = inf,maxi = -inf,x = u - l,sum = 0; for(int i =0;i<n ;i++){ mini = min(mini,w[i]); maxi = max(maxi,w[i]); sum += w[i]; } vector <int> ans; if(maxi - mini > x){ return vector <int> (0); } while(!next_permutation(w.begin(),w.end())){ for(int i =0;i<n ;i++){ sum = 0; for(int j =0;j<=i ;j++){ sum += w[i]; } if((sum >= l && sum <= u) || (sum <= l && sum >= u)){ for(int j =0;j<=i ;j++){ ans.push_back(w[i]); } return ans; } } } }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:13:18: warning: control reaches end of non-void function [-Wreturn-type]
   13 |     vector <int> ans;
      |                  ^~~
#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...