답안 #234638

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
234638 2020-05-24T22:18:50 Z AmineWeslati Detecting Molecules (IOI16_molecules) C++14
0 / 100
5 ms 384 KB
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
//s.order_of_key(), *s.find_by_order()

using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

typedef string str;
typedef long long ll;
//#define int ll
typedef double db;
typedef long double ld;

typedef pair<int,int> pi;
#define fi first
#define se second

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<pi> vpi;

#define pb push_back
#define eb emplace_back
#define pf push_front

#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)

const int MOD = 1e9+7; //998244353
const ll INF = 1e18;
const int nx[4]={0,0,1,-1}, ny[4]={1,-1,0,0};

vi find_subset(int l, int u, vi w){
   int n=sz(w);
   vi result;
   sort(all(w));

   int s=0,j=0;
   int a=-1,b;
   for(int i=0; i<n; i++){
      s+=w[i];
      if(s>u && j<i){
         s-=w[j];
         j++;
      }
      if(s>=l && s<=u){
         a=j;
         b=i;
         break;
      }
   }
   if(a==-1){
      return {};
   }
   for(int i=a; i<=b; i++){
      result.pb(i+1);
   }
   return result;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 256 KB OK (n = 1, answer = NO)
2 Correct 4 ms 384 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Integer 1 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 256 KB OK (n = 12, answer = YES)
2 Correct 4 ms 256 KB OK (n = 12, answer = YES)
3 Correct 4 ms 256 KB OK (n = 12, answer = NO)
4 Correct 4 ms 256 KB OK (n = 12, answer = NO)
5 Incorrect 4 ms 256 KB sum of weights should be in [290..300] but it is 301
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 256 KB OK (n = 1, answer = NO)
2 Correct 4 ms 384 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Integer 1 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 256 KB OK (n = 1, answer = NO)
2 Correct 4 ms 384 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Integer 1 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 256 KB OK (n = 1, answer = NO)
2 Correct 4 ms 384 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Integer 1 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 256 KB OK (n = 1, answer = NO)
2 Correct 4 ms 384 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Integer 1 violates the range [0, 0]
4 Halted 0 ms 0 KB -