結果

問題 No.1122 Plane Tickets
ユーザー 双六双六
提出日時 2020-07-22 22:05:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 668 bytes
コンパイル時間 1,675 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 72,948 KB
最終ジャッジ日時 2023-09-04 20:37:46
合計ジャッジ時間 10,286 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
72,732 KB
testcase_01 AC 111 ms
72,824 KB
testcase_02 AC 111 ms
72,524 KB
testcase_03 AC 111 ms
72,796 KB
testcase_04 AC 111 ms
72,676 KB
testcase_05 AC 111 ms
72,476 KB
testcase_06 AC 109 ms
72,600 KB
testcase_07 AC 112 ms
72,624 KB
testcase_08 WA -
testcase_09 AC 111 ms
72,604 KB
testcase_10 AC 111 ms
72,320 KB
testcase_11 AC 112 ms
72,524 KB
testcase_12 AC 113 ms
72,580 KB
testcase_13 AC 113 ms
72,608 KB
testcase_14 AC 113 ms
72,712 KB
testcase_15 AC 111 ms
72,852 KB
testcase_16 AC 113 ms
72,604 KB
testcase_17 AC 113 ms
72,552 KB
testcase_18 AC 114 ms
72,808 KB
testcase_19 AC 114 ms
72,792 KB
testcase_20 AC 115 ms
72,552 KB
testcase_21 AC 112 ms
72,704 KB
testcase_22 AC 111 ms
72,624 KB
testcase_23 AC 111 ms
72,316 KB
testcase_24 WA -
testcase_25 AC 111 ms
72,696 KB
testcase_26 AC 112 ms
72,324 KB
testcase_27 AC 113 ms
72,408 KB
testcase_28 WA -
testcase_29 AC 112 ms
72,864 KB
testcase_30 AC 112 ms
72,592 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 113 ms
72,604 KB
testcase_35 AC 111 ms
72,784 KB
testcase_36 AC 111 ms
72,592 KB
testcase_37 AC 111 ms
72,592 KB
testcase_38 AC 112 ms
72,580 KB
testcase_39 AC 110 ms
72,808 KB
testcase_40 AC 112 ms
72,540 KB
testcase_41 AC 110 ms
72,632 KB
testcase_42 AC 113 ms
72,508 KB
testcase_43 AC 113 ms
72,756 KB
testcase_44 AC 110 ms
72,416 KB
testcase_45 AC 111 ms
72,704 KB
testcase_46 AC 112 ms
72,696 KB
testcase_47 AC 110 ms
72,528 KB
testcase_48 AC 110 ms
72,472 KB
testcase_49 WA -
testcase_50 AC 111 ms
72,600 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")
import copy
import itertools

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	A = getlist()
	seq = [0, 1, 2, 3, 4]
	P = list(itertools.permutations(seq, 5))
	ans = 0
	N = len(P)
	for i in range(N):
		val = 0
		B = copy.copy(A)
		s = P[i]
		for j in range(5):
			itr = s[j]
			m = min(B[(itr - 1) % 5], B[itr % 5], B[(itr + 1) % 5])
			B[(itr - 1) % 5] -= m
			B[itr % 5] -= m
			B[(itr + 1) % 5] -= m
			val += m

		ans = max(ans, val)

	print(ans)

if __name__ == '__main__':
	main()
0