제출 #810797

#제출 시각아이디문제언어결과실행 시간메모리
810797wortelwormDetecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms428 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; std::vector<int> find_subset(int lower, int upper, std::vector<int> w) { ll sum = 0; vector<int> answer; for (int i = w.size() - 1; i >= 0; i--) { sum += w[i]; answer.push_back(i); if (sum >= lower) { if (sum > upper) { return {}; } return answer; } } }

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

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