QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#413461#5715. 幂次x-camp40 18ms6260kbC++17933b2024-05-17 16:32:102024-05-17 16:32:11

Judging History

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

  • [2024-05-17 16:32:11]
  • 评测
  • 测评结果:40
  • 用时:18ms
  • 内存:6260kb
  • [2024-05-17 16:32:10]
  • 提交

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++) {
            for (int b=2; b<=100000; b++) {
                if ( log(b) <= log(n)/d)
                    mp.insert(pow(b,d));
                else {
                   // cout << b-1 << " " << d << endl;
                    break;
                }
            }
        }
        ans += mp.size();
        ans ++;
    }
    cout << ans;
    return 0;
}

詳細信息

Test #1:

score: 5
Accepted
time: 0ms
memory: 3592kb

input:

92 1

output:

92

result:

ok 1 number(s): "92"

Test #2:

score: 5
Accepted
time: 0ms
memory: 3936kb

input:

96 2

output:

12

result:

ok 1 number(s): "12"

Test #3:

score: 5
Accepted
time: 0ms
memory: 3704kb

input:

9383 3

output:

37

result:

ok 1 number(s): "37"

Test #4:

score: 5
Accepted
time: 0ms
memory: 3816kb

input:

9830 2

output:

124

result:

ok 1 number(s): "124"

Test #5:

score: 5
Accepted
time: 0ms
memory: 3672kb

input:

927700 3

output:

149

result:

ok 1 number(s): "149"

Test #6:

score: 5
Accepted
time: 0ms
memory: 3840kb

input:

972504 2

output:

1097

result:

ok 1 number(s): "1097"

Test #7:

score: 5
Accepted
time: 0ms
memory: 3988kb

input:

94345650 3

output:

605

result:

ok 1 number(s): "605"

Test #8:

score: 5
Accepted
time: 2ms
memory: 4248kb

input:

98811802 2

output:

10429

result:

ok 1 number(s): "10429"

Test #9:

score: 0
Wrong Answer
time: 1ms
memory: 3772kb

input:

9328450690 3

output:

1603

result:

wrong answer 1st numbers differ - expected: '2541', found: '1603'

Test #10:

score: 0
Wrong Answer
time: 12ms
memory: 6184kb

input:

9775065820 2

output:

47689

result:

wrong answer 1st numbers differ - expected: '101083', found: '47689'

Test #11:

score: 0
Wrong Answer
time: 1ms
memory: 4044kb

input:

948459050000 3

output:

1603

result:

wrong answer 1st numbers differ - expected: '11116', found: '1603'

Test #12:

score: 0
Wrong Answer
time: 12ms
memory: 6260kb

input:

993120563000 2

output:

47689

result:

wrong answer 1st numbers differ - expected: '1006727', found: '47689'

Test #13:

score: 0
Wrong Answer
time: 2ms
memory: 3924kb

input:

93781484300000 3

output:

1603

result:

wrong answer 1st numbers differ - expected: '49275', found: '1603'

Test #14:

score: 0
Wrong Answer
time: 14ms
memory: 6028kb

input:

98250912400000 2

output:

47689

result:

wrong answer 1st numbers differ - expected: '9958807', found: '47689'

Test #15:

score: 0
Wrong Answer
time: 5ms
memory: 3936kb

input:

9272034040000000 3

output:

1603

result:

wrong answer 1st numbers differ - expected: '221661', found: '1603'

Test #16:

score: 0
Wrong Answer
time: 18ms
memory: 6204kb

input:

9981231040000000 2

output:

47689

result:

wrong answer 1st numbers differ - expected: '100122721', found: '47689'

Test #17:

score: 0
Wrong Answer
time: 6ms
memory: 3908kb

input:

942817384000000000 3

output:

1603

result:

wrong answer 1st numbers differ - expected: '1016053', found: '1603'

Test #18:

score: 0
Wrong Answer
time: 12ms
memory: 6204kb

input:

987478897000000000 2

output:

47689

result:

wrong answer 1st numbers differ - expected: '994718860', found: '47689'

Test #19:

score: 0
Wrong Answer
time: 18ms
memory: 6200kb

input:

932205945000000000 2

output:

47689

result:

wrong answer 1st numbers differ - expected: '966488284', found: '47689'

Test #20:

score: 0
Wrong Answer
time: 18ms
memory: 6128kb

input:

992520149596833024 2

output:

47689

result:

wrong answer 1st numbers differ - expected: '997253882', found: '47689'