結果

問題 No.685 Logical Operations
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-05-11 23:51:22
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 408 bytes
コンパイル時間 2,255 ms
コンパイル使用メモリ 72,116 KB
実行使用メモリ 76,492 KB
最終ジャッジ日時 2023-09-10 17:55:03
合計ジャッジ時間 6,539 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
60,148 KB
testcase_01 AC 130 ms
56,232 KB
testcase_02 AC 135 ms
55,864 KB
testcase_03 AC 128 ms
55,780 KB
testcase_04 AC 122 ms
55,972 KB
testcase_05 AC 130 ms
55,876 KB
testcase_06 AC 130 ms
55,660 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();

        int c = 0;
        for(long i = 0; i <= n; i++) {
            for(long j = i; j <= n; j++) {
                if((i&j) < (i^j) && (i^j) < (i|j))
                    c++;
            }
        }

        System.out.println(c%1000000007);
    }
}
0