結果
問題 |
No.208 王将
|
ユーザー |
|
提出日時 | 2015-09-20 22:12:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 881 bytes |
コンパイル時間 | 487 ms |
コンパイル使用メモリ | 58,520 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-19 08:24:24 |
合計ジャッジ時間 | 1,089 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 WA * 1 |
ソースコード
#include <iostream> using namespace std; #include <cstdio> #include <string.h> #include <stdlib.h> #include <math.h> #define FOR(i,a,b) for(int (i)=(a);i<(b);i++) typedef long long ll; typedef unsigned long long ull; typedef long double lb; /* ここからが本編 */ int main(void) { int i,j,k,l; int x,y; int x2,y2; int ans; cin >> x >> y; cin >> x2 >> y2; if(x * x2 < 0) { x2 = -1; y2 = -1; } else if( y * y2 < 0) { x2 = -1; y2 = -1; } x = abs(x); y = abs(y); if(x > y) ans = x; else if(x < y) ans = y; /* こっからはx == yの条件が自然につく */ else if(x > 2) { ans = x; if(x2 == y2 && 0 < x2 && x2 < x) ans += 1; } else if(x == 1) ans = 1; else if(x == 2) { if(x2 == 1 && y2 == 1) ans = 4; else ans = 2; } printf("%d\n",ans); return 0; }