We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b89a6a8 commit c1c4732Copy full SHA for c1c4732
Codeforces/259A.py
@@ -0,0 +1,10 @@
1
+#AC
2
+import re
3
+
4
+for i in range(8):
5
+ s = input()
6
+ if re.findall(r'(WW)|(BB)', s):
7
+ print('NO')
8
+ exit(0)
9
10
+print('YES')
SPOJ/LOOPEXP.cpp
@@ -0,0 +1,28 @@
+/* AC
+- The position of the maximum number is important.
+- Linearity of expectation.
+*/
+#include <bits/stdc++.h>
+using namespace std;
+int main()
+{
11
+ long double dp[100001];
12
+ dp[0] = 0;
13
+ long double ans = 0;
14
+ for (int n=1;n<=100000;n++)
15
+ {
16
+ dp [n] = (ans/n) + 1;
17
+ ans += dp[n];
18
+ }
19
20
+ int t;
21
+ cin>>t;
22
+ while(t--)
23
24
+ int n;
25
+ cin>>n;
26
+ cout<<fixed<<setprecision(9)<<dp[n]<<"\n";
27
28
+}
0 commit comments