QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#86452 | #1902. Computational ethnography | rania__# | WA | 3ms | 3548kb | C++14 | 1.2kb | 2023-03-09 21:54:31 | 2023-03-09 21:54:45 |
Judging History
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;
for (int i = 1; i <= 1e6 ; ++i) {
ll num = 1ll*i*i;
if ( num > n)
continue;
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 && rnum >= b && rnum <= n)
{
cnt++;
}
}
cout << cnt << 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;
}
详细
Test #1:
score: 100
Accepted
time: 3ms
memory: 3360kb
input:
1 1000
output:
10
result:
ok 1 number(s): "10"
Test #2:
score: 0
Accepted
time: 2ms
memory: 3348kb
input:
20 40
output:
0
result:
ok 1 number(s): "0"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3376kb
input:
80 100
output:
0
result:
ok 1 number(s): "0"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3324kb
input:
1 1
output:
1
result:
ok 1 number(s): "1"
Test #5:
score: 0
Accepted
time: 3ms
memory: 3548kb
input:
10 20
output:
0
result:
ok 1 number(s): "0"
Test #6:
score: 0
Accepted
time: 2ms
memory: 3368kb
input:
16 90
output:
0
result:
ok 1 number(s): "0"
Test #7:
score: 0
Accepted
time: 2ms
memory: 3348kb
input:
18 86
output:
0
result:
ok 1 number(s): "0"
Test #8:
score: 0
Accepted
time: 2ms
memory: 3368kb
input:
10 61
output:
0
result:
ok 1 number(s): "0"
Test #9:
score: -100
Wrong Answer
time: 1ms
memory: 3368kb
input:
239 1488
output:
2
result:
wrong answer 1st numbers differ - expected: '5', found: '2'