結果
問題 | No.265 数学のテスト |
ユーザー |
|
提出日時 | 2015-08-07 23:00:53 |
言語 | Python2 (2.7.18) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 661 bytes |
コンパイル時間 | 90 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 13,756 KB |
最終ジャッジ日時 | 2024-07-18 05:15:16 |
合計ジャッジ時間 | 3,523 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | AC * 1 TLE * 1 -- * 30 |
ソースコード
N = int(raw_input())d = int(raw_input())S = raw_input()ans = [0] * (d + 1)dx = 0tmp = 1cnt = 0exp = Falsefor c in S:if c == "{":dx += 1elif c == "x":exp = Truecnt += 1elif c in "123456789":exp = Truetmp = int(c)elif c != "*":if exp:for i in xrange(dx):tmp *= cnt - iif cnt - dx >= 0:ans[cnt - dx] += tmpexp = Falsecnt = 0tmp = 1if c == "}":dx -= 1if exp:for i in xrange(dx):tmp *= cnt - ians[cnt - dx] += tmpprint " ".join(map(str, ans))