QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#494587 | #5003. Etched Emerald Orbs | Ink_bai | WA | 15ms | 3948kb | C++14 | 633b | 2024-07-27 16:15:49 | 2024-07-27 16:15:50 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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'