結果
| 問題 |
No.178 美しいWhitespace (1)
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2015-04-19 08:41:02 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 2,000 ms |
| コード長 | 1,008 bytes |
| コンパイル時間 | 910 ms |
| コンパイル使用メモリ | 105,216 KB |
| 実行使用メモリ | 18,944 KB |
| 最終ジャッジ日時 | 2024-07-04 17:32:39 |
| 合計ジャッジ時間 | 2,450 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;
namespace Programming
{
class Program
{
static void Main(string[] args)
{
//入力
int N = int.Parse(Console.ReadLine());
Int64[] a = new Int64[N];
string[] str = new string[2];
for (int i = 0; i < N; i++)
{
str = Console.ReadLine().Split(' ');
a[i] = int.Parse(str[0]) + int.Parse(str[1]) * 4;
}
Int64 max = a.Max(); //最長文字数
Int64 cnt = 0;
foreach (var item in a)
{
if ((max - item)%2 == 1)
{
Console.WriteLine(-1);
return;
}
else
{
cnt += (max - item) / 2;
}
}
Console.WriteLine(cnt);
}
}
}
No