QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#706530#6558. Allergen Testingucup-team902#WA 6ms3700kbC++23522b2024-11-03 12:01:332024-11-03 12:01:34

Judging History

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

  • [2024-11-03 12:01:34]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:3700kb
  • [2024-11-03 12:01:33]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
void solve() {
    long long n, m;
    cin >> n >> m;
    if (n == 1) {
        cout << 0 << endl;
    }
    m++;
    long long now = 1;
    int t = 1;
    while (1) {
        if ((__int128)now * m >= n) {
            break;
        }
        t++;
        now *= m;
    }
    cout << t << endl;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int T = 1;
    cin >> T;
    while (T--) {
        solve();
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3564kb

input:

1
4 1

output:

2

result:

ok single line: '2'

Test #2:

score: -100
Wrong Answer
time: 6ms
memory: 3700kb

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
1
60
0
1
1
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
2
2
2
3
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
3
3
3
4
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
4
4
4
5
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6
5
5
5
6...

result:

wrong answer 2nd lines differ - expected: '60', found: '1'