QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#239686 | #6558. Allergen Testing | Fyind | WA | 0ms | 3592kb | C++20 | 798b | 2023-11-04 22:27:51 | 2023-11-04 22:27:51 |
Judging History
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