結果

問題 No.143 豆
ユーザー ub_nyaoiixub_nyaoiix
提出日時 2016-12-17 16:15:01
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 1,000 ms
コード長 392 bytes
コンパイル時間 2,046 ms
コンパイル使用メモリ 99,452 KB
実行使用メモリ 22,864 KB
最終ジャッジ日時 2023-09-30 16:54:38
合計ジャッジ時間 3,948 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
20,760 KB
testcase_01 AC 59 ms
20,832 KB
testcase_02 AC 58 ms
20,720 KB
testcase_03 AC 58 ms
20,792 KB
testcase_04 AC 59 ms
20,872 KB
testcase_05 AC 60 ms
22,864 KB
testcase_06 AC 59 ms
20,648 KB
testcase_07 AC 58 ms
20,876 KB
testcase_08 AC 58 ms
20,816 KB
testcase_09 AC 59 ms
22,760 KB
testcase_10 AC 59 ms
22,688 KB
testcase_11 AC 58 ms
18,736 KB
testcase_12 AC 58 ms
20,720 KB
testcase_13 AC 58 ms
18,684 KB
testcase_14 AC 58 ms
18,604 KB
testcase_15 AC 58 ms
22,824 KB
testcase_16 AC 58 ms
20,852 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Q0143
{
	public static void Main()
	{
		string[] input0 = Console.ReadLine().Split(' ');
		int k = int.Parse(input0[0]);
		int n = int.Parse(input0[1]);
		int f = int.Parse(input0[2]);

		int bean = k * n;

		string[] input1 = Console.ReadLine().Split(' ');
		for (int i=0; i<f; i++)
		{
			bean -= int.Parse(input1[i]);
		}

		Console.WriteLine(bean<0 ? -1 : bean);
	}
}
0