結果

問題 No.396 クラス替え
ユーザー fjafjafjafjafjafja
提出日時 2017-09-16 16:49:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 1,000 ms
コード長 446 bytes
コンパイル時間 2,999 ms
コンパイル使用メモリ 74,836 KB
実行使用メモリ 54,340 KB
最終ジャッジ日時 2024-04-25 14:39:21
合計ジャッジ時間 6,103 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
54,128 KB
testcase_01 AC 108 ms
53,040 KB
testcase_02 AC 105 ms
53,108 KB
testcase_03 AC 117 ms
54,176 KB
testcase_04 AC 106 ms
52,752 KB
testcase_05 AC 120 ms
54,276 KB
testcase_06 AC 114 ms
54,340 KB
testcase_07 AC 113 ms
54,300 KB
testcase_08 AC 117 ms
53,880 KB
testcase_09 AC 114 ms
54,204 KB
testcase_10 AC 108 ms
52,876 KB
testcase_11 AC 104 ms
52,784 KB
testcase_12 AC 110 ms
53,892 KB
testcase_13 AC 116 ms
54,304 KB
testcase_14 AC 116 ms
54,028 KB
testcase_15 AC 107 ms
53,576 KB
testcase_16 AC 107 ms
52,928 KB
testcase_17 AC 116 ms
54,176 KB
testcase_18 AC 118 ms
54,004 KB
testcase_19 AC 115 ms
53,520 KB
権限があれば一括ダウンロードができます

ソースコード

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