結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-01-24 10:11:17 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 630 bytes |
| コンパイル時間 | 853 ms |
| コンパイル使用メモリ | 106,240 KB |
| 実行使用メモリ | 19,072 KB |
| 最終ジャッジ日時 | 2024-12-23 07:46:17 |
| 合計ジャッジ時間 | 2,005 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 1 |
コンパイルメッセージ
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 Program
{
static void Main(string[] args)
{
string s1 = Console.ReadLine();
string s2 = Console.ReadLine();
int output;
int[] array1 = s1.Split(' ').Select(a => int.Parse(a)).ToArray();
int[] array2 = s2.Split(' ').Select(a => int.Parse(a)).ToArray();
int exist = array1[0] * array1[1];
int need = array2.Sum();
if (exist > need)
{
output = exist - need;
}
else
{
output = -1;
}
Console.WriteLine(output);
Console.ReadLine();
}
}