QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#197434 | #6889. PSO | haze | AC ✓ | 33ms | 3508kb | C++23 | 848b | 2023-10-02 15:54:06 | 2023-10-02 15:54:07 |
Judging History
answer
#include<bits/stdc++.h>
#define irep(i,l,r) for(int i = l; i <= r; ++i)
#define drep(i,r,l) for(int i = r; i >= l; --i)
#define ceil(pp,qq) (((pp)>0)^((qq)>0)?-Abs(pp)/Abs(qq):(pp)%(qq)?(pp)/(qq)+1:(pp)/(qq))
#define floor(pp,qq) (((pp)>0)^((qq)>0)?-ceil(abs(pp),abs(qq)):(pp)/(qq))
#define ll long long
using namespace std;
ll Abs(ll x){return x > 0 ? x : - x;}
inline ll read(){
char ch = getchar();
ll s = 0; bool w = 0;
while(!isdigit(ch)){if(ch == '-')w = 1;ch = getchar();}
while(isdigit(ch))s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
return w ? - s : s;
}
const int itinf = 2e9;
const ll llinf = 4e18;
const int mod = 1000000007;
const int N = 500009;
int main(){
int T = read();
while(T--){
int n = read();
printf("%0.9lf %0.9lf\n", 2.00 * (n - 1) / n, n == 2 ? 1.0 : 2.0);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 33ms
memory: 3508kb
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