QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#175959#5503. Euclidean AlgorithmaaaaaWA 0ms3592kbC++17819b2023-09-11 06:42:142023-09-11 06:42:15

Judging History

This is the latest submission verdict.

  • [2023-09-11 06:42:15]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3592kb
  • [2023-09-11 06:42:14]
  • Submitted

answer

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll T;
ll N;
ll answer;

int main() {
    cin.tie(0)->sync_with_stdio(0);
    
    cin >> T;
    while (T--) {
        cin >> N;
        answer = 0LL;
        for (ll a=1LL; (a*a*a)<=N; a++) {
            if (a*(a*a+1) <= N) {
                answer += 1;
            }
            answer += 2*max((N/a-1)/a-a, 0LL);
            answer += max(N/(a*a+1)-a, 0LL);
            for (ll b=a+1; a*b*b<=N; b++) {
                if (a * (b * b + 1) <= N) answer += 1;
        if (b * (a * b + 1) <= N) answer += 2;
        answer += 2 * max((N / a - 1) / b - b, 0LL);
        answer += 2 * max((N / b - 1) / a - b, 0LL);
        answer += 2 * max(N / (a * b + 1) - b, 0LL);
            }
        }
    }

    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3592kb

input:

3
2
5
14

output:


result:

wrong answer 1st lines differ - expected: '1', found: ''