結果
問題 | No.208 王将 |
ユーザー |
![]() |
提出日時 | 2015-05-24 21:54:13 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 359 bytes |
コンパイル時間 | 417 ms |
コンパイル使用メモリ | 56,568 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 16:24:05 |
合計ジャッジ時間 | 1,238 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include <iostream> #include <algorithm> using namespace std; int main() { int x, y, u, v; cin >> x >> y >> u >> v; if ( x < 0 ) { x *= -1; u *= -1; } if ( y < 0 ) { y *= -1; v *= -1; } if ( x > y ) { swap(x, y); swap(u, v); } int d = y + ( x == y && u == v && (u <= x && v <= y) ? 1 : 0 ); //避ける必要がある cout << d << endl; return 0; }