結果
問題 |
No.208 王将
|
ユーザー |
![]() |
提出日時 | 2015-06-13 11:45:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 657 bytes |
コンパイル時間 | 485 ms |
コンパイル使用メモリ | 66,736 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 16:03:20 |
合計ジャッジ時間 | 1,138 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 WA * 2 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <iomanip> using namespace std; typedef long long LL; LL iabs(LL n){ if(n < 0) return -n; return n; } int main(){ int x, y, x2, y2; cin >> x >> y >> x2 >> y2; LL ans = 0; ans += max(iabs(x), iabs(y)); if(iabs(x) == iabs(y) && iabs(x2) == iabs(y2) && iabs(x) > iabs(x2) && x/y == x2/y2){ ans += 1; } if(y == 0 && ((x < 0 && x < x2 && x2 < 0) || (x > 0 && x > x2 && x2 > 0))){ ans += 1; } if(x == 0 && ((y < 0 && y < y2 && y2 < 0) || (y > 0 && y > y2 && y2 > 0))){ ans += 1; } cout << ans << endl; return 0; }