結果

問題 No.1372 Median of Submasks
ユーザー tentententen
提出日時 2021-02-06 13:13:08
言語 Java19
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 3,913 ms
コンパイル使用メモリ 71,444 KB
実行使用メモリ 56,564 KB
最終ジャッジ日時 2023-09-15 19:36:25
合計ジャッジ時間 8,678 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,956 KB
testcase_01 AC 120 ms
56,164 KB
testcase_02 AC 118 ms
55,948 KB
testcase_03 AC 118 ms
55,760 KB
testcase_04 AC 119 ms
55,948 KB
testcase_05 AC 122 ms
55,840 KB
testcase_06 AC 120 ms
55,928 KB
testcase_07 AC 117 ms
55,720 KB
testcase_08 AC 118 ms
55,704 KB
testcase_09 AC 118 ms
55,488 KB
testcase_10 AC 117 ms
55,692 KB
testcase_11 AC 118 ms
55,628 KB
testcase_12 AC 120 ms
55,948 KB
testcase_13 AC 116 ms
55,468 KB
testcase_14 AC 117 ms
55,956 KB
testcase_15 AC 117 ms
55,748 KB
testcase_16 AC 120 ms
55,828 KB
testcase_17 AC 117 ms
55,948 KB
testcase_18 AC 118 ms
55,652 KB
testcase_19 AC 121 ms
55,952 KB
testcase_20 AC 120 ms
55,972 KB
testcase_21 AC 117 ms
56,104 KB
testcase_22 AC 118 ms
55,972 KB
testcase_23 AC 118 ms
56,564 KB
testcase_24 AC 117 ms
55,624 KB
testcase_25 AC 117 ms
55,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long x = 1;
        while (n > x) {
            if ((n & x) != 0) {
                n ^= x;
            }
            x <<= 1;
        }
        System.out.println(n);
    }
}
0