【メモ】AtCoder Begginer Contest ABC032 C - 列
2020/1/28
code:c++
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i) #define all(a) (a).begin(),(a).end() typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const int INF = 1e9;
const ll INFLL = 1e18;
const ll MOD = 1e9+7;
const double PI = acos(-1.0);
const int dx8 = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy8 = {0, 1, 0, -1, 1, 1, -1, -1}; /*------------------------------------/
for library*/
/*------------------------------------*/
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);
int N,K;
cin>>N>>K;
vector<ll> s(N);
bool f = false;
rep(i,N){
f = true;
}
}
if(f){
cout<<N<<endl;
return 0;
}
int r = 0;
ll product = 1;
int ans = 0;
for(int l = 0;l < N; l++){
while(r < N && product * sr <= K){ r++;
}
//このループを出るときは、満たさないrが取れている
//[l,r)のかけ算がK以下だということ
//cerr<<"[l,r), product: "<<l<<" "<<r<<" "<<product<<endl;
chmax(ans, r - l);
//lを増やす準備
if(r == l){
r++;
}
else{
}
}
cout<<ans<<endl;
}