XVII Open Cup named after E.V. Pankratiev. XXI Ural Championship
二分 用bitset处理背包
#include <bits/stdc++.h>
using namespace std ;
typedef long long ll ;
int n , down , up ;
int m[10000] , c[10000] ;
bitset<10005> f , temp;
bool check(int K){f.reset() ; f[0] = 1 ;for(int i = 1 ; i <= n ; i ++ ){int tot = c[i] / K ;int g = 1 ;ll v = m[i] ;temp = f ;/*while( tot ){if(v > up) break ;f |= f << v ;tot -= g ;g = min(g*2 , tot) ;v = (ll)m[i] * g ;}*/for(int j = 1 ; j <= tot ; j ++ ){if(v *