結果

問題 No.178 美しいWhitespace (1)
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-09-20 00:58:02
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 540 bytes
コンパイル時間 2,227 ms
コンパイル使用メモリ 104,292 KB
実行使用メモリ 25,892 KB
最終ジャッジ日時 2023-09-25 10:20:46
合計ジャッジ時間 4,934 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
21,972 KB
testcase_01 AC 65 ms
22,096 KB
testcase_02 AC 64 ms
23,976 KB
testcase_03 AC 64 ms
21,988 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 67 ms
22,072 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 67 ms
22,036 KB
testcase_12 AC 66 ms
23,872 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 67 ms
24,144 KB
testcase_19 WA -
testcase_20 AC 66 ms
19,836 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 66 ms
21,808 KB
testcase_24 AC 66 ms
21,828 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.Linq;
using System.Collections.Generic;

class No178{
    static void Main(){
        var list=new List<long>();
        var num=Int32.Parse(Console.ReadLine());
        for(int i=0;i<num;++i){
            var line=Console.ReadLine().Split(' ').Select(x=>Int64.Parse(x)).ToArray();
            list.Add(line[0]+line[1]*4);
        }
        var min=list.Min();
        var l=list.Select(x=>(x-min));
        long sum=-1;
        if(!l.Any(x=>x%2!=0||x<0))sum=l.Sum(x=>x/2);
        Console.WriteLine(sum);
    }
}
0