QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#60042#1902. Computational ethnographyabdelrahman001#WA 2ms3724kbC++20768b2022-11-02 19:06:332022-11-02 19:06:33

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-02 19:06:33]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3724kb
  • [2022-11-02 19:06:33]
  • 提交

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'