結果
問題 |
No.143 豆
|
ユーザー |
![]() |
提出日時 | 2017-02-23 06:45:02 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 699 bytes |
コンパイル時間 | 868 ms |
コンパイル使用メモリ | 107,724 KB |
実行使用メモリ | 26,260 KB |
最終ジャッジ日時 | 2024-12-31 10:32:31 |
合計ジャッジ時間 | 1,966 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 6 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
class Program { static void Main(string[] args) { string line = System.Console.ReadLine().Trim(); string[] Data = line.Split(' '); int K = int.Parse(Data[0]); int N = int.Parse(Data[1]); int F = int.Parse(Data[2]); int totalbeans = K * N; line = System.Console.ReadLine().Trim(); Data = line.Split(' '); for (int i = 0; i < F; i++) { int age = int.Parse(Data[i]); totalbeans = totalbeans - age; if (totalbeans < 0) { System.Console.WriteLine(-1); } } System.Console.WriteLine(totalbeans); return; } }