結果
| 問題 |
No.3088 XOR = SUM
|
| コンテスト | |
| ユーザー |
amentorimaru
|
| 提出日時 | 2025-03-14 23:55:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 280 ms / 2,000 ms |
| コード長 | 532 bytes |
| コンパイル時間 | 539 ms |
| コンパイル使用メモリ | 82,172 KB |
| 実行使用メモリ | 77,208 KB |
| 最終ジャッジ日時 | 2025-03-14 23:55:48 |
| 合計ジャッジ時間 | 18,278 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 22 |
ソースコード
import sys
input = sys.stdin.readline
def read_values(): return map(int, input().split())
def read_list(): return list(read_values())
def main():
t=int(input())
for _ in range(t):
n = int(input())
v = 1
ans=[(0,0),(1,0),(2,0),(2,1),(2,1),(4,1),(4,2),(4,3)]
if n < len(ans):
print(*ans[n])
continue
b = 1
while n > b * 2:
b *= 2
if b * (n-b) > (b//2) * (b//2-1):
print(b,n-b)
else:
print(b//2, b//2-1)
if __name__ == "__main__":
main()
amentorimaru