結果

問題 No.178 美しいWhitespace (1)
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-09-20 01:12:25
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 540 bytes
コンパイル時間 2,947 ms
コンパイル使用メモリ 108,504 KB
実行使用メモリ 24,068 KB
最終ジャッジ日時 2023-09-25 10:20:52
合計ジャッジ時間 5,023 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
21,932 KB
testcase_01 AC 65 ms
23,892 KB
testcase_02 AC 64 ms
22,008 KB
testcase_03 AC 64 ms
23,932 KB
testcase_04 AC 67 ms
22,008 KB
testcase_05 AC 67 ms
21,820 KB
testcase_06 AC 67 ms
21,848 KB
testcase_07 AC 67 ms
21,892 KB
testcase_08 AC 67 ms
24,068 KB
testcase_09 AC 66 ms
21,964 KB
testcase_10 AC 65 ms
21,828 KB
testcase_11 AC 68 ms
23,912 KB
testcase_12 AC 68 ms
23,880 KB
testcase_13 AC 67 ms
22,000 KB
testcase_14 AC 67 ms
21,948 KB
testcase_15 AC 67 ms
22,016 KB
testcase_16 AC 67 ms
21,824 KB
testcase_17 AC 66 ms
21,820 KB
testcase_18 AC 67 ms
21,956 KB
testcase_19 AC 66 ms
21,828 KB
testcase_20 AC 67 ms
21,904 KB
testcase_21 AC 66 ms
23,812 KB
testcase_22 AC 66 ms
23,872 KB
testcase_23 AC 67 ms
23,864 KB
testcase_24 AC 67 ms
21,896 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 max=list.Max();
        var l=list.Select(x=>(max-x));
        long sum=-1;
        if(!l.Any(x=>x%2!=0||x<0))sum=l.Sum(x=>x/2);
        Console.WriteLine(sum);
    }
}
0