QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#87196#1902. Computational ethnographyBeevo#WA 2ms3460kbC++23770b2023-03-11 22:35:002023-03-11 22:35:03

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:35:03]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3460kb
  • [2023-03-11 22:35:00]
  • 提交

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 += stoll(s) >= a && stoll(s) <= b && 1LL * sq * sq == stoll(s);
    }

    cout << cnt;
}

signed main() {
    Beevo

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

    while (t--)
        testCase();

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1
1000

output:

10

result:

ok 1 number(s): "10"

Test #2:

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

input:

20
40

output:

0

result:

ok 1 number(s): "0"

Test #3:

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

input:

80
100

output:

0

result:

ok 1 number(s): "0"

Test #4:

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

input:

1
1

output:

1

result:

ok 1 number(s): "1"

Test #5:

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

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: 3460kb

input:

18
86

output:

0

result:

ok 1 number(s): "0"

Test #8:

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

input:

10
61

output:

0

result:

ok 1 number(s): "0"

Test #9:

score: -100
Wrong Answer
time: 2ms
memory: 3372kb

input:

239
1488

output:

2

result:

wrong answer 1st numbers differ - expected: '5', found: '2'