結果

問題 No.524 コインゲーム
ユーザー takeya_okinotakeya_okino
提出日時 2017-07-11 14:15:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 361 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 74,184 KB
実行使用メモリ 41,432 KB
最終ジャッジ日時 2024-04-16 16:59:58
合計ジャッジ時間 8,133 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
41,104 KB
testcase_01 AC 132 ms
41,432 KB
testcase_02 AC 130 ms
41,024 KB
testcase_03 AC 130 ms
41,120 KB
testcase_04 AC 132 ms
41,268 KB
testcase_05 AC 120 ms
39,808 KB
testcase_06 AC 122 ms
40,072 KB
testcase_07 AC 132 ms
41,200 KB
testcase_08 AC 130 ms
41,028 KB
testcase_09 AC 133 ms
41,232 KB
testcase_10 AC 134 ms
41,328 KB
testcase_11 AC 119 ms
40,388 KB
testcase_12 AC 131 ms
40,976 KB
testcase_13 AC 133 ms
41,164 KB
testcase_14 AC 118 ms
39,996 KB
testcase_15 AC 130 ms
41,156 KB
testcase_16 AC 134 ms
41,068 KB
testcase_17 AC 117 ms
40,220 KB
testcase_18 AC 131 ms
41,236 KB
testcase_19 AC 133 ms
41,272 KB
testcase_20 AC 124 ms
40,148 KB
testcase_21 AC 131 ms
40,964 KB
testcase_22 AC 131 ms
41,068 KB
testcase_23 AC 133 ms
41,252 KB
testcase_24 AC 134 ms
41,056 KB
testcase_25 AC 119 ms
40,268 KB
testcase_26 AC 136 ms
41,212 KB
testcase_27 AC 133 ms
41,124 KB
testcase_28 AC 131 ms
41,276 KB
testcase_29 AC 122 ms
39,872 KB
testcase_30 AC 130 ms
41,280 KB
testcase_31 AC 131 ms
41,236 KB
testcase_32 AC 132 ms
41,164 KB
testcase_33 AC 118 ms
40,100 KB
testcase_34 AC 131 ms
41,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    String ans = "O";
    long t = 0;
    if(N % 4 == 1) t = N ^ (N - 1);
    if(N % 4 == 2) t = N ^ (N - 1) ^ (N - 2);
    if(N % 4 == 0) t = N; 
    if(t == 0) ans = "X";
    System.out.println(ans);
  }
}
0