QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#86467 | #1902. Computational ethnography | Ahmed_Abdelmegeed# | AC ✓ | 7ms | 3476kb | C++20 | 1.4kb | 2023-03-09 22:15:02 | 2023-03-09 22:15:03 |
Judging History
answer
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ld long double
#define el "\n"
#define matrix vector<vector<int>>
#define pt complex<ld>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_multiset tree<ll, null_type,less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update>
using namespace __gnu_pbds;
using namespace std;
const ll N = 1e5 + 5, LOG = 20, INF = 1e18;
const ld pi = acos(-1);
const ll mod = 1e9 + 7;
const ld eps = 1e-12;
int dx[] = {0, 1, 0, -1, -1, 1, -1, 1};
int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
ll n, m, x, y, k;
void dowork() {
cin >> x >> y;
set<ll> st;
ll num, rnum, tmp, sq;
for (ll i = 1; i * i <= y; i++) {
num = i * i;
rnum = 0, tmp = num;
while (tmp) {
rnum *= 10;
rnum += tmp % 10;
tmp /= 10;
}
sq = sqrt(rnum);
if (sq * sq == rnum && num % 10 && num >= x && num <= y) {
st.insert(num);
}
}
cout << st.size() << el;
}
signed main() {
fast
//freopen("lis.in", "r", stdin);
//freopen("bitwise.out", "w", stdout);
int t = 1;
//cin >> t;
for (int i = 1; i <= t; i++) {
dowork();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3384kb
input:
1 1000
output:
10
result:
ok 1 number(s): "10"
Test #2:
score: 0
Accepted
time: 2ms
memory: 3400kb
input:
20 40
output:
0
result:
ok 1 number(s): "0"
Test #3:
score: 0
Accepted
time: 2ms
memory: 3376kb
input:
80 100
output:
0
result:
ok 1 number(s): "0"
Test #4:
score: 0
Accepted
time: 2ms
memory: 3348kb
input:
1 1
output:
1
result:
ok 1 number(s): "1"
Test #5:
score: 0
Accepted
time: 2ms
memory: 3472kb
input:
10 20
output:
0
result:
ok 1 number(s): "0"
Test #6:
score: 0
Accepted
time: 2ms
memory: 3376kb
input:
16 90
output:
0
result:
ok 1 number(s): "0"
Test #7:
score: 0
Accepted
time: 2ms
memory: 3388kb
input:
18 86
output:
0
result:
ok 1 number(s): "0"
Test #8:
score: 0
Accepted
time: 2ms
memory: 3412kb
input:
10 61
output:
0
result:
ok 1 number(s): "0"
Test #9:
score: 0
Accepted
time: 2ms
memory: 3384kb
input:
239 1488
output:
5
result:
ok 1 number(s): "5"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3404kb
input:
1 1000000
output:
30
result:
ok 1 number(s): "30"
Test #11:
score: 0
Accepted
time: 2ms
memory: 3372kb
input:
402910 786629
output:
1
result:
ok 1 number(s): "1"
Test #12:
score: 0
Accepted
time: 2ms
memory: 3476kb
input:
749966 979696
output:
0
result:
ok 1 number(s): "0"
Test #13:
score: 0
Accepted
time: 5ms
memory: 3376kb
input:
22256537691 50530181412
output:
66
result:
ok 1 number(s): "66"
Test #14:
score: 0
Accepted
time: 2ms
memory: 3412kb
input:
34950561102 36206697992
output:
0
result:
ok 1 number(s): "0"
Test #15:
score: 0
Accepted
time: 7ms
memory: 3408kb
input:
1 100000000000
output:
381
result:
ok 1 number(s): "381"
Test #16:
score: 0
Accepted
time: 6ms
memory: 3376kb
input:
100000000000 100000000000
output:
0
result:
ok 1 number(s): "0"
Test #17:
score: 0
Accepted
time: 7ms
memory: 3384kb
input:
100000000 100000000000
output:
308
result:
ok 1 number(s): "308"