QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#87196 | #1902. Computational ethnography | Beevo# | WA | 2ms | 3460kb | C++23 | 770b | 2023-03-11 22:35:00 | 2023-03-11 22:35:03 |
Judging History
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;
}
詳細信息
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'