結果

問題 No.643 Two Operations No.2
ユーザー maspymaspy
提出日時 2020-02-02 00:06:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 458 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-18 20:25:27
合計ジャッジ時間 1,151 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# 複素平面で z -> i conjugate(z) or 1+i conjugate(z)

X,Y = map(int,read().split())

Z = complex(X,Y)

se = set([Z])
answer = -1
for i in range(10):
    if any(z.real == z.imag for z in se):
        answer = i
        break
    se = set(1j * z.conjugate() for z in se) | \
         set((1+1j) * z.conjugate() for z in se)

print(answer)
0