답안 #318438

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
318438 2020-11-01T20:00:10 Z study Detecting Molecules (IOI16_molecules) C++17
0 / 100
0 ms 364 KB
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;

vector<int> find_subset(int l, int u, vector<int> v) {
  	vector<int> ans;
	vector<pair<int,int>> v2;
	for (int i=0; i<v.size(); ++i){
		v2.emplace_back(v[i],i);
	}
	sort(v2.rbegin(),v2.rend());
	for (auto i:v2){
		if (u-i.first >= 0){
			u -= i.first;
			ans.emplace_back(i.second);
		}
	}
	if (!ans.empty()) return ans;
	return vector<int>(0);
}

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:8:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |  for (int i=0; i<v.size(); ++i){
      |                ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 364 KB sum of weights should be in [10..12] but it is 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 364 KB sum of weights should be in [302..304] but it is 255
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 364 KB sum of weights should be in [10..12] but it is 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 364 KB sum of weights should be in [10..12] but it is 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 364 KB sum of weights should be in [10..12] but it is 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 364 KB sum of weights should be in [10..12] but it is 9
2 Halted 0 ms 0 KB -