QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#494587#5003. Etched Emerald OrbsInk_baiWA 15ms3948kbC++14633b2024-07-27 16:15:492024-07-27 16:15:50

Judging History

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

  • [2024-07-27 16:15:50]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:3948kb
  • [2024-07-27 16:15:49]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define uint unsigned long long
#define int long long
#define endl '\n'
const int N = 1e4 + 5;
typedef pair<int, int> PII;
#define MAX LONG_LONG_MAX

int a[N], b[N], c[N];
void solve()
{
    int k;
    cin >> k;
    int res = k + 1;
    double q;
    for (;; res++)
    {
        int x = res * (res - k);
         q = sqrt(x);
        if (q - (int)q == 0)
        {
            break;
        }
    }
    cout << res - q << " " << res + q << endl;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);

    solve();
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3872kb

input:

5

output:

3 15

result:

ok single line: '3 15'

Test #2:

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

input:

7

output:

4 28

result:

ok single line: '4 28'

Test #3:

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

input:

2625

output:

2415 2875

result:

ok single line: '2415 2875'

Test #4:

score: -100
Wrong Answer
time: 15ms
memory: 3948kb

input:

3874168794131721959

output:

3.87417e+18 3.87417e+18

result:

wrong answer 1st lines differ - expected: '3744304003028637896 4013365524702817208', found: '3.87417e+18 3.87417e+18'