結果
問題 |
No.208 王将
|
ユーザー |
![]() |
提出日時 | 2016-11-08 17:24:26 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 544 bytes |
コンパイル時間 | 1,193 ms |
コンパイル使用メモリ | 158,984 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 04:53:05 |
合計ジャッジ時間 | 1,980 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 19 WA * 4 |
ソースコード
#include <bits/stdc++.h> using namespace std; class Solver { public: bool solve() { int x, y; cin >> x >> y; int xe, ye; cin >> xe >> ye; int ans = max(abs(x), abs(y)); if(abs(x) == abs(y) and abs(xe) == abs(ye)) { if(x * xe >= 0 and y * ye >= 0) { if(abs(x) > abs(xe)) ans += 2; } } cout << ans << endl; return 0; } }; int main() { cin.tie(0); ios::sync_with_stdio(false); Solver s; s.solve(); return 0; }