結果
| 問題 | No.690 E869120 and Constructing Array 4 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-02 08:30:23 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 1,000 ms |
| コード長 | 300 bytes |
| 記録 | |
| コンパイル時間 | 337 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 15,392 KB |
| 最終ジャッジ日時 | 2026-04-04 03:11:13 |
| 合計ジャッジ時間 | 3,365 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
import itertools
K = int(input())
N = (K - 1).bit_length() + 2
all_connect = K.bit_length() + 2
G = [(i, j) for i, j in itertools.combinations(range(1, all_connect), 2)]
for i in range(N - 2):
if (K >> i) & 1:
G.append((i + 2, N))
M = len(G)
print(N, M)
for edge in G:
print(*edge)