제출 #403281

#제출 시각아이디문제언어결과실행 시간메모리
403281Leonardo_PaesDetecting Molecules (IOI16_molecules)C++17
9 / 100
1 ms224 KiB
#include <bits/stdc++.h> using namespace std; vector<int> find_subset(int ll, int u, vector<int> v){ vector<int> ans; sort(v.begin(), v.end()); int l = 0, r = 0, sum = v[0]; while(l < v.size()){ if(ll <= sum and sum <= u) break; if(sum < ll) sum += v[++r]; else if(sum > ll) sum -= v[l++]; } if(sum < ll or sum > u) return ans; while(l <= r) ans.push_back(l++); return ans; }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:8:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     while(l < v.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...