結果

問題 No.1509 Swap!!
ユーザー ks2mks2m
提出日時 2021-05-14 22:55:27
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 887 bytes
コンパイル時間 2,016 ms
コンパイル使用メモリ 78,012 KB
実行使用メモリ 57,812 KB
最終ジャッジ日時 2024-04-10 02:07:01
合計ジャッジ時間 13,193 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
50,540 KB
testcase_01 AC 54 ms
50,472 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 323 ms
57,212 KB
testcase_12 AC 319 ms
57,124 KB
testcase_13 AC 320 ms
57,220 KB
testcase_14 AC 324 ms
57,184 KB
testcase_15 AC 328 ms
57,180 KB
testcase_16 AC 315 ms
57,104 KB
testcase_17 AC 333 ms
57,464 KB
testcase_18 AC 316 ms
57,224 KB
testcase_19 AC 313 ms
57,244 KB
testcase_20 AC 323 ms
57,388 KB
testcase_21 AC 327 ms
57,100 KB
testcase_22 AC 311 ms
57,160 KB
testcase_23 AC 315 ms
57,316 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 298 ms
57,812 KB
testcase_28 AC 297 ms
57,732 KB
testcase_29 AC 298 ms
57,520 KB
testcase_30 AC 314 ms
57,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int t = Integer.parseInt(br.readLine());
		PrintWriter pw = new PrintWriter(System.out);
		for (int z = 0; z < t; z++) {
			String[] sa = br.readLine().split(" ");
			long n = Long.parseLong(sa[0]);
			long a = Long.parseLong(sa[1]);
			long b = Long.parseLong(sa[2]);

			if (solve(n, Math.min(a, b), Math.max(a, b))) {
				pw.println("YES");
			} else {
				pw.println("NO");
			}
		}
		pw.flush();
		br.close();
	}

	static boolean solve(long n, long a, long b) {
		if (b % a == 0 && a != 1) {
			return false;
		}
		if (a * 2 > n) {
			return false;
		}
		long d = n - b;
		if (d < a - 1) {
			return false;
		}
		return true;
	}
}
0