結果

問題 No.2843 Birthday Present Struggle
コンテスト
ユーザー ryusuke
提出日時 2024-08-23 21:38:47
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 36 ms / 2,000 ms
+ 331µs
コード長 448 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 729 ms
コンパイル使用メモリ 64,324 KB
実行使用メモリ 53,512 KB
最終ジャッジ日時 2026-10-31 23:43:40
合計ジャッジ時間 3,990 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

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