Submission #574947

# Submission time Handle Problem Language Result Execution time Memory
574947 2022-06-09T13:18:37 Z Uzouf A Difficult(y) Choice (BOI21_books) C++14
0 / 100
2 ms 976 KB
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#include"books.h"
using namespace std;
//using namespace __gnu_pbds;
//#define ll long long
//#define endl "\n"
//int mod=1e9+7;
//const int N=2e5+5;
//template<class x>
//using ordered_multiset = tree<x, null_type,less_equal<x>, rb_tree_tag,tree_order_statistics_node_update>;

void solve(int N, int K, long long A, int S) {
  long long v[N];
    for (int i=0;i<N;i++) {
      v[i]=skim(i+1);
    }
    long long na=A*2;
    int  a=-1,b=-1,c=-1;
    for (int l=0;l<N;l++) {
      for (int r=l+2;r<N;r++) {
        int ll=l+1,rr=r-1;
        while (ll<=rr) {
          int mid=(ll+rr)/2;
          long long chk=v[l]+v[r]+v[mid];
          if (chk<=na && chk>=A) {
            a=v[l]; b=v[mid]; c=v[r]; break;
          }
          else if (chk<A) ll=mid+1;
          else rr=mid-1;

        }
        if (a!=-1) break;
      }
      if (a!=-1) break;
    }
    if (a==-1) impossible();
    vector<int> ans;
    ans.push_back(a); ans.push_back(b); ans.push_back(c);
    //cout<<a<<' '<<b<<' '<<c;
    answer(ans);
    return;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 976 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 976 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 976 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 976 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 976 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -