結果

問題 No.2545 Divide by 3
ユーザー ShirotsumeShirotsume
提出日時 2023-07-20 23:18:10
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 865 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 66,420 KB
最終ジャッジ日時 2023-12-01 03:41:14
合計ジャッジ時間 1,308 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

op = []
def plus(i, j, k):
    a[i] = a[j] + a[k]
    assert a[i] <= 2 ** 64
    op.append(('plus', i + 1, j + 1, k + 1))
def div(i, j):
    a[i] = a[j] // 2
    assert a[i] <= 2 ** 64
    op.append(('div', i + 1, j + 1))

x = random.randint(0, 10 ** 9)

a = [0] * 100

a[0] = x
a[1] = 1

#a[0] = (x + 1) << 32 とする
plus(0, 0, 1)
for _ in range(16):
    plus(0, 0, 0)


plus(3, 0, 3)
for i in range(16):
    for j in range(2):
        div(3, 3)
    plus(2, 2, 3)

for _ in range(16):
    div(2, 2)
assert x // 3 == a[2]

for _ in range(1000 - len(op)):
    plus(0, 0, 0)
print(len(op))
for v in op:
    print(*v)
0