제출 #863522

#제출 시각아이디문제언어결과실행 시간메모리
863522Ahmed_SolymanA Difficult(y) Choice (BOI21_books)C++14
0 / 100
0 ms432 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 ll sum=0; vector<int>v; for(int i=1;i<k;i++)sum+=skim(i),v.push_back(i); int l=k,r=n; while(l<=r){ int mid=l+r>>1; ll s=sum+skim(mid); if(s<a){ l=mid+1; } else if(s>a*2){ r=mid-1; } else{ v.push_back(mid); answer(v); } } impossible(); }

컴파일 시 표준 에러 (stderr) 메시지

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:24:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   24 |         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...