結果

問題 No.396 クラス替え
ユーザー fjafjafja
提出日時 2017-09-16 16:49:30
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 1,000 ms
コード長 446 bytes
コンパイル時間 3,579 ms
コンパイル使用メモリ 77,524 KB
実行使用メモリ 41,744 KB
最終ジャッジ日時 2024-11-08 01:35:04
合計ジャッジ時間 6,949 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class N396
{
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt();
		int[] x=new int[2];x[0]=sc.nextInt();x[1]=sc.nextInt();
		for(int i=0;i<2;i++)
		{
			x[i]=x[i]%(2*m);if(x[i]==0){x[i]=2*m;}
			if(x[i]<=m){}else{x[i]=x[i]%m;if(x[i]==0){x[i]=m;}x[i]=m-x[i]+1;}
		}
		if(x[0]==x[1]){System.out.println("YES");}else{System.out.println("NO");}
	}

}
0