QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#86461#1902. Computational ethnographyAhmed_Abdelmegeed#WA 2ms3480kbC++201.5kb2023-03-09 22:02:202023-03-09 22:02:23

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-09 22:02:23]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3480kb
  • [2023-03-09 22:02:20]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ld long double
#define el "\n"
#define matrix vector<vector<int>>
#define pt complex<ld>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_multiset tree<ll, null_type,less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update>
using namespace __gnu_pbds;
using namespace std;
const ll N = 1e5 + 5, LOG = 20, INF = 1e18;
const ld pi = acos(-1);
const ll mod = 1e9 + 7;
const ld eps = 1e-12;
int dx[] = {0, 1, 0, -1, -1, 1, -1, 1};
int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
ll n, m, x, y, k;

void dowork() {
    cin >> x >> y;
    ll ans = 0, num, tmp;
    string s;
    set<ll>st;
    for (ll i = 1; i * i <= y; i++) {
        num = i * i;
        s = to_string(num);
        reverse(s.begin(), s.end());
        num = stoll(s);
        tmp = sqrt(num);
        if (tmp * tmp == num && num <= y && num >= x && i * i >= x && i * i <= y && s[0] != '0') {
            st.insert(num);
            //cout << num << el;
        }
    }
    cout << st.size() << el;
}

signed main() {
    fast
    //freopen("lis.in", "r", stdin);
    //freopen("bitwise.out", "w", stdout);
    int t = 1;
    //cin >> t;
    for (int i = 1; i <= t; i++) {
        dowork();
    }
    return 0;
}

详细

Test #1:

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

input:

1
1000

output:

10

result:

ok 1 number(s): "10"

Test #2:

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

input:

20
40

output:

0

result:

ok 1 number(s): "0"

Test #3:

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

input:

80
100

output:

0

result:

ok 1 number(s): "0"

Test #4:

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

input:

1
1

output:

1

result:

ok 1 number(s): "1"

Test #5:

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

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: 3384kb

input:

18
86

output:

0

result:

ok 1 number(s): "0"

Test #8:

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

input:

10
61

output:

0

result:

ok 1 number(s): "0"

Test #9:

score: -100
Wrong Answer
time: 0ms
memory: 3472kb

input:

239
1488

output:

2

result:

wrong answer 1st numbers differ - expected: '5', found: '2'