QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#152399#6423. Fireworksqzez#WA 2ms4012kbC++14894b2023-08-28 07:34:332023-08-28 07:34:35

Judging History

你现在查看的是最新测评结果

  • [2023-08-28 07:34:35]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:4012kb
  • [2023-08-28 07:34:33]
  • 提交

answer

#include<bits/stdc++.h>
#define Gc() getchar() 
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define d(x,y) ((m)*(x-1)+(y))
#define R(n) (rnd()%(n)+1)
#define Pc(x) putchar(x)
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
using namespace std;using ll=long long;using db=double;using lb=long db;using ui=unsigned;using ull=unsigned long long;using pii=pair<int,int>;using LL=__int128;
const int N=1e6+5,M=3e5+5,K=(1<<15)+5,mod=998244353,Mod=mod-1;const db eps=1e-9;const int INF=1e9+7;mt19937 rnd(time(0));
int n,m,p;
void Solve(){
	int i,j;scanf("%d%d%d",&n,&m,&p);
	db ans=1e18;
	db t=1;
	for(i=1;i<=1e4;i++){
		t=t*(1-p/1e4);
		ans=min(ans,1/(1-t)*(n*i+m));
	}
	printf("%.9lf\n",ans);
}
int main(){
	int t;
	scanf("%d",&t);
	// t=1;
	while(t--) Solve();
	cerr<<clock()*1.0/CLOCKS_PER_SEC<<'\n';
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 4012kb

input:

3
1 1 5000
1 1 1
1 2 10000

output:

4.000000000
10141.585289115
3.000000000

result:

ok 3 numbers

Test #2:

score: 0
Accepted
time: 2ms
memory: 3848kb

input:

20
10 27 2855
79 59 6888
65 72 7725
78 50 2888
31 21 5759
41 58 6619
47 27 3881
35 55 5095
77 7 6028
17 89 1792
84 60 8604
58 44 4923
88 27 3824
54 63 1482
19 42 5366
93 76 97
100 99 8660
96 36 4343
90 56 9515
24 44 9922

output:

89.729805651
200.348432056
177.346278317
416.839877800
90.293453725
149.569421363
190.672507086
164.601521116
139.349701393
275.133110248
167.364016736
207.190737355
300.732217573
589.058848951
101.877028212
10796.887266905
229.792147806
303.937370481
153.441933789
68.534569643

result:

ok 20 numbers

Test #3:

score: -100
Wrong Answer
time: 2ms
memory: 3960kb

input:

10
954269343 987322500 9806
916720797 981711601 9728
902477101 957414437 9250
967013471 988735825 9674
985383693 926528961 9411
970653208 917703218 9331
998423148 911924940 9283
986159007 902133513 9759
953796828 947934512 9959
995334734 931874197 9944

output:

-2147376429.000000000
-2147277089.000000000
-2147011630.000000000
-2147467204.000000000
-2147380339.000000000
-2147376054.000000000
-2146899140.000000000
-2146689167.000000000
-2146877352.000000000
-2145575777.000000000

result:

wrong answer 1st numbers differ - expected: '1980003919.02917', found: '-2147376429.00000', error = '2.08453'