제출 #553222

#제출 시각아이디문제언어결과실행 시간메모리
553222sandry24Detecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms292 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; #define pb push_back #define mp make_pair #define f first #define s second vi find_subset(int l, int u, vi w){ sort(w.begin(), w.end(), greater<int>()); ll sum = 0; int ind = 0; vector<int> visited(w.size()); while(ind != w.size()){ if(sum + w[ind] < l){ sum += w[l]; visited[ind] = 1; } ind++; } vi ans; for(int i = w.size()-1; i >= 0; i--){ if(!visited[i]){ sum += w[i]; visited[ind] = 1; break; } } if(sum >= l && sum <= u){ for(int i = 0; i < w.size(); i++){ if(visited[i]) ans.pb(i); } } return ans; }

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

molecules.cpp: In function 'vi find_subset(int, int, vi)':
molecules.cpp:17:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     while(ind != w.size()){
      |           ~~~~^~~~~~~~~~~
molecules.cpp:33:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |         for(int i = 0; i < w.size(); i++){
      |                        ~~^~~~~~~~~~
#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...