結果
問題 | No.208 王将 |
ユーザー |
![]() |
提出日時 | 2016-12-18 18:04:48 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 1,000 ms |
コード長 | 662 bytes |
コンパイル時間 | 273 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-14 08:27:56 |
合計ジャッジ時間 | 2,045 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
# coding: UTF-8# もしかして、常にXかYの差の絶対値の大きい方と一致するのでは?# と思ったが、完全に直線上にいるときは1歩多くかかるdef main():goal = [int(goal) for goal in input().split()]porn = [int(porn) for porn in input().split()]cnt = 0if goal[0] > goal[1]:cnt = goal[0]elif goal[1] > goal[0]:cnt = goal[1]elif goal[0] == goal[1]:cnt = goal[0]if porn[0] == porn[1] & porn[0] < goal[0]:cnt += 1elif porn[0] == porn[1] & porn[0] == goal[0]:cnt = -1print (cnt)if __name__ == "__main__":main()