답안 #134500

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
134500 2019-07-22T22:18:49 Z reda Detecting Molecules (IOI16_molecules) C++14
0 / 100
2 ms 376 KB
#include<bits/stdc++.h>
using namespace std ;
#define  pb  push_back
#define  ll long long
#define  ld  long  double
#define  mp make_pair
#define  MOD 1000000007
#define endl '\n'
#pragma GCC optimize ("O3")
#define fi  first
#define se  second
vector<int> ans;
vector<int> find_subset(int l, int u, vector<int> w)
{
    vector<pair<int,int>> v;
    for(int i=0;i<w.size();i++)
        v.pb(mp(w[i],i));
    sort(v.begin(),v.end());
    if( v[0].fi>u)return ans;
    ll sum =0;
    for(int i=0;i<w.size();i++)
    {
      sum+= v[i].fi;
      if(sum>u)break;
      if(sum>=l && sum<=u )
       ans.pb(v[i].se);
    }
    return ans;
}
/*int main ()
{
 
    return 0 ;
}
*/

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:16:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<w.size();i++)
                 ~^~~~~~~~~
molecules.cpp:21:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<w.size();i++)
                 ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB OK (n = 1, answer = NO)
2 Correct 2 ms 376 KB OK (n = 1, answer = NO)
3 Correct 2 ms 256 KB OK (n = 1, answer = YES)
4 Incorrect 2 ms 256 KB sum of weights should be in [100..100] but it is 50
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 252 KB Contestant can not find answer, jury can
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB OK (n = 1, answer = NO)
2 Correct 2 ms 376 KB OK (n = 1, answer = NO)
3 Correct 2 ms 256 KB OK (n = 1, answer = YES)
4 Incorrect 2 ms 256 KB sum of weights should be in [100..100] but it is 50
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB OK (n = 1, answer = NO)
2 Correct 2 ms 376 KB OK (n = 1, answer = NO)
3 Correct 2 ms 256 KB OK (n = 1, answer = YES)
4 Incorrect 2 ms 256 KB sum of weights should be in [100..100] but it is 50
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB OK (n = 1, answer = NO)
2 Correct 2 ms 376 KB OK (n = 1, answer = NO)
3 Correct 2 ms 256 KB OK (n = 1, answer = YES)
4 Incorrect 2 ms 256 KB sum of weights should be in [100..100] but it is 50
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB OK (n = 1, answer = NO)
2 Correct 2 ms 376 KB OK (n = 1, answer = NO)
3 Correct 2 ms 256 KB OK (n = 1, answer = YES)
4 Incorrect 2 ms 256 KB sum of weights should be in [100..100] but it is 50
5 Halted 0 ms 0 KB -