QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#413455#5715. 幂次x-camp40 18ms6252kbC++17992b2024-05-17 16:22:192024-05-17 16:22:20

Judging History

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

  • [2024-05-17 16:22:20]
  • 评测
  • 测评结果:40
  • 用时:18ms
  • 内存:6252kb
  • [2024-05-17 16:22:19]
  • 提交

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

詳細信息

Test #1:

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

input:

92 1

output:

92

result:

ok 1 number(s): "92"

Test #2:

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

input:

96 2

output:

12

result:

ok 1 number(s): "12"

Test #3:

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

input:

9383 3

output:

37

result:

ok 1 number(s): "37"

Test #4:

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

input:

9830 2

output:

124

result:

ok 1 number(s): "124"

Test #5:

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

input:

927700 3

output:

149

result:

ok 1 number(s): "149"

Test #6:

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

input:

972504 2

output:

1097

result:

ok 1 number(s): "1097"

Test #7:

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

input:

94345650 3

output:

605

result:

ok 1 number(s): "605"

Test #8:

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

input:

98811802 2

output:

10429

result:

ok 1 number(s): "10429"

Test #9:

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

input:

9328450690 3

output:

1603

result:

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

Test #10:

score: 0
Wrong Answer
time: 11ms
memory: 5964kb

input:

9775065820 2

output:

47689

result:

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

Test #11:

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

input:

948459050000 3

output:

1603

result:

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

Test #12:

score: 0
Wrong Answer
time: 11ms
memory: 6016kb

input:

993120563000 2

output:

47689

result:

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

Test #13:

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

input:

93781484300000 3

output:

1603

result:

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

Test #14:

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

input:

98250912400000 2

output:

47689

result:

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

Test #15:

score: 0
Wrong Answer
time: 4ms
memory: 3972kb

input:

9272034040000000 3

output:

1603

result:

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

Test #16:

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

input:

9981231040000000 2

output:

47689

result:

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

Test #17:

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

input:

942817384000000000 3

output:

1603

result:

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

Test #18:

score: 0
Wrong Answer
time: 17ms
memory: 6008kb

input:

987478897000000000 2

output:

47689

result:

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

Test #19:

score: 0
Wrong Answer
time: 10ms
memory: 6252kb

input:

932205945000000000 2

output:

47689

result:

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

Test #20:

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

input:

992520149596833024 2

output:

47689

result:

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