QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#207741 | #6558. Allergen Testing | Freeuni1# | WA | 0ms | 3612kb | C++14 | 1.0kb | 2023-10-08 19:42:12 | 2023-10-08 19:42:12 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int d[1000006];
bool checkForP(long long a) {
//cout << a;
for (int i = 2; i < min(1000000ll, a); i ++) {
if (d[i] == i && a % i == 0) {
//cout << i << endl;
return false;
}
}
return true;
}
bool check(long long val, int rd) {
map<int, int> q;
while (val > 1) {
q[d[val]] ++;
val /= d[val];
}
int myRd = 1;
for (auto it : q) {
myRd *= (it.second + 1);
}
return rd == myRd;
}
main() {
long long t, n, k;
cin >> t;
while ( t--) {
cin >> n >> k;
k ++;
long long l = 1, cnt = 0;
while (1) {
//cout << l << " " << k << endl;
if (l >= n || l < 0) {
cout << cnt << endl;
break;
}
if ((n - k + 1) / k <= l) {
cout << cnt + 1 << endl;
}
l *= k;
cnt ++;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3612kb
input:
1 4 1
output:
1 2 2
result:
wrong answer 1st lines differ - expected: '2', found: '1'