結果
| 問題 |
No.265 数学のテスト
|
| コンテスト | |
| ユーザー |
matsu7874
|
| 提出日時 | 2015-08-07 23:14:33 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 766 bytes |
| コンパイル時間 | 216 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-07-18 05:19:15 |
| 合計ジャッジ時間 | 2,114 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 32 |
ソースコード
def bibun(n,c):
if n<c:
return 0
res = 1
for i in range(c):
res *= n
n -= 1
return res
def main():
N = int(input())
d = int(input())
S = input()
A = [0 for i in range(d+1)]
d_cnt = 0
x_cnt = 0
a = 1
pre = ''
for s in S:
if s in '123456789':
a *= int(s)
elif s == '{':
d_cnt += 1
elif s == '}':
A[x_cnt] += a*bibun(x_cnt, d_cnt)
x_cnt = 0
a = 1
d_cnt -= 1
elif s == '*':
pass
elif s == '+':
A[x_cnt] += a*bibun(x_cnt, d_cnt)
x_cnt = 0
a = 1
elif s == 'x':
x_cnt += 1
if __name__ == '__main__':
main()
matsu7874