結果
| 問題 |
No.208 王将
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-09-20 22:10:36 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 871 bytes |
| コンパイル時間 | 420 ms |
| コンパイル使用メモリ | 57,464 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-19 08:24:23 |
| 合計ジャッジ時間 | 1,039 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 WA * 2 |
ソースコード
#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 && x2 > 0)
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;
}