結果

問題 No.690 E869120 and Constructing Array 4
ユーザー nebukuro09
提出日時 2018-05-18 23:39:59
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-06-28 14:03:35
合計ジャッジ時間 3,867 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 1 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

K = input()

if K == 0:
    print 2, 0
    exit()

ans = []
for i in xrange(31):
    ans.append((i, i+1))

for i in xrange(30, -1, -1):
    if K == 0:
        break
    if K % 2 == 0:
        for j in xrange(i+2, 31):
            ans.append((i, j))
        K /= 2
    else:
        ans.append((i, 31))
        K -= 1


print 32, len(ans)
for a in ans:
    print a[0]+1, a[1]+1
0