結果
| 問題 | No.208 王将 |
| コンテスト | |
| ユーザー |
vain0
|
| 提出日時 | 2015-05-24 21:50:47 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 357 bytes |
| 記録 | |
| コンパイル時間 | 401 ms |
| コンパイル使用メモリ | 74,576 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-27 19:53:20 |
| 合計ジャッジ時間 | 1,213 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 WA * 2 |
ソースコード
#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;
}
vain0