답안 #206353

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
206353 2020-03-03T03:52:15 Z autumn_eel Detecting Molecules (IOI16_molecules) C++14
9 / 100
5 ms 504 KB
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#include "molecules.h"
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

std::vector<int> find_subset(int l, int u, std::vector<int> w) {
	vector<P>v;
	rep(i,w.size())v.push_back(P(w[i],i));
	sort(v.begin(),v.end(),greater<>());
	ll sum=0;
	vector<int>ans;
	for(auto p:v){
		sum+=p.first;
		ans.push_back(p.second);
		if(l<=sum&&sum<=u){
			return ans;
		}
	}
	return {};
}

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:2:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define rep(i,n)for(int i=0;i<(n);i++)
                              ^
molecules.cpp:10:2: note: in expansion of macro 'rep'
  rep(i,w.size())v.push_back(P(w[i],i));
  ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB OK (n = 1, answer = NO)
2 Correct 5 ms 376 KB OK (n = 1, answer = NO)
3 Correct 5 ms 256 KB OK (n = 1, answer = YES)
4 Correct 5 ms 256 KB OK (n = 2, answer = YES)
5 Correct 5 ms 256 KB OK (n = 2, answer = YES)
6 Correct 4 ms 256 KB OK (n = 3, answer = YES)
7 Correct 5 ms 376 KB OK (n = 3, answer = YES)
8 Correct 5 ms 376 KB OK (n = 3, answer = YES)
9 Correct 5 ms 376 KB OK (n = 3, answer = YES)
10 Correct 5 ms 256 KB OK (n = 3, answer = YES)
11 Correct 5 ms 256 KB OK (n = 3, answer = YES)
12 Correct 5 ms 256 KB OK (n = 3, answer = YES)
13 Correct 5 ms 256 KB OK (n = 3, answer = NO)
14 Correct 5 ms 256 KB OK (n = 3, answer = YES)
15 Correct 5 ms 504 KB OK (n = 3, answer = YES)
16 Correct 5 ms 256 KB OK (n = 3, answer = NO)
17 Correct 5 ms 280 KB OK (n = 3, answer = NO)
18 Correct 5 ms 256 KB OK (n = 100, answer = NO)
19 Correct 5 ms 376 KB OK (n = 100, answer = YES)
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 256 KB Contestant can not find answer, jury can
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB OK (n = 1, answer = NO)
2 Correct 5 ms 376 KB OK (n = 1, answer = NO)
3 Correct 5 ms 256 KB OK (n = 1, answer = YES)
4 Correct 5 ms 256 KB OK (n = 2, answer = YES)
5 Correct 5 ms 256 KB OK (n = 2, answer = YES)
6 Correct 4 ms 256 KB OK (n = 3, answer = YES)
7 Correct 5 ms 376 KB OK (n = 3, answer = YES)
8 Correct 5 ms 376 KB OK (n = 3, answer = YES)
9 Correct 5 ms 376 KB OK (n = 3, answer = YES)
10 Correct 5 ms 256 KB OK (n = 3, answer = YES)
11 Correct 5 ms 256 KB OK (n = 3, answer = YES)
12 Correct 5 ms 256 KB OK (n = 3, answer = YES)
13 Correct 5 ms 256 KB OK (n = 3, answer = NO)
14 Correct 5 ms 256 KB OK (n = 3, answer = YES)
15 Correct 5 ms 504 KB OK (n = 3, answer = YES)
16 Correct 5 ms 256 KB OK (n = 3, answer = NO)
17 Correct 5 ms 280 KB OK (n = 3, answer = NO)
18 Correct 5 ms 256 KB OK (n = 100, answer = NO)
19 Correct 5 ms 376 KB OK (n = 100, answer = YES)
20 Incorrect 5 ms 256 KB Contestant can not find answer, jury can
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB OK (n = 1, answer = NO)
2 Correct 5 ms 376 KB OK (n = 1, answer = NO)
3 Correct 5 ms 256 KB OK (n = 1, answer = YES)
4 Correct 5 ms 256 KB OK (n = 2, answer = YES)
5 Correct 5 ms 256 KB OK (n = 2, answer = YES)
6 Correct 4 ms 256 KB OK (n = 3, answer = YES)
7 Correct 5 ms 376 KB OK (n = 3, answer = YES)
8 Correct 5 ms 376 KB OK (n = 3, answer = YES)
9 Correct 5 ms 376 KB OK (n = 3, answer = YES)
10 Correct 5 ms 256 KB OK (n = 3, answer = YES)
11 Correct 5 ms 256 KB OK (n = 3, answer = YES)
12 Correct 5 ms 256 KB OK (n = 3, answer = YES)
13 Correct 5 ms 256 KB OK (n = 3, answer = NO)
14 Correct 5 ms 256 KB OK (n = 3, answer = YES)
15 Correct 5 ms 504 KB OK (n = 3, answer = YES)
16 Correct 5 ms 256 KB OK (n = 3, answer = NO)
17 Correct 5 ms 280 KB OK (n = 3, answer = NO)
18 Correct 5 ms 256 KB OK (n = 100, answer = NO)
19 Correct 5 ms 376 KB OK (n = 100, answer = YES)
20 Incorrect 5 ms 256 KB Contestant can not find answer, jury can
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB OK (n = 1, answer = NO)
2 Correct 5 ms 376 KB OK (n = 1, answer = NO)
3 Correct 5 ms 256 KB OK (n = 1, answer = YES)
4 Correct 5 ms 256 KB OK (n = 2, answer = YES)
5 Correct 5 ms 256 KB OK (n = 2, answer = YES)
6 Correct 4 ms 256 KB OK (n = 3, answer = YES)
7 Correct 5 ms 376 KB OK (n = 3, answer = YES)
8 Correct 5 ms 376 KB OK (n = 3, answer = YES)
9 Correct 5 ms 376 KB OK (n = 3, answer = YES)
10 Correct 5 ms 256 KB OK (n = 3, answer = YES)
11 Correct 5 ms 256 KB OK (n = 3, answer = YES)
12 Correct 5 ms 256 KB OK (n = 3, answer = YES)
13 Correct 5 ms 256 KB OK (n = 3, answer = NO)
14 Correct 5 ms 256 KB OK (n = 3, answer = YES)
15 Correct 5 ms 504 KB OK (n = 3, answer = YES)
16 Correct 5 ms 256 KB OK (n = 3, answer = NO)
17 Correct 5 ms 280 KB OK (n = 3, answer = NO)
18 Correct 5 ms 256 KB OK (n = 100, answer = NO)
19 Correct 5 ms 376 KB OK (n = 100, answer = YES)
20 Incorrect 5 ms 256 KB Contestant can not find answer, jury can
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB OK (n = 1, answer = NO)
2 Correct 5 ms 376 KB OK (n = 1, answer = NO)
3 Correct 5 ms 256 KB OK (n = 1, answer = YES)
4 Correct 5 ms 256 KB OK (n = 2, answer = YES)
5 Correct 5 ms 256 KB OK (n = 2, answer = YES)
6 Correct 4 ms 256 KB OK (n = 3, answer = YES)
7 Correct 5 ms 376 KB OK (n = 3, answer = YES)
8 Correct 5 ms 376 KB OK (n = 3, answer = YES)
9 Correct 5 ms 376 KB OK (n = 3, answer = YES)
10 Correct 5 ms 256 KB OK (n = 3, answer = YES)
11 Correct 5 ms 256 KB OK (n = 3, answer = YES)
12 Correct 5 ms 256 KB OK (n = 3, answer = YES)
13 Correct 5 ms 256 KB OK (n = 3, answer = NO)
14 Correct 5 ms 256 KB OK (n = 3, answer = YES)
15 Correct 5 ms 504 KB OK (n = 3, answer = YES)
16 Correct 5 ms 256 KB OK (n = 3, answer = NO)
17 Correct 5 ms 280 KB OK (n = 3, answer = NO)
18 Correct 5 ms 256 KB OK (n = 100, answer = NO)
19 Correct 5 ms 376 KB OK (n = 100, answer = YES)
20 Incorrect 5 ms 256 KB Contestant can not find answer, jury can
21 Halted 0 ms 0 KB -