제출 #963186

#제출 시각아이디문제언어결과실행 시간메모리
963186maxFedorchukDetecting Molecules (IOI16_molecules)C++17
69 / 100
37 ms5584 KiB
#include <bits/stdc++.h> using namespace std; #include "molecules.h" vector<int> find_subset(const int l,const int u,const vector<int> w) { vector < pair < int ,int > > mas; vector < int > ans; for(int i=0;i<w.size();i++) { mas.push_back({w[i],i}); } sort(mas.begin(),mas.end()); for(int sum=0,ru=0,lu=0;ru<w.size();ru++) { sum+=mas[ru].first; while(sum>u) { sum-=mas[lu].first; lu++; } if(sum>=l) { for(int j=lu;j<=ru;j++) { ans.push_back(mas[j].second); } break; } } return ans; }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:11:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int i=0;i<w.size();i++)
      |                 ~^~~~~~~~~
molecules.cpp:18:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |     for(int sum=0,ru=0,lu=0;ru<w.size();ru++)
      |                             ~~^~~~~~~~~
#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...