제출 #403294

#제출 시각아이디문제언어결과실행 시간메모리
403294Leonardo_PaesDetecting Molecules (IOI16_molecules)C++17
69 / 100
48 ms3420 KiB
#include <bits/stdc++.h> using namespace std; #define f first #define s second vector<int> find_subset(int ll, int u, vector<int> w){ vector<int> ans; vector<pair<int,int>> v(w.size()); for(int i=0; i<v.size(); i++) v[i] = {w[i], i}; sort(v.begin(), v.end()); int l = 0, sum = 0; for(int r=0; r<v.size(); r++){ sum += v[r].f; while(sum > u) sum -= v[l++].f; if(ll <= sum and sum <= u){ while(l <= r) ans.push_back(v[l++].s); break; } } return ans; }

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

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