QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#86454#1902. Computational ethnographyrania__#AC ✓19ms3492kbC++141.2kb2023-03-09 21:56:572023-03-09 21:57:01

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-09 21:57:01]
  • 评测
  • 测评结果:AC
  • 用时:19ms
  • 内存:3492kb
  • [2023-03-09 21:56:57]
  • 提交

answer

#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define ll long long
#define endl '\n'
using namespace std;
using namespace __gnu_pbds;

template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int N = 2e5+7, P1 = 31, P2 = 37, mod= 1e9 + 7;
void doWork() {
    ll b;
    cin >> b;
    ll n;
    cin >> n;
    int cnt =0;
    set<ll> st;
    for (int i = 1; i <= 1e6 ; ++i) {
        ll num = 1ll*i*i;
        ll rnum = 0,tmp=num;
        while (tmp)
        {
            rnum*=10;
            rnum+=tmp%10;
            tmp/=10;
        }
        ll r= sqrt(rnum);
        if ( r*r == rnum  && num%10 && num >= b && num <= n )
        {
            st.insert(num);
        }
    }
    cout << st.size() << endl;
}


int main() {
    ios::sync_with_stdio(false);
    cout.tie(nullptr);
    cin.tie(nullptr);
//    freopen("bisector.in","r",stdin);
//    freopen("bisector.out","w",stdout);
    int t = 1;
    // cout << primes.size() << endl;
    //cin >> t;
    while (t--) {
        doWork();
    }
    return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 18ms
memory: 3400kb

input:

1
1000

output:

10

result:

ok 1 number(s): "10"

Test #2:

score: 0
Accepted
time: 19ms
memory: 3476kb

input:

20
40

output:

0

result:

ok 1 number(s): "0"

Test #3:

score: 0
Accepted
time: 18ms
memory: 3472kb

input:

80
100

output:

0

result:

ok 1 number(s): "0"

Test #4:

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

input:

1
1

output:

1

result:

ok 1 number(s): "1"

Test #5:

score: 0
Accepted
time: 16ms
memory: 3380kb

input:

10
20

output:

0

result:

ok 1 number(s): "0"

Test #6:

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

input:

16
90

output:

0

result:

ok 1 number(s): "0"

Test #7:

score: 0
Accepted
time: 15ms
memory: 3336kb

input:

18
86

output:

0

result:

ok 1 number(s): "0"

Test #8:

score: 0
Accepted
time: 18ms
memory: 3396kb

input:

10
61

output:

0

result:

ok 1 number(s): "0"

Test #9:

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

input:

239
1488

output:

5

result:

ok 1 number(s): "5"

Test #10:

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

input:

1
1000000

output:

30

result:

ok 1 number(s): "30"

Test #11:

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

input:

402910
786629

output:

1

result:

ok 1 number(s): "1"

Test #12:

score: 0
Accepted
time: 19ms
memory: 3396kb

input:

749966
979696

output:

0

result:

ok 1 number(s): "0"

Test #13:

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

input:

22256537691
50530181412

output:

66

result:

ok 1 number(s): "66"

Test #14:

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

input:

34950561102
36206697992

output:

0

result:

ok 1 number(s): "0"

Test #15:

score: 0
Accepted
time: 18ms
memory: 3492kb

input:

1
100000000000

output:

381

result:

ok 1 number(s): "381"

Test #16:

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

input:

100000000000
100000000000

output:

0

result:

ok 1 number(s): "0"

Test #17:

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

input:

100000000
100000000000

output:

308

result:

ok 1 number(s): "308"