QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#239686#6558. Allergen TestingFyindWA 0ms3592kbC++20798b2023-11-04 22:27:512023-11-04 22:27:51

Judging History

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

  • [2023-11-04 22:27:51]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3592kb
  • [2023-11-04 22:27:51]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define _ <<" "<<
#define sz(x) ((int) (x).size())
typedef pair<int, int> pii;
typedef long long ll;
#define debug(x) cout<<#x<<':'<<x<<endl;
typedef unsigned long long ull;
const int maxn=1000;
ull ksm(ll a,ll n){
    ll ans=1;
    while(n){
        if(n&1) ans=a*ans;
        a=a*a;
        n>>=1;
    }
    return ans;
}

int main(){
    int T;
    cin>>T;
    while(T--){
        ll n,d;
        cin>>n>>d;

        if(n==1){
            cout<<0<<endl;
            continue;
        }
        if(d>=n-1){
            cout<<1<<endl;
        }

        ll sum=1;
        for(ll i=1;i<n;i++){
            if(sum*(d+1)>=n){
                cout<<i<<endl;
            }
            sum*=(d+1);
        }
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3592kb

input:

1
4 1

output:

2
3

result:

wrong output format Extra information in the output file