結果

問題 No.524 コインゲーム
ユーザー takeya_okinotakeya_okino
提出日時 2017-07-11 14:12:56
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 360 bytes
コンパイル時間 2,190 ms
コンパイル使用メモリ 74,516 KB
実行使用メモリ 56,288 KB
最終ジャッジ日時 2024-04-16 16:59:49
合計ジャッジ時間 7,858 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
41,484 KB
testcase_01 AC 129 ms
41,452 KB
testcase_02 AC 124 ms
41,364 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 132 ms
41,716 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 129 ms
41,572 KB
testcase_12 AC 127 ms
41,208 KB
testcase_13 AC 131 ms
41,452 KB
testcase_14 AC 130 ms
41,540 KB
testcase_15 AC 130 ms
41,264 KB
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 129 ms
41,624 KB
testcase_25 AC 128 ms
41,184 KB
testcase_26 AC 129 ms
41,592 KB
testcase_27 WA -
testcase_28 AC 130 ms
41,304 KB
testcase_29 AC 130 ms
41,304 KB
testcase_30 AC 128 ms
41,592 KB
testcase_31 AC 130 ms
41,792 KB
testcase_32 AC 116 ms
39,968 KB
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

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;
    if(N % 4 == 2) t = N ^ (N - 1);
    if(N % 4 == 3) t = N ^ (N - 1) ^ (N - 2); 
    if(t == 0) ans = "X";
    System.out.println(ans);
  }
}
0