結果
| 問題 |
No.690 E869120 and Constructing Array 4
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-02 08:30:23 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 1,000 ms |
| コード長 | 300 bytes |
| コンパイル時間 | 234 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-09-13 03:51:09 |
| 合計ジャッジ時間 | 2,101 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)