結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
the10hours
|
| 提出日時 | 2015-07-20 22:38:49 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 1,000 ms |
| コード長 | 763 bytes |
| コンパイル時間 | 793 ms |
| コンパイル使用メモリ | 112,320 KB |
| 実行使用メモリ | 18,304 KB |
| 最終ジャッジ日時 | 2024-07-08 11:25:53 |
| 合計ジャッジ時間 | 1,842 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
コンパイルメッセージ
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;
class yc2
{
static void Main()
{
int N = int.Parse(Console.ReadLine());
string[] str1;
int[,] X = new int[2,N];
for(int i=0;i<N;i++)
{
str1 = Console.ReadLine().Split();
X[0,i] = int.Parse(str1[0]);
X[1,i] = int.Parse(str1[1]);
if (X[1, i] - X[0, i] < 1)
{
Console.WriteLine(-1);
return;
}
else if (i >= 1 && X[1, i] - X[0, i] != X[1, i - 1] - X[0, i - 1])
{
Console.WriteLine(-1);
return;
}
}
Console.WriteLine(X[1, 0] - X[0, 0]);
}
}
the10hours