답안 #234635

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
234635 2020-05-24T22:08:13 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(n);
   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){
      result[0]=0;
      return result;
   }
   for(int i=a; i<=b; i++){
      result[i-a]=i+1;
   }
   return result;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 256 KB sum of weights should be in [10..12] but it is 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 384 KB item #0 is taken twice
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 256 KB sum of weights should be in [10..12] but it is 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 256 KB sum of weights should be in [10..12] but it is 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 256 KB sum of weights should be in [10..12] but it is 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 256 KB sum of weights should be in [10..12] but it is 9
2 Halted 0 ms 0 KB -