結果
問題 | No.49 算数の宿題 |
ユーザー |
![]() |
提出日時 | 2015-09-06 08:19:17 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 13 ms / 5,000 ms |
コード長 | 650 bytes |
コンパイル時間 | 128 ms |
コンパイル使用メモリ | 7,076 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-23 01:46:36 |
合計ジャッジ時間 | 854 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
S = raw_input()res = 0tmp = 0plus = Falsemult = Falsefor x in range(len(S)):if (S[x] == '*'):if (plus):res += tmpelif (mult):res *= tmpelse:res = tmpplus = mult = Falseplus = Truetmp = 0elif (S[x] == '+'):if (plus):res += tmpelif (mult):res *= tmpelse:res = tmpplus = mult = Falsemult = Truetmp = 0else:tmp = 10 * tmp + int(S[x])if (plus):res += tmpelif (mult):res *= tmpelse:res = tmpprint res