結果

問題 No.2597 Yet Another Topological Problem
ユーザー 👑 rin204rin204
提出日時 2023-12-25 21:42:14
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 692 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 90,536 KB
最終ジャッジ日時 2023-12-25 21:42:40
合計ジャッジ時間 23,881 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 WA -
testcase_02 AC 173 ms
90,176 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 174 ms
90,176 KB
testcase_06 RE -
testcase_07 AC 169 ms
90,176 KB
testcase_08 RE -
testcase_09 AC 170 ms
90,176 KB
testcase_10 RE -
testcase_11 AC 172 ms
90,176 KB
testcase_12 AC 170 ms
90,172 KB
testcase_13 RE -
testcase_14 AC 171 ms
90,176 KB
testcase_15 RE -
testcase_16 AC 167 ms
90,176 KB
testcase_17 AC 170 ms
90,180 KB
testcase_18 RE -
testcase_19 AC 172 ms
90,176 KB
testcase_20 RE -
testcase_21 AC 168 ms
90,176 KB
testcase_22 AC 167 ms
90,176 KB
testcase_23 RE -
testcase_24 WA -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 166 ms
90,176 KB
testcase_34 WA -
testcase_35 RE -
testcase_36 RE -
testcase_37 AC 170 ms
90,176 KB
testcase_38 AC 171 ms
90,176 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 RE -
testcase_42 AC 167 ms
90,176 KB
testcase_43 AC 169 ms
90,176 KB
testcase_44 WA -
testcase_45 AC 167 ms
90,176 KB
testcase_46 AC 167 ms
90,176 KB
testcase_47 AC 167 ms
90,176 KB
testcase_48 AC 170 ms
90,176 KB
testcase_49 AC 170 ms
90,176 KB
testcase_50 AC 200 ms
90,176 KB
testcase_51 AC 173 ms
90,176 KB
testcase_52 AC 166 ms
90,176 KB
testcase_53 AC 169 ms
90,176 KB
testcase_54 AC 164 ms
90,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

p, q = map(int, input().split())

S = ""
if 3 * p <= q:
    assert False
    print("Impossible")
    exit()
elif 2 * p <= q:
    x = 40000
    S += "U"
    S += "R" * 2 * x
    S += "D" * 3
    S += "R" * x
    if 2 * p == q:
        S += "R"
    S += "U" * 4
    S += "R" * x
    S += "D" * 3
    S += "R" * 2 * x
    S += "U"
else:
    x = 120000
    S += "U"
    S += "R" * x
    S += "D" * 2
    S += "R" * x
    S += "U"

x, y = 0, 0
XY = [(x, y)]
for s in S:
    if s == "U":
        y += 1
    elif s == "D":
        y -= 1
    elif s == "R":
        x += 1
    elif s == "L":
        x -= 1
    XY.append((x, y))


print("Possible")
print(len(XY) - 1)
for x, y in XY:
    print(x, y)
0