結果

問題 No.143 豆
ユーザー dashi_dragons
提出日時 2017-02-10 03:10:50
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 1,000 ms
コード長 400 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-23 10:40:19
合計ジャッジ時間 1,298 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(a,b,x):
	if x < a or x > b:
		sys.exit()

import sys

list1 = input().split(' ')

K = int(list1[0])
N = int(list1[1])
F = int(list1[2])

check(1,1000,K)
check(1,1000,N)
check(1,100,F)

list2 = input().split(' ')

if len(list2) != F:
	sys.exit()

sum = K * N

for i in range(0,F):

	list2[i] = int(list2[i])
	check(1,100,list2[i])
	sum -= list2[i]

if sum >= 0:
	print(sum)
else:
	print(-1)
0