QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#207741#6558. Allergen TestingFreeuni1#WA 0ms3612kbC++141.0kb2023-10-08 19:42:122023-10-08 19:42:12

Judging History

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

  • [2023-10-08 19:42:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3612kb
  • [2023-10-08 19:42:12]
  • 提交

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'