QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#408153 | #6889. PSO | xuzhihaodedie# | AC ✓ | 55ms | 3788kb | C++20 | 758b | 2024-05-09 19:04:28 | 2024-05-09 19:04:42 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define PII pair<int,int>
#define lson 2*p
#define rson 2*p+1
#define x first
#define y second
//#define endl "\n"
constexpr int N=1e6+10;
constexpr int mod=998244353;
int b[N],a[N];
struct node {
int a,b;
} f[N];
bool cmp(node a,node b) {
return a.a+a.b>b.a+b.b;
}
void solve() {
int n;
cin>>n;
if(n==2) {
double ret=1;
printf("%.9lf %.9lf\n",ret,ret);
return ;
}
double ans=n-1+(n-1)*(n-2);
double res=n*(n-1)/2;
printf("%.9lf 2.000000000\n",ans/res);
}
signed main() {
// ios::sync_with_stdio(false);
// cin.tie(0);
int T=1;
cin>>T;
while(T--) {
solve();
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 55ms
memory: 3788kb
input:
100000 1000000000 316282544 8750007 736358249 599449905 958797884 57807155 190721739 49078691 54519372 197507191 189770390 669595503 625443707 681627652 859163225 633903516 942163948 162318847 907559014 367667214 702553026 250779315 583592021 539773972 398355366 716540172 8874879 281470171 909896004...
output:
1.999999998 2.000000000 1.999999994 2.000000000 1.999999771 2.000000000 1.999999997 2.000000000 1.999999997 2.000000000 1.999999998 2.000000000 1.999999965 2.000000000 1.999999990 2.000000000 1.999999959 2.000000000 1.999999963 2.000000000 1.999999990 2.000000000 1.999999989 2.000000000 1.999999997 ...
result:
ok 100000 lines