結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,776 KB
testcase_01 AC 63 ms
21,744 KB
testcase_02 AC 63 ms
23,680 KB
testcase_03 AC 64 ms
21,724 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 66 ms
21,636 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 65 ms
23,664 KB
testcase_12 AC 65 ms
23,732 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 66 ms
21,784 KB
testcase_19 RE -
testcase_20 AC 64 ms
23,704 KB
testcase_21 RE -
testcase_22 WA -
testcase_23 AC 64 ms
21,884 KB
testcase_24 AC 64 ms
21,700 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<int>();
        var num=Int32.Parse(Console.ReadLine());
        for(int i=0;i<num;++i){
            var line=Console.ReadLine().Split(' ').Select(x=>Int32.Parse(x)).ToArray();
            list.Add(line[0]+line[1]*4);
        }
        var min=list.Min();
        var a=list.Select(x=>(x-min));
        var b=a.Any(x=>x%2!=0||x<0);
        var sum=-1;
        if(!b)sum=a.Sum(x=>x/2);
        Console.WriteLine(sum);
    }
}
0