QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#586838 | #9381. 502 Bad Gateway | YuLan# | WA | 320ms | 3708kb | C++14 | 582b | 2024-09-24 15:55:55 | 2024-09-24 15:55:56 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+10;
typedef long long ll;
ll a[N];
ll w[N],v[N],c[N];
struct node
{
ll w,c;
node(ll w1,ll c1)
{
w = w1;
c = c1;
}
bool operator < (const node &b) const
{
return c*b.w < w*b.c;
}
};
ll gcd(ll x,ll y)
{
return y==0?x:gcd(y,x%y);
}
int main()
{
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
ll x,y;
cin>>x;
y = x;
x = (1ll+x)*x/2ll;
ll temp = gcd(x,y);
cout<<x/temp<<" "<<y/temp<<endl;
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3700kb
input:
3 1 2 3
output:
1 1 3 2 2 1
result:
ok 3 lines
Test #2:
score: -100
Wrong Answer
time: 320ms
memory: 3708kb
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 1000000001 2 1 1 1 1 1000000001 2 1 1 1000000001 2 1 1 1 1 1 1 1000000001 2 1 1 1 1 1000000001 2 1 1 1000000001 2 1000000001 2 1 1 1000000001 2 1 1 1 1 1000000001 2 1 1 1000000001 2 1000000001 2 1 1 1000000001 2 1000000001 2 1000000001 2 1000000001 2 1000000001 2 1000000001 2 1 1 1 1 1000000001 ...
result:
wrong answer 2nd lines differ - expected: '1999961560 44721', found: '1000000001 2'