QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#87199#1902. Computational ethnographyBeevo#AC ✓27ms3460kbC++23736b2023-03-11 22:41:522023-03-11 22:41:53

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-11 22:41:53]
  • 评测
  • 测评结果:AC
  • 用时:27ms
  • 内存:3460kb
  • [2023-03-11 22:41:52]
  • 提交

answer

#include <bits/stdc++.h>

#define el '\n'

typedef long long ll;
typedef long double ld;

#define Beevo ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

void testCase() {
    ll a, b;
    cin >> a >> b;

    int cnt = 0;
    for (int i = 1; 1LL * i * i <= b; i++) {
        if (1LL * i * i < a)
            continue;

        string s = to_string(1LL * i * i);

        reverse(s.begin(), s.end());

        if (s[0] == '0')
            continue;

        int sq = sqrt(stoll(s));

        cnt += 1LL * sq * sq == stoll(s);
    }

    cout << cnt;
}

signed main() {
    Beevo

    int t = 1;
//    cin >> t;

    while (t--)
        testCase();

    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3380kb

input:

1
1000

output:

10

result:

ok 1 number(s): "10"

Test #2:

score: 0
Accepted
time: 2ms
memory: 3408kb

input:

20
40

output:

0

result:

ok 1 number(s): "0"

Test #3:

score: 0
Accepted
time: 2ms
memory: 3456kb

input:

80
100

output:

0

result:

ok 1 number(s): "0"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3368kb

input:

1
1

output:

1

result:

ok 1 number(s): "1"

Test #5:

score: 0
Accepted
time: 2ms
memory: 3440kb

input:

10
20

output:

0

result:

ok 1 number(s): "0"

Test #6:

score: 0
Accepted
time: 2ms
memory: 3372kb

input:

16
90

output:

0

result:

ok 1 number(s): "0"

Test #7:

score: 0
Accepted
time: 2ms
memory: 3408kb

input:

18
86

output:

0

result:

ok 1 number(s): "0"

Test #8:

score: 0
Accepted
time: 0ms
memory: 3368kb

input:

10
61

output:

0

result:

ok 1 number(s): "0"

Test #9:

score: 0
Accepted
time: 2ms
memory: 3436kb

input:

239
1488

output:

5

result:

ok 1 number(s): "5"

Test #10:

score: 0
Accepted
time: 2ms
memory: 3364kb

input:

1
1000000

output:

30

result:

ok 1 number(s): "30"

Test #11:

score: 0
Accepted
time: 2ms
memory: 3436kb

input:

402910
786629

output:

1

result:

ok 1 number(s): "1"

Test #12:

score: 0
Accepted
time: 0ms
memory: 3364kb

input:

749966
979696

output:

0

result:

ok 1 number(s): "0"

Test #13:

score: 0
Accepted
time: 4ms
memory: 3440kb

input:

22256537691
50530181412

output:

66

result:

ok 1 number(s): "66"

Test #14:

score: 0
Accepted
time: 2ms
memory: 3384kb

input:

34950561102
36206697992

output:

0

result:

ok 1 number(s): "0"

Test #15:

score: 0
Accepted
time: 23ms
memory: 3460kb

input:

1
100000000000

output:

381

result:

ok 1 number(s): "381"

Test #16:

score: 0
Accepted
time: 2ms
memory: 3368kb

input:

100000000000
100000000000

output:

0

result:

ok 1 number(s): "0"

Test #17:

score: 0
Accepted
time: 27ms
memory: 3456kb

input:

100000000
100000000000

output:

308

result:

ok 1 number(s): "308"