結果

問題 No.396 クラス替え
ユーザー mban259
提出日時 2016-08-02 19:47:18
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 559 bytes
コンパイル時間 899 ms
コンパイル使用メモリ 103,424 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-11-17 11:10:27
合計ジャッジ時間 2,149 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class A {
    static int N, M, X, Y;
    static void Main() {
        string[] A = Console.ReadLine().Split(' ');
        N = int.Parse(A[0]);
        M = int.Parse(A[1]);
        A = Console.ReadLine().Split(' ');
        X = int.Parse(A[0])-1;
        Y = int.Parse(A[1])-1;
        int Q, W;
        Q = (X / M) % 2 == 0 ? X % M : M - (X % M)-1;
        W = (Y / M) % 2 == 0 ? Y % M : M - (Y % M)-1;
        if (Q == W) {
            Console.WriteLine("YES");

        }
        else {
            Console.WriteLine("NO");

        }
    }
}
0