結果
問題 |
No.143 豆
|
ユーザー |
![]() |
提出日時 | 2018-09-05 09:19:20 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 28 ms / 1,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 1,018 ms |
コンパイル使用メモリ | 112,992 KB |
実行使用メモリ | 26,976 KB |
最終ジャッジ日時 | 2024-07-23 11:03:48 |
合計ジャッジ時間 | 2,336 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.Linq; using System; public class Paiza { public static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var k = int.Parse(line[0]); var n = int.Parse(line[1]); line = Console.ReadLine().Trim().Split(' '); var a = Array.ConvertAll(line, int.Parse); var w = k * n - a.Sum(); Console.WriteLine(w >= 0 ? w : -1); } }