QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#124662 | #6568. Space Alignment | Sommohito# | WA | 0ms | 3508kb | C++20 | 980b | 2023-07-15 12:59:06 | 2023-07-15 12:59:07 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#ifdef APURBA
#include "DEBUG_TEMPLATE.h"
#else
#define HERE
#define debug(args...)
#endif
#define ALL(x) x.begin(),x.end()
void TEST_CASES()
{
ll n,d;
cin>>n>>d;
if(n==1)
{
cout<<0<<"\n";
return;
}
int ans=1e9;
for(int s=1;s<=62;s++)
{
ll x=1LL<<s;
ll now=n;
int cnt=0;
while(now>1)
{
now=(now+x-1)/x;
cnt++;
}
if(cnt<=d)
{
ans=min(ans,cnt*s);
}
}
cout<<ans<<"\n";
}
/*
1000000000000000000
*/
int32_t main()
{
#ifndef APURBA
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
#endif
//freopen("input.txt","r",stdin);
//freopen("out1.txt","w",stdout);
int t=1;
cin>>t;
while(t--)
{
TEST_CASES();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3508kb
input:
10 { ss{ sts{ tt} t} t{ ss} } { }
output:
0 0 0 0 0 0 0 0 0 0
result:
wrong answer 1st lines differ - expected: '2', found: '0'