Submission #863504

#TimeUsernameProblemLanguageResultExecution timeMemory
863504Ahmed_SolymanA Difficult(y) Choice (BOI21_books)C++14
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; typedef long long ll; // // --- Sample implementation for the task books --- // // To compile this program with the sample grader, place: // books.h books_sample.cpp sample_grader.cpp // in a single folder and run: // g++ books_sample.cpp sample_grader.cpp // in this folder. // void solve(int n, int k, long long a, int s) { // TODO implement this function int l=1,r=n-k+1; while(l<=r){ int mid=l+r>>1; ll sum=0; vector<int>v; for(int i=mid;i<mid+k;i++){ v.push_back(i); sum+=skim(i); } if(sum<k){ l=mid+1; } else if(sum>k*2){ r=mid-1; } else{ answer(v); } } impossible(); }

Compilation message (stderr)

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:21:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   21 |         int mid=l+r>>1;
      |                 ~^~
#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...