結果
| 問題 | No.396 クラス替え |
| コンテスト | |
| ユーザー |
ixTL255
|
| 提出日時 | 2016-08-05 01:06:57 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 1,000 ms |
| コード長 | 573 bytes |
| コンパイル時間 | 3,250 ms |
| コンパイル使用メモリ | 105,472 KB |
| 実行使用メモリ | 18,944 KB |
| 最終ジャッジ日時 | 2024-11-17 11:11:03 |
| 合計ジャッジ時間 | 2,455 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
コンパイルメッセージ
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;
public class Test
{
public static void Main()
{
var f = Console.ReadLine()
.Split(' ')
.Select(x => int.Parse(x))
.ToList();
var s = Console.ReadLine()
.Split(' ')
.Select(x => int.Parse(x))
.ToList();
var h = ((s[0] - 1) / f[1]) % 2 == 0 ? (s[0] - 1) % f[1] : f[1] - ((s[0] - 1) % f[1]) -1;
var t = ((s[1] - 1) / f[1]) % 2 == 0 ? (s[1] - 1) % f[1] : f[1] - ((s[1] - 1) % f[1]) -1;
var ans = "";
if(h == t) ans = "YES";
else ans = "NO";
Console.WriteLine(ans);
}
}
ixTL255