結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-29 13:32:49 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 687 bytes |
| コンパイル時間 | 2,944 ms |
| コンパイル使用メモリ | 111,004 KB |
| 実行使用メモリ | 26,248 KB |
| 最終ジャッジ日時 | 2024-12-30 23:30:26 |
| 合計ジャッジ時間 | 2,215 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / 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.Collections.Generic;
using System.Linq;
namespace PracticeAtCoder
{
class Program
{
static void Main(string[] args)
{
//中央値
string sA = Console.ReadLine();
string sB = Console.ReadLine();
string[] tA = sA.Split(' ');
string[] tB = sB.Split(' ');
Boolean flg = true;
int sumA = 0 ;
sumA = int.Parse(tA[0]) * int.Parse(tA[1]);
int sumB = 0 ;
//sumA = tA[0] * tA[1];
// 年齢を合計する Q143 豆
foreach(var a in tB){
sumB = sumB +int.Parse(a);
}
if(sumA > sumB){
Console.WriteLine(sumA - sumB);
}else{
Console.WriteLine(-1);
}
}
}
}