用户输出
4.0000000
Special Judge 信息
OK Error:0.00000000000000000000
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#68871 | #1030. 1-03E. JM的星系战争 | Accepted | 100 | 132 ms | 1924 K | C++ 11 / 906 B | 该起什么名字 | 2022-04-16 20:30:01 |
#include <bits/stdc++.h>
#define F(i, n, m) for (int i = n; i < m; i++)
#define f(i, n, m) for (int i = n; i > m; i--)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;
inline int read() {
int num = 0;
char c;
bool flag = false;
while ((c = getchar()) == ' ' || c == '\n' || c == '\r')
;
if (c == '-')
flag = true;
else
num = c - '0';
while (isdigit(c = getchar())) num = num * 10 + c - '0';
return (flag ? -1 : 1) * num;
}
int a[200005], b[200005];
int main() {
std::ios::sync_with_stdio(false);
int n, m;
n = read();
m = read();
int flag = 1;
F(i, 0, n) {
a[i] = read();
b[i] = read();
if (a[i] == 1 || b[i] == 1) {
cout << -1;
return 0;
}
}
double ans = m;
ans /= (a[0] - 1);
f(i, n - 1, -1) {
ans += (ans + m) / (b[i] - 1);
if (i)
ans += (ans + m) / (a[i] - 1);
}
if (ans > 0)
printf("%.7f", ans);
else
cout << -1;
return 0;
}
用户输出
4.0000000
Special Judge 信息
OK Error:0.00000000000000000000
系统信息
Exited with return code 0
用户输出
-1
Special Judge 信息
OK Error:0.00000000000000000000
系统信息
Exited with return code 0
用户输出
85.4800000
Special Judge 信息
OK Error:0.00000000000000000000
系统信息
Exited with return code 0
用户输出
284.0000000
Special Judge 信息
OK Error:0.00000000000000000000
系统信息
Exited with return code 0
用户输出
159.2650775
Special Judge 信息
OK Error:0.00000050000000000050
系统信息
Exited with return code 0
106 947
647 4
940 883
12 867
102 282
424 472
79 85
762 99
579 583
235 196
263 484
350 69
<835 bytes omitted>
用户输出
2982.0344797
Special Judge 信息
OK Error:0.00000030000000017516
系统信息
Exited with return code 0
520 396
825 67
386 870
498 473
433 81
718 722
183 477
672 826
874 485
468 632
520 833
975
<4474 bytes omitted>
用户输出
1542017.2509230
Special Judge 信息
OK Error:0.00000000000000000000
系统信息
Exited with return code 0
738 169
131 889
340 59
49 946
219 427
861 675
96 195
228 622
215 667
955 476
95 51
810 19
<6391 bytes omitted>
用户输出
4527411.2686897
Special Judge 信息
OK Error:0.00000030000001061126
系统信息
Exited with return code 0
987 682
60 423
401 779
677 116
319 821
919 588
740 251
358 231
274 312
623 796
378 933
18
<8586 bytes omitted>
用户输出
-1
Special Judge 信息
OK Error:0.00000000000000000000
系统信息
Exited with return code 0
473 199
406 734
712 238
564 108
117 841
598 16
48 900
725 705
247 258
929 538
90 627
804
<4052 bytes omitted>
用户输出
-1
Special Judge 信息
OK Error:0.00000000000000000000
系统信息
Exited with return code 0
59750 2281
93567 44021
47430 98340
9559 55192
27106 80521
22955 42810
48320 85590
81770 90294
<763196 bytes omitted>
用户输出
745083116.7712559
Special Judge 信息
OK Error:0.00000790000194683671
系统信息
Exited with return code 0
200000 364
4699406 7476559
3074519 9220641
9953397 4609875
5011840 8555716
9299532 7782002
680
<3363507 bytes omitted>
用户输出
74.3850411
Special Judge 信息
OK Error:0.00000009999999999594
系统信息
Exited with return code 0
23821 7264
75949 33096
91115 42348
81152 81964
27272 91134
28847 96689
86108 29747
30204 5578
<304247 bytes omitted>
用户输出
769628.1618721
Special Judge 信息
OK Error:0.00000009999996564147
系统信息
Exited with return code 0
35768 2145
55319 25036
49408 9299
49217 39951
90958 77142
44396 13466
8576 98650
36023 62002
<456877 bytes omitted>
用户输出
5955028.9748108
Special Judge 信息
OK Error:0.00000020000015865662
系统信息
Exited with return code 0
66177 13
14609 92016
32279 95577
60901 20717
1545 39312
82239 94186
55303 88326
52979 70206
<845575 bytes omitted>
用户输出
29613563.7616364
Special Judge 信息
OK Error:0.00000040000122680794
系统信息
Exited with return code 0
200000 182730
51203472 887121657
889997928 717080718
101945687 541029100
340190334 398852700
41
<4155289 bytes omitted>
用户输出
1033.6276916
Special Judge 信息
OK Error:0.00000040000000001150
系统信息
Exited with return code 0
200000 795860
187377578 44646426
558344784 913526041
339835037 509114477
549140685 797619990
22
<4155454 bytes omitted>
用户输出
5247.4849675
Special Judge 信息
OK Error:0.00000049999999962580
系统信息
Exited with return code 0