結果

問題 No.297 カードの数式
ユーザー roiti46roiti46
提出日時 2015-11-26 16:32:56
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 6,708 KB
実行使用メモリ 6,260 KB
最終ジャッジ日時 2023-10-11 18:48:02
合計ジャッジ時間 1,638 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,048 KB
testcase_01 AC 11 ms
6,060 KB
testcase_02 AC 12 ms
6,060 KB
testcase_03 AC 12 ms
6,156 KB
testcase_04 AC 11 ms
5,964 KB
testcase_05 AC 11 ms
6,084 KB
testcase_06 WA -
testcase_07 AC 11 ms
6,060 KB
testcase_08 AC 11 ms
6,192 KB
testcase_09 AC 11 ms
5,980 KB
testcase_10 AC 11 ms
6,000 KB
testcase_11 AC 11 ms
5,976 KB
testcase_12 AC 12 ms
6,088 KB
testcase_13 AC 11 ms
6,136 KB
testcase_14 AC 11 ms
6,056 KB
testcase_15 AC 11 ms
6,196 KB
testcase_16 AC 11 ms
5,964 KB
testcase_17 AC 11 ms
6,152 KB
testcase_18 AC 11 ms
6,056 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 11 ms
5,968 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
s = sorted(raw_input().split(), reverse = True)
for i in xrange(N):
    if s[i] == "+" or s[i] == "-":
        e = s[i:][::-1]
        s = s[:i]
        break
while len(s) > len(e) + 1:
    t = s[0]
    s = s[1:]
    s[0] = t + s[0]
    
emx, emn = "", ""
for i in xrange(len(e)):
    emx += s[i] + e[i]
    emn += s[-i-1] + e[i]
emx += s[-1]
emn += s[0]
print eval(emx), eval(emn)
0