QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#792204#6558. Allergen Testinglukamosiashvili#WA 0ms3648kbC++17763b2024-11-29 06:15:572024-11-29 06:15:57

Judging History

你现在查看的是最新测评结果

  • [2024-11-29 06:15:57]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3648kb
  • [2024-11-29 06:15:57]
  • 提交

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;
}

詳細信息

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: ''