結果

問題 No.505 カードの数式2
ユーザー convexineqconvexineq
提出日時 2021-02-12 05:24:57
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 236 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 79,080 KB
最終ジャッジ日時 2023-09-25 19:20:22
合計ジャッジ時間 5,682 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 69 ms
71,240 KB
testcase_03 AC 71 ms
71,112 KB
testcase_04 RE -
testcase_05 AC 71 ms
70,956 KB
testcase_06 AC 70 ms
71,244 KB
testcase_07 RE -
testcase_08 AC 72 ms
71,300 KB
testcase_09 RE -
testcase_10 AC 72 ms
70,996 KB
testcase_11 AC 72 ms
71,248 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 70 ms
71,184 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 70 ms
71,164 KB
testcase_18 AC 69 ms
71,236 KB
testcase_19 RE -
testcase_20 AC 69 ms
71,284 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 AC 74 ms
70,948 KB
testcase_29 AC 69 ms
71,216 KB
testcase_30 RE -
testcase_31 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
p = n = a[0]
for x in a[1:]:
    c = abs(p)//abs(x)*(abs(p*x)//(p*x))
    d = abs(n)//abs(x)*(abs(n*x)//(n*x))
    lst = [p*x,p+x,p-x,n*x,n+x,n-x,c,d]
    p,n = max(lst), min(lst)
print(p)
0