QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#792204 | #6558. Allergen Testing | lukamosiashvili# | WA | 0ms | 3648kb | C++17 | 763b | 2024-11-29 06:15:57 | 2024-11-29 06:15:57 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
long long tes;
cin >> tes;
while(tes--){
long long n, d;
cin >> n >> d;
if(n == 1){
cout << 0;
return 0;
}
if(d >= 61){
cout << 1;
return 0;
}
long long x = (1LL << d), nam = x;
long long ans = 1;
while(nam < n){
long long q = n / x;
if(n % x) q++;
if(nam >= q){
ans++;
break;
}
ans++;
nam *= x;
}
cout << ans << endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3640kb
input:
1 4 1
output:
2
result:
ok single line: '2'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3648kb
input:
10000 1 1 1000000000000000000 1 1 1000000000000000000 1000000000000000000 1000000000000000000 26615519354743225 163142634 26615519354743225 163142634 26615519354743224 163142634 26615519354743226 163142634 847997831064072529 920867976 847997831064072529 920867976 847997831064072528 920867976 8479978...
output:
0
result:
wrong answer 2nd lines differ - expected: '60', found: ''