結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
50,424 KB
testcase_01 WA -
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 316 ms
57,256 KB
testcase_12 AC 311 ms
57,076 KB
testcase_13 AC 321 ms
57,112 KB
testcase_14 AC 310 ms
57,232 KB
testcase_15 AC 310 ms
56,996 KB
testcase_16 AC 328 ms
57,208 KB
testcase_17 AC 322 ms
57,172 KB
testcase_18 AC 330 ms
57,176 KB
testcase_19 AC 324 ms
57,144 KB
testcase_20 AC 330 ms
57,376 KB
testcase_21 AC 319 ms
57,264 KB
testcase_22 AC 328 ms
57,280 KB
testcase_23 AC 328 ms
57,384 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 294 ms
57,096 KB
testcase_28 AC 296 ms
57,580 KB
testcase_29 AC 292 ms
57,612 KB
testcase_30 AC 332 ms
57,332 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 (a == b && a != 1) {
			return false;
		}
		if (a * 2 > n) {
			return false;
		}
		long d = n - b;
		if (d < a - 1) {
			return false;
		}
		return true;
	}
}
0