QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#60042 | #1902. Computational ethnography | abdelrahman001# | WA | 2ms | 3724kb | C++20 | 768b | 2022-11-02 19:06:33 | 2022-11-02 19:06:33 |
Judging History
answer
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const int N = 1e5 + 5;
ll a, b;
int ans;
set<ll> st;
bool check(ll cur) {
if(cur % 10 == 0)
return false;
ll rev = 0;
while(cur) {
rev *= 10;
rev += cur % 10;
cur /= 10;
}
return st.count(rev);
}
int main() {
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin >> a >> b;
for(int i = 1;1ll * i * i <= b;i++) {
ll cur = 1ll * i * i;
if(cur < a)
continue;
st.insert(cur);
}
for(auto i : st) {
if(check(i))
ans++;
}
cout << ans;
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3656kb
input:
1 1000
output:
10
result:
ok 1 number(s): "10"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
20 40
output:
0
result:
ok 1 number(s): "0"
Test #3:
score: 0
Accepted
time: 2ms
memory: 3604kb
input:
80 100
output:
0
result:
ok 1 number(s): "0"
Test #4:
score: 0
Accepted
time: 2ms
memory: 3720kb
input:
1 1
output:
1
result:
ok 1 number(s): "1"
Test #5:
score: 0
Accepted
time: 2ms
memory: 3720kb
input:
10 20
output:
0
result:
ok 1 number(s): "0"
Test #6:
score: 0
Accepted
time: 2ms
memory: 3520kb
input:
16 90
output:
0
result:
ok 1 number(s): "0"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
18 86
output:
0
result:
ok 1 number(s): "0"
Test #8:
score: 0
Accepted
time: 2ms
memory: 3724kb
input:
10 61
output:
0
result:
ok 1 number(s): "0"
Test #9:
score: -100
Wrong Answer
time: 2ms
memory: 3608kb
input:
239 1488
output:
2
result:
wrong answer 1st numbers differ - expected: '5', found: '2'