Submission #444454

#TimeUsernameProblemLanguageResultExecution timeMemory
444454yungyaoA Difficult(y) Choice (BOI21_books)C++17
0 / 100
3 ms200 KiB
using namespace std; #include <iostream> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <utility> #include <memory.h> #include <map> #include <set> typedef long long LL; typedef pair<int,int> pii; #define pb push_back #define mkp make_pair #define iter(x) x.begin(),x.end() const int maxn = 0; #include <books.h> #define mid (LB + RB)/2 void solve(int n,int k,LL a,int s){ LL v[1010]; for (int i=1;i<=n;++i) v[i] = skim(i); for (int j=2;j<n;++j){ for (int i=1;i<j;++i){ if (v[i] + v[j] >= a) break; auto it = lower_bound(v+j+1,v+n+1,a - v[i] - v[j]); int sum = v[i] + v[j] + *it; if (sum <= a*2 and sum >= a) {answer({i,j,it - v}); return;} } } impossible(); }

Compilation message (stderr)

books.cpp: In function 'void solve(int, int, LL, int)':
books.cpp:33:58: warning: narrowing conversion of '((it - ((LL*)(& v))) <unknown operator> 8)' from 'long int' to 'int' [-Wnarrowing]
   33 |             if (sum <= a*2 and sum >= a) {answer({i,j,it - v}); return;}
      |                                                       ~~~^~~
books.cpp:33:58: warning: narrowing conversion of '((it - ((LL*)(& v))) <unknown operator> 8)' from 'long int' to 'int' [-Wnarrowing]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...