QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#583178 | #9381. 502 Bad Gateway | slmhh | WA | 134ms | 3740kb | C++23 | 577b | 2024-09-22 18:47:11 | 2024-09-22 18:47:11 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PII;
const int N = 2e5;
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int T;
cin >> T;
while(T--){
ll n;
cin >> n;
double t = sqrt(8 * n + 1);
ll a = -1 + (ll)t,b = -1 + ceil(t);
ll ta = 2,tb = 2;
if(a % 2 == 0) a /= 2,ta = 1;
if(b % 2 == 0) b /= 2,tb = 1;
if(a * tb > b * ta) cout << b << " " << tb << "\n";
else cout << a << " " << ta << "\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3740kb
input:
3 1 2 3
output:
1 1 3 2 2 1
result:
ok 3 lines
Test #2:
score: -100
Wrong Answer
time: 134ms
memory: 3528kb
input:
1000000 1 1000000000 1 1 1000000000 1 1000000000 1 1 1 1000000000 1 1 1000000000 1 1000000000 1000000000 1 1000000000 1 1 1000000000 1 1000000000 1000000000 1 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1 1 1000000000 1 1000000000 1000000000 1000000000 1000000000 1 1 1 10000000...
output:
1 1 89441 2 1 1 1 1 89441 2 1 1 89441 2 1 1 1 1 1 1 89441 2 1 1 1 1 89441 2 1 1 89441 2 89441 2 1 1 89441 2 1 1 1 1 89441 2 1 1 89441 2 89441 2 1 1 89441 2 89441 2 89441 2 89441 2 89441 2 89441 2 1 1 1 1 89441 2 1 1 89441 2 89441 2 89441 2 89441 2 1 1 1 1 1 1 89441 2 89441 2 89441 2 1 1 89441 2 1 1 ...
result:
wrong answer 2nd lines differ - expected: '1999961560 44721', found: '89441 2'