QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#413450 | #5715. 幂次 | x-camp | 5 | 318ms | 15036kb | C++17 | 986b | 2024-05-17 16:18:42 | 2024-05-17 16:18:43 |
Judging History
answer
#include <iostream>
#include <vector>
#include <cmath>
#include <set>
using namespace std;
int main(int argc, const char * argv[]) {
vector<int> p
{ 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59};
long long n;
int k;
cin >> n >> k;
long long ans = 0;
if (k == 1) ans = n ;
else {
set<int> mp;
/*
if (k == 2) {
int x = floor( log(n)/log(2));
ans += x-1;
cout << x << endl;
}*/
for (int d = k; d<60; d++) {
if (d < k) continue;
for (int b=2; b<=100000; b++) {
long long x = pow(b,d);
if (x <= n)
mp.insert(x);
else {
cout << b-1 << " " << d << endl;
break;
}
}
}
ans += mp.size();
ans ++;
}
cout << ans;
return 0;
}
詳細信息
Test #1:
score: 5
Accepted
time: 1ms
memory: 3564kb
input:
92 1
output:
92
result:
ok 1 number(s): "92"
Test #2:
score: 0
Wrong Answer
time: 1ms
memory: 3920kb
input:
96 2
output:
9 2 4 3 3 4 2 5 2 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 12
result:
wrong answer 1st numbers differ - expected: '12', found: '9'
Test #3:
score: 0
Wrong Answer
time: 1ms
memory: 3676kb
input:
9383 3
output:
21 3 9 4 6 5 4 6 3 7 3 8 2 9 2 10 2 11 2 12 2 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 37
result:
wrong answer 1st numbers differ - expected: '37', found: '21'
Test #4:
score: 0
Wrong Answer
time: 1ms
memory: 3800kb
input:
9830 2
output:
99 2 21 3 9 4 6 5 4 6 3 7 3 8 2 9 2 10 2 11 2 12 2 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 124
result:
wrong answer 1st numbers differ - expected: '124', found: '99'
Test #5:
score: 0
Wrong Answer
time: 0ms
memory: 3712kb
input:
927700 3
output:
97 3 31 4 15 5 9 6 7 7 5 8 4 9 3 10 3 11 3 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 149
result:
wrong answer 1st numbers differ - expected: '149', found: '97'
Test #6:
score: 0
Wrong Answer
time: 1ms
memory: 3952kb
input:
972504 2
output:
986 2 99 3 31 4 15 5 9 6 7 7 5 8 4 9 3 10 3 11 3 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 1097
result:
wrong answer 1st numbers differ - expected: '1097', found: '986'
Test #7:
score: 0
Wrong Answer
time: 1ms
memory: 3836kb
input:
94345650 3
output:
455 3 98 4 39 5 21 6 13 7 9 8 7 9 6 10 5 11 4 12 4 13 3 14 3 15 3 16 2 17 2 18 2 19 2 20 2 21 2 22 2 23 2 24 2 25 2 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 605
result:
wrong answer 1st numbers differ - expected: '605', found: '455'
Test #8:
score: 0
Wrong Answer
time: 2ms
memory: 4160kb
input:
98811802 2
output:
9940 2 462 3 99 4 39 5 21 6 13 7 9 8 7 9 6 10 5 11 4 12 4 13 3 14 3 15 3 16 2 17 2 18 2 19 2 20 2 21 2 22 2 23 2 24 2 25 2 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 10429
result:
wrong answer 1st numbers differ - expected: '10429', found: '9940'
Test #9:
score: 0
Wrong Answer
time: 1ms
memory: 4016kb
input:
9328450690 3
output:
2105 3 310 4 98 5 45 6 26 7 17 8 12 9 9 10 8 11 6 12 5 13 5 14 4 15 4 16 3 17 3 18 3 19 3 20 2 21 2 22 2 23 2 24 2 25 2 26 2 27 2 28 2 29 2 30 2 31 2 32 2 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 2540
result:
wrong answer 1st numbers differ - expected: '2541', found: '2105'
Test #10:
score: 0
Wrong Answer
time: 17ms
memory: 8480kb
input:
9775065820 2
output:
98868 2 2138 3 314 4 99 5 46 6 26 7 17 8 12 9 9 10 8 11 6 12 5 13 5 14 4 15 4 16 3 17 3 18 3 19 3 20 2 21 2 22 2 23 2 24 2 25 2 26 2 27 2 28 2 29 2 30 2 31 2 32 2 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 101080
result:
wrong answer 1st numbers differ - expected: '101083', found: '98868'
Test #11:
score: 0
Wrong Answer
time: 0ms
memory: 4324kb
input:
948459050000 3
output:
9825 3 986 4 248 5 99 6 51 7 31 8 21 9 15 10 12 11 9 12 8 13 7 14 6 15 5 16 5 17 4 18 4 19 3 20 3 21 3 22 3 23 3 24 3 25 2 26 2 27 2 28 2 29 2 30 2 31 2 32 2 33 2 34 2 35 2 36 2 37 2 38 2 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 11098
result:
wrong answer 1st numbers differ - expected: '11116', found: '9825'
Test #12:
score: 0
Wrong Answer
time: 21ms
memory: 8876kb
input:
993120563000 2
output:
9977 3 998 4 250 5 99 6 51 7 31 8 21 9 15 10 12 11 9 12 8 13 7 14 6 15 5 16 5 17 4 18 4 19 3 20 3 21 3 22 3 23 3 24 3 25 2 26 2 27 2 28 2 29 2 30 2 31 2 32 2 33 2 34 2 35 2 36 2 37 2 38 2 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 110892
result:
wrong answer 1st numbers differ - expected: '1006727', found: '9977'
Test #13:
score: 0
Wrong Answer
time: 40ms
memory: 6288kb
input:
93781484300000 3
output:
45433 3 3111 4 622 5 213 6 99 7 55 8 35 9 24 10 18 11 14 12 11 13 9 14 8 15 7 16 6 17 5 18 5 19 4 20 4 21 4 22 4 23 3 24 3 25 3 26 3 27 3 28 3 29 2 30 2 31 2 32 2 33 2 34 2 35 2 36 2 37 2 38 2 39 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 49150
result:
wrong answer 1st numbers differ - expected: '49275', found: '45433'
Test #14:
score: 0
Wrong Answer
time: 119ms
memory: 10752kb
input:
98250912400000 2
output:
46143 3 3148 4 628 5 214 6 99 7 56 8 35 9 25 10 18 11 14 12 11 13 9 14 8 15 7 16 6 17 5 18 5 19 5 20 4 21 4 22 4 23 3 24 3 25 3 26 3 27 3 28 3 29 2 30 2 31 2 32 2 33 2 34 2 35 2 36 2 37 2 38 2 39 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 149511
result:
wrong answer 1st numbers differ - expected: '9958807', found: '46143'
Test #15:
score: 0
Wrong Answer
time: 112ms
memory: 9064kb
input:
9272034040000000 3
output:
9812 4 1561 5 458 6 190 7 99 8 59 9 39 10 28 11 21 12 16 13 13 14 11 15 9 16 8 17 7 18 6 19 6 20 5 21 5 22 4 23 4 24 4 25 4 26 3 27 3 28 3 29 3 30 3 31 2 34 2 35 2 36 2 37 2 38 2 39 1 54 1 55 1 56 1 57 1 58 1 59 111277
result:
wrong answer 1st numbers differ - expected: '221661', found: '9812'
Test #16:
score: 0
Wrong Answer
time: 186ms
memory: 13600kb
input:
9981231040000000 2
output:
9995 4 1584 5 464 6 193 7 99 8 59 9 39 10 28 11 21 12 17 13 13 14 11 15 9 16 8 17 7 18 6 19 6 20 5 21 5 22 4 23 4 24 4 25 4 26 3 27 3 28 3 29 3 30 3 31 2 34 2 35 2 36 2 37 2 38 2 39 1 54 1 55 1 56 1 57 1 58 1 59 211070
result:
wrong answer 1st numbers differ - expected: '100122721', found: '9995'
Test #17:
score: 0
Wrong Answer
time: 184ms
memory: 10176kb
input:
942817384000000000 3
output:
31160 4 3934 5 990 6 369 7 176 8 99 9 62 10 43 11 31 12 24 13 19 14 15 15 13 16 11 17 9 18 8 19 7 20 6 22 5 24 4 26 4 27 3 30 3 31 2 38 2 39 135087
result:
wrong answer 1st numbers differ - expected: '1016053', found: '31160'
Test #18:
score: 0
Wrong Answer
time: 293ms
memory: 15036kb
input:
987478897000000000 2
output:
31523 4 3971 5 997 6 372 7 177 8 99 9 63 10 43 11 31 12 24 13 19 14 15 15 13 16 11 17 9 18 8 19 7 20 6 22 5 24 4 26 4 27 3 30 3 31 2 38 2 39 235029
result:
wrong answer 1st numbers differ - expected: '994718860', found: '31523'
Test #19:
score: 0
Wrong Answer
time: 296ms
memory: 14784kb
input:
932205945000000000 2
output:
31072 4 3925 5 988 6 369 7 176 8 99 9 62 10 43 11 31 12 24 13 19 14 15 15 13 16 11 17 9 18 8 19 7 20 6 22 5 24 4 26 4 27 3 30 3 31 2 38 2 39 234536
result:
wrong answer 1st numbers differ - expected: '966488284', found: '31072'
Test #20:
score: 0
Wrong Answer
time: 318ms
memory: 14816kb
input:
992520149596833024 2
output:
31563 4 3975 5 998 6 372 7 177 8 99 9 63 10 43 11 31 12 24 13 19 14 15 15 13 16 11 17 9 18 8 19 7 20 6 22 5 24 4 26 4 27 3 30 3 31 2 38 2 39 235073
result:
wrong answer 1st numbers differ - expected: '997253882', found: '31563'