結果
| 問題 |
No.2545 Divide by 3
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-20 23:18:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 865 bytes |
| コンパイル時間 | 324 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 66,816 KB |
| 最終ジャッジ日時 | 2024-09-26 15:08:14 |
| 合計ジャッジ時間 | 1,390 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 5 |
ソースコード
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)