結果

問題 No.1450 nahco314's First Problem
ユーザー tomoT222tomoT222
提出日時 2021-03-31 14:42:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 838 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 8,212 KB
最終ジャッジ日時 2023-08-08 08:31:48
合計ジャッジ時間 2,984 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,088 KB
testcase_01 AC 17 ms
7,860 KB
testcase_02 AC 18 ms
8,020 KB
testcase_03 AC 15 ms
8,212 KB
testcase_04 AC 16 ms
8,164 KB
testcase_05 AC 17 ms
7,840 KB
testcase_06 AC 20 ms
7,892 KB
testcase_07 AC 17 ms
8,156 KB
testcase_08 AC 21 ms
7,800 KB
testcase_09 AC 17 ms
8,148 KB
testcase_10 AC 17 ms
8,092 KB
testcase_11 AC 17 ms
8,168 KB
testcase_12 AC 17 ms
8,020 KB
testcase_13 AC 19 ms
8,160 KB
testcase_14 AC 18 ms
8,076 KB
testcase_15 AC 17 ms
8,072 KB
testcase_16 AC 17 ms
8,020 KB
testcase_17 AC 17 ms
8,024 KB
testcase_18 AC 20 ms
7,944 KB
testcase_19 AC 18 ms
8,164 KB
testcase_20 AC 17 ms
8,188 KB
testcase_21 AC 18 ms
8,044 KB
testcase_22 AC 20 ms
7,780 KB
testcase_23 AC 17 ms
8,164 KB
testcase_24 AC 17 ms
8,204 KB
testcase_25 AC 17 ms
8,184 KB
testcase_26 AC 18 ms
8,028 KB
testcase_27 AC 18 ms
8,060 KB
testcase_28 AC 17 ms
8,076 KB
testcase_29 AC 17 ms
8,024 KB
testcase_30 AC 17 ms
8,164 KB
testcase_31 AC 20 ms
7,840 KB
testcase_32 AC 18 ms
8,128 KB
testcase_33 AC 19 ms
7,908 KB
testcase_34 AC 17 ms
8,076 KB
testcase_35 AC 20 ms
7,892 KB
testcase_36 AC 20 ms
7,956 KB
testcase_37 AC 18 ms
8,020 KB
testcase_38 AC 18 ms
8,124 KB
testcase_39 AC 17 ms
8,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
x = int(input())
for i in range(x - 100, x + 100):
  if i <= 0:
    continue
  cnt = 0
  a = i
  for j in range(61, -1, -1):
    if a >= (2 ** j):
      a -= (2 ** j)
      cnt += 1
  if (i ^ cnt) == x:
    print(i)
    sys.exit()
print(-1)
0