답안 #198119

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
198119 2020-01-24T18:19:26 Z Ruxandra985 Detecting Molecules (IOI16_molecules) C++14
9 / 100
7 ms 472 KB
#include <bits/stdc++.h>
#include "molecules.h"
using namespace std;
 
vector <int> sol;
pair <int,int> x[200010];
vector <int> find_subset (int l , int u , vector <int> v){
    int i , sum;
    for (i=0;i<v.size();i++){
        x[i] = make_pair(v[i] , i);
    }
    sort (x + 1 , x + v.size());
 
    sum = 0;
    for (i = v.size() - 1 ; i>=0 ;i--){
        if (sum + x[i].first <= u){
            sum += x[i].first;
            sol.push_back(x[i].second);
        }
        if (sum >= l){
            return sol;
        }
    }
    sol.clear();
    return sol; /// nu se poate;
 
}

Compilation message

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