結果

問題 No.2843 Birthday Present Struggle
コンテスト
ユーザー ryusuke
提出日時 2024-08-23 21:38:47
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 65 ms / 2,000 ms
+ 74µs
コード長 448 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 276 ms
コンパイル使用メモリ 96,184 KB
実行使用メモリ 79,104 KB
最終ジャッジ日時 2026-08-25 03:55:00
合計ジャッジ時間 4,782 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())
ax, ay = map(int, input().split())
bx, by = map(int, input().split())
cx, cy = map(int, input().split())

ans = []
d = ((1, 0), (-1, 0), (0, 1), (0, -1))
for dy, dx in d:
    ny = cy + dy
    nx = cx + dx
    if not (1 <= ny <= N and 1 <= nx <= N):
        continue
    if (ny, nx) == (by, bx):
        continue
    if (ny, nx) == (ay, ax):
        continue
    ans.append((nx, ny))
print(len(ans))
for i, j in ans:
    print(i, j)
0