結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-01-25 13:56:31 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 859 bytes |
| コンパイル時間 | 899 ms |
| コンパイル使用メモリ | 105,760 KB |
| 実行使用メモリ | 26,272 KB |
| 最終ジャッジ日時 | 2024-12-23 08:23:25 |
| 合計ジャッジ時間 | 1,590 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 2 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
int output = -1;
bool b = true;
int m = 0;
for (int i = 0; i < n; i++)
{
string[] s = Console.ReadLine().Split();
int x = int.Parse(s[0]);
int y = int.Parse(s[1]);
if (n == 1)
{
b = false;
break;
}
if (i == 0)
{
m = y - x;
}
else if (m != y - x)
{
b = false;
break;
}
}
if (b == true)
{
output = m;
}
Console.WriteLine(output);
Console.ReadLine();
}
}