제출 #657618

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6576182022-11-10 11:58:10TimDeeA Difficult(y) Choice (BOI21_books)C++17
0 / 100
1 ms208 KiB
#include"books.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define forn(i,n) for(int i=0;i<n;++i)
void solve(int n, int k, ll A, int s) {
ll d=A/k;
int l=1, r=n;
vector<pair<int,int>> paia;
while (l<r) {
int mid=(l+r)>>1;
int x=skim(mid);
if (x<d) l=mid+1;
else r=mid;
}
int x=skim(r);
paia={{x,r}};
return;
for (int i=r-1; i>=max(i-k+1,1); --i) {
int x=skim(i);
paia.push_back({x,i});
}
for (int i=r+1; i<=min(i+k-1,n); ++i) {
int x=skim(i);
paia.push_back({x,i});
}
return;
sort(paia.begin(), paia.end());
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

books.cpp: In function 'void solve(int, int, ll, int)':
books.cpp:5:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define forn(i,n) for(int i=0;i<n;++i)
......
   37 |   forn(i,paia.size()) cnt+=(m>>i)&1;
      |        ~~~~~~~~~~~~~            
books.cpp:37:3: note: in expansion of macro 'forn'
   37 |   forn(i,paia.size()) cnt+=(m>>i)&1;
      |   ^~~~
books.cpp:5:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define forn(i,n) for(int i=0;i<n;++i)
......
   40 |   forn(i,paia.size()) if ((m>>i)&1) S+=paia[i].first;
      |        ~~~~~~~~~~~~~            
books.cpp:40:3: note: in expansion of macro 'forn'
   40 |   forn(i,paia.size()) if ((m>>i)&1) S+=paia[i].first;
      |   ^~~~
books.cpp:5:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define forn(i,n) for(int i=0;i<n;++i)
......
   43 |    forn(i,paia.size()) if ((m>>i)&1) ans.push_back(paia[i].second);
      |         ~~~~~~~~~~~~~           
books.cpp:43:4: note: in expansion of macro 'forn'
   43 |    forn(i,paia.size()) if ((m>>i)&1) ans.push_back(paia[i].second);
      |    ^~~~
#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...