結果
| 問題 | No.3276 Make Smaller Popcount | 
| コンテスト | |
| ユーザー |  titia | 
| 提出日時 | 2025-09-22 06:28:09 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 320 bytes | 
| コンパイル時間 | 271 ms | 
| コンパイル使用メモリ | 12,032 KB | 
| 実行使用メモリ | 10,624 KB | 
| 最終ジャッジ日時 | 2025-09-22 06:28:33 | 
| 合計ジャッジ時間 | 22,303 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 20 WA * 2 TLE * 1 -- * 5 | 
ソースコード
import sys
input = sys.stdin.readline
T=int(input())
for tests in range(T):
    N=int(input())
    x=N.bit_count()
    for i in range(60):
        y=(1<<i)
        k=N & (y-1)
        plus=y-k
        xx=(N+plus).bit_count()
        #print(N,plus,x,xx)
        if xx<x:
            print(plus)
            break
            
            
            
        