結果
| 問題 |
No.2872 Depth of the Parentheses
|
| コンテスト | |
| ユーザー |
ニックネーム
|
| 提出日時 | 2024-09-06 22:06:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 139 ms / 2,000 ms |
| コード長 | 315 bytes |
| コンパイル時間 | 215 ms |
| コンパイル使用メモリ | 82,368 KB |
| 実行使用メモリ | 152,036 KB |
| 最終ジャッジ日時 | 2024-09-06 22:06:22 |
| 合計ジャッジ時間 | 17,559 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 TLE * 5 |
ソースコード
x,k = map(int,input().split())
z = 998244353; p = 0
for s in range(1<<2*k):
c = d = 0; f = 1; m = s.bit_count()
for i in range(2*k):
if s>>i&1: c += 1; d = max(d,c)
elif c: c -= 1
else: f = 0; break
if f and c==0: p += pow(x,m,z)*pow(100-x,2*k-m,z)%z*d
print(p*pow(100,-2*k,z)%z)
ニックネーム