結果
| 問題 | No.505 カードの数式2 |
| コンテスト | |
| ユーザー |
h_noson
|
| 提出日時 | 2017-06-13 23:46:36 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 249 bytes |
| 記録 | |
| コンパイル時間 | 329 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-04-11 20:20:22 |
| 合計ジャッジ時間 | 4,421 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 9 WA * 20 |
ソースコード
n = int(input())
a = list(map(int,input().split(' ')))
i = 0
while i < n and a[i] == 0: i += 1
if i == n:
print(0)
exit(0)
ans = abs(a[i])
i += 1
for x in a[i:]:
if x in [0,1]:
ans += x
else:
ans *= abs(x)
print(ans)
h_noson