QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#86455#1902. Computational ethnographytriplem5ds#WA 2ms3396kbC++201.9kb2023-03-09 21:57:372023-03-09 21:57:40

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 21:57:40]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3396kb
  • [2023-03-09 21:57:37]
  • 提交

answer

///Enta etfsh5t nseet el rank

#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")

#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

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>;
#define pb push_back
#define F first
#define S second
#define f(i, a, b) for (int i = a; i < b; i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(x) (int)(x).size()
//#define mp(x, y) make_pair(x, y)
#define popCnt(x) (__builtin_popcountll(x))
#define int ll

using ll = long long;
using ull = unsigned long long;
using uint = uint32_t;
using ii = pair<int, int>;

const int N = 3e6 + 6, A = 26, LG = 18, MOD = (119 << 23) + 1;
const long double PI = acos(-1);
const long double EPS = 1e-9;
const ll INF = 1e15;

bool isSquare(int x) {
    int lo = 1, hi = 1e6;

    while (lo < hi) {
        int md = lo + (hi - lo) / 2;
        if (md * md >= x)
            hi = md;
        else
            lo = md + 1;
    }
    return lo * lo == x;
}

int rev(int x) {
    if (x % 10 == 0)return 0;
    int ret = 0;
    while (x) {
        ret = ret * 10 + (x % 10);
        x /= 10;
    }
    return ret;
}


void doWork() {

    int L, R;
    cin >> L >> R;
    int ans = 0;
    for (int i = 1; i * i <= R; i++) {
        if (i * i >= L && isSquare(rev(i * i))) {
            cout << i * i << '\n';
        }
    }
    cout << ans << '\n';

}


int32_t main() {
#ifdef ONLINE_JUDGE
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif // ONLINE_JUDGE
    int t = 1;
//    cin >> t;
    while (t--)
        doWork();

    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3396kb

input:

1
1000

output:

1
4
9
121
144
169
441
484
676
961
0

result:

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