結果
問題 |
No.143 豆
|
ユーザー |
|
提出日時 | 2022-05-25 13:33:50 |
言語 | C# (.NET 8.0.404) |
結果 |
WA
|
実行時間 | - |
コード長 | 703 bytes |
コンパイル時間 | 7,623 ms |
コンパイル使用メモリ | 168,112 KB |
実行使用メモリ | 185,904 KB |
最終ジャッジ日時 | 2024-09-20 14:46:23 |
合計ジャッジ時間 | 9,353 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 WA * 1 MLE * 1 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (98 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System; namespace yukicoder { class Program { static void Main(string[] args) { string[] str = Console.ReadLine().Split(' '); string[] str1 = Console.ReadLine().Split(' '); int a = int.Parse(str[0]); int b = int.Parse(str[1]); int c = int.Parse(str[2]); int num = 0; for(int i = 0; i < c; i++) { num += int.Parse(str1[i]); } int ans = (a * b) - num; if (ans > 0) { Console.WriteLine(ans.ToString()); return; } Console.WriteLine("-1"); } } }