結果
問題 | No.1509 Swap!! |
ユーザー | ks2m |
提出日時 | 2021-05-14 22:46:32 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 751 bytes |
コンパイル時間 | 5,692 ms |
コンパイル使用メモリ | 74,568 KB |
実行使用メモリ | 60,524 KB |
最終ジャッジ日時 | 2024-04-10 01:51:52 |
合計ジャッジ時間 | 14,640 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 51 ms
50,568 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 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | AC | 343 ms
57,376 KB |
testcase_25 | AC | 356 ms
57,792 KB |
testcase_26 | AC | 362 ms
57,216 KB |
testcase_27 | AC | 279 ms
57,700 KB |
testcase_28 | AC | 272 ms
57,756 KB |
testcase_29 | AC | 270 ms
57,716 KB |
testcase_30 | WA | - |
ソースコード
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 ((a * 2 <= n || b * 2 <= n) && gcd(a, b) == 1) { pw.println("YES"); } else { pw.println("NO"); } } pw.flush(); br.close(); } static long gcd(long a, long b) { return b == 0 ? a : gcd(b, a % b); } }