結果

問題 No.143 豆
ユーザー k-a-rgbk-a-rgb
提出日時 2023-08-29 13:32:49
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 687 bytes
コンパイル時間 2,050 ms
コンパイル使用メモリ 104,100 KB
実行使用メモリ 22,816 KB
最終ジャッジ日時 2023-08-29 13:32:53
合計ジャッジ時間 4,095 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,700 KB
testcase_01 AC 55 ms
20,872 KB
testcase_02 AC 54 ms
20,700 KB
testcase_03 AC 58 ms
22,816 KB
testcase_04 AC 55 ms
22,780 KB
testcase_05 AC 56 ms
22,760 KB
testcase_06 AC 54 ms
20,872 KB
testcase_07 AC 55 ms
20,784 KB
testcase_08 AC 56 ms
20,872 KB
testcase_09 WA -
testcase_10 AC 55 ms
22,764 KB
testcase_11 AC 56 ms
20,788 KB
testcase_12 AC 57 ms
20,820 KB
testcase_13 AC 57 ms
22,800 KB
testcase_14 AC 57 ms
20,816 KB
testcase_15 AC 57 ms
20,768 KB
testcase_16 AC 56 ms
20,692 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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);
				
			
			}
		}
    }
}
0