QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#87194 | #1902. Computational ethnography | Maram# | AC ✓ | 20ms | 3468kb | C++14 | 926b | 2023-03-11 22:26:55 | 2023-03-11 22:26:56 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define FIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
using namespace std;
const int N = 1e5 + 20, M = 1e6 + 5;
const int mod = 998244353;
void debug() {
#ifdef Debug
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
}
void getAnswer()
{
int a, b, ans = 0;
cin >> a >> b;
for(int i = 1;i * i <= b;++i)
{
if((i * i) >= a and (i * i) <= b and (i * i) % 10 != 0)
{
string s,rev;
s = to_string(i * i), rev = s;
reverse(rev.begin(), rev.end());
int b = stoll(rev, nullptr, 0);
int sqr = sqrt(b);
if(sqr * sqr == b)
++ans;
}
}
cout << ans;
}
signed main()
{
FIO
debug();
int t = 1;
//cin >> t;
while(t--)
getAnswer();
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3460kb
input:
1 1000
output:
10
result:
ok 1 number(s): "10"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3468kb
input:
20 40
output:
0
result:
ok 1 number(s): "0"
Test #3:
score: 0
Accepted
time: 2ms
memory: 3344kb
input:
80 100
output:
0
result:
ok 1 number(s): "0"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3360kb
input:
1 1
output:
1
result:
ok 1 number(s): "1"
Test #5:
score: 0
Accepted
time: 2ms
memory: 3448kb
input:
10 20
output:
0
result:
ok 1 number(s): "0"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3372kb
input:
16 90
output:
0
result:
ok 1 number(s): "0"
Test #7:
score: 0
Accepted
time: 2ms
memory: 3340kb
input:
18 86
output:
0
result:
ok 1 number(s): "0"
Test #8:
score: 0
Accepted
time: 2ms
memory: 3360kb
input:
10 61
output:
0
result:
ok 1 number(s): "0"
Test #9:
score: 0
Accepted
time: 2ms
memory: 3372kb
input:
239 1488
output:
5
result:
ok 1 number(s): "5"
Test #10:
score: 0
Accepted
time: 1ms
memory: 3388kb
input:
1 1000000
output:
30
result:
ok 1 number(s): "30"
Test #11:
score: 0
Accepted
time: 2ms
memory: 3460kb
input:
402910 786629
output:
1
result:
ok 1 number(s): "1"
Test #12:
score: 0
Accepted
time: 2ms
memory: 3340kb
input:
749966 979696
output:
0
result:
ok 1 number(s): "0"
Test #13:
score: 0
Accepted
time: 7ms
memory: 3464kb
input:
22256537691 50530181412
output:
66
result:
ok 1 number(s): "66"
Test #14:
score: 0
Accepted
time: 2ms
memory: 3408kb
input:
34950561102 36206697992
output:
0
result:
ok 1 number(s): "0"
Test #15:
score: 0
Accepted
time: 17ms
memory: 3468kb
input:
1 100000000000
output:
381
result:
ok 1 number(s): "381"
Test #16:
score: 0
Accepted
time: 2ms
memory: 3360kb
input:
100000000000 100000000000
output:
0
result:
ok 1 number(s): "0"
Test #17:
score: 0
Accepted
time: 20ms
memory: 3464kb
input:
100000000 100000000000
output:
308
result:
ok 1 number(s): "308"