QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#577106 | #6889. PSO | JZYZ# | AC ✓ | 40ms | 3856kb | C++14 | 356b | 2024-09-20 08:00:38 | 2024-09-20 08:00:40 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std ;
typedef long long LL ;
const int N = 1e6+10 ;
int T , n ;
int main()
{
scanf("%d" , &T ) ;
while( T -- ) {
scanf("%d" , &n ) ;
if( n == 2 ) {
printf("%.9f %.9f\n" , 1.0 , 1.0 ) ;
}
else printf("%.9f %.9f\n" , (1.0*(n-1)*(n-2)+(n-1))/(1.0*n*(n-1)/2) , 2.0 ) ;
}
return 0 ;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 40ms
memory: 3856kb
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