QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#60085#1902. Computational ethnographyabdelrahman001#AC ✓7ms3724kbC++20731b2022-11-02 20:13:242022-11-02 20:13:25

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 20:13:25]
  • 评测
  • 测评结果:AC
  • 用时:7ms
  • 内存:3724kb
  • [2022-11-02 20:13:24]
  • 提交

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;
	}
	ll sq = sqrt(rev);
	return sq * sq == 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 && check(cur))
			ans++;
	}
	cout << ans;
    return 0;
}


这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3648kb

input:

1
1000

output:

10

result:

ok 1 number(s): "10"

Test #2:

score: 0
Accepted
time: 2ms
memory: 3668kb

input:

20
40

output:

0

result:

ok 1 number(s): "0"

Test #3:

score: 0
Accepted
time: 2ms
memory: 3724kb

input:

80
100

output:

0

result:

ok 1 number(s): "0"

Test #4:

score: 0
Accepted
time: 2ms
memory: 3608kb

input:

1
1

output:

1

result:

ok 1 number(s): "1"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

10
20

output:

0

result:

ok 1 number(s): "0"

Test #6:

score: 0
Accepted
time: 2ms
memory: 3628kb

input:

16
90

output:

0

result:

ok 1 number(s): "0"

Test #7:

score: 0
Accepted
time: 2ms
memory: 3524kb

input:

18
86

output:

0

result:

ok 1 number(s): "0"

Test #8:

score: 0
Accepted
time: 1ms
memory: 3724kb

input:

10
61

output:

0

result:

ok 1 number(s): "0"

Test #9:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

239
1488

output:

5

result:

ok 1 number(s): "5"

Test #10:

score: 0
Accepted
time: 2ms
memory: 3596kb

input:

1
1000000

output:

30

result:

ok 1 number(s): "30"

Test #11:

score: 0
Accepted
time: 2ms
memory: 3596kb

input:

402910
786629

output:

1

result:

ok 1 number(s): "1"

Test #12:

score: 0
Accepted
time: 2ms
memory: 3660kb

input:

749966
979696

output:

0

result:

ok 1 number(s): "0"

Test #13:

score: 0
Accepted
time: 2ms
memory: 3660kb

input:

22256537691
50530181412

output:

66

result:

ok 1 number(s): "66"

Test #14:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

34950561102
36206697992

output:

0

result:

ok 1 number(s): "0"

Test #15:

score: 0
Accepted
time: 7ms
memory: 3668kb

input:

1
100000000000

output:

381

result:

ok 1 number(s): "381"

Test #16:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

100000000000
100000000000

output:

0

result:

ok 1 number(s): "0"

Test #17:

score: 0
Accepted
time: 7ms
memory: 3584kb

input:

100000000
100000000000

output:

308

result:

ok 1 number(s): "308"