結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-17 10:34:38 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 1,000 ms |
| コード長 | 572 bytes |
| コンパイル時間 | 1,289 ms |
| コンパイル使用メモリ | 112,668 KB |
| 実行使用メモリ | 27,372 KB |
| 最終ジャッジ日時 | 2024-07-23 10:46:05 |
| 合計ジャッジ時間 | 1,976 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
class Progaram
{
static void Main()
{
int[] input = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
int 豆 = input[0] * input[1];
int 人数 = input[2];
int[] 豆の数 = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
foreach(int i in 豆の数)
{
豆 -= i;
if(豆 < 0) {
Console.WriteLine(-1);
return;
}
}
Console.WriteLine(豆);
}
}