結果
| 問題 |
No.531 エヌスクミ島の平和協定
|
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2017-06-23 22:33:02 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 2,000 ms |
| コード長 | 1,862 bytes |
| コンパイル時間 | 1,898 ms |
| コンパイル使用メモリ | 112,200 KB |
| 実行使用メモリ | 27,228 KB |
| 最終ジャッジ日時 | 2024-09-19 16:15:20 |
| 合計ジャッジ時間 | 3,220 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 37 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
#pragma warning disable IDE0011
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
class ReaderWriter
{
protected int _Index;
protected string[] _Line;
public void R(char sep = ' ') { _Line = Console.ReadLine().Split(sep); _Index = 0; }
public string S() => _Line[_Index++];
public string[] Ss() => _Line.Skip(_Index++).ToArray();
public char C() => char.Parse(_Line[_Index++]);
public char[] Cs() => _Line.Skip(_Index++).Select(char.Parse).ToArray();
public int I() => int.Parse(_Line[_Index++]);
public int[] Is() => _Line.Skip(_Index++).Select(int.Parse).ToArray();
public long L() => long.Parse(_Line[_Index++]);
public long[] Ls() => _Line.Skip(_Index++).Select(long.Parse).ToArray();
public double F() => double.Parse(_Line[_Index++]);
public double[] Fs() => _Line.Skip(_Index++).Select(double.Parse).ToArray();
public decimal D() => decimal.Parse(_Line[_Index++]);
public decimal[] Ds() => _Line.Skip(_Index++).Select(decimal.Parse).ToArray();
public BigInteger B() => BigInteger.Parse(_Line[_Index++]);
public BigInteger[] Bs() => _Line.Skip(_Index++).Select(BigInteger.Parse).ToArray();
public void Write(params object[] xs)
{
Console.Write(xs.First());
foreach (var x in xs.Skip(1)) Console.Write(" " + x);
Console.WriteLine();
}
}
class Program
{
static void Main()
{
Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
Solve(new ReaderWriter());
Console.Out.Flush();
}
static void Solve(ReaderWriter rw)
{
rw.R(); var n = rw.I(); var m = rw.I();
if (m >= n) rw.Write(1);
else if (n % 2 != 0) rw.Write(-1);
else if (m < n / 2) rw.Write(-1);
else rw.Write(2);
}
}
くれちー