結果

問題 No.208 王将
ユーザー 4885rhkA
提出日時 2015-07-11 12:51:58
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 681 bytes
コンパイル時間 651 ms
コンパイル使用メモリ 54,252 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-09 16:26:12
合計ジャッジ時間 1,326 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

//
//  main.cpp
//  Q487
//
//  Created by AkihiroKOBAYASHI on 7/11/15.
//  Copyright (c) 2015 Akhr5884. All rights reserved.
//

#include <iostream>
#include <stdlib.h>

struct Point {
    int x;
    int y;
};

int main(int argc, const char * argv[]) {
    
    Point start, block, goal;
    int te;
    
    start.x = start.y = 0;
    std::cin >> goal.x;
    std::cin >> goal.y;
    std::cin >> block.x;
    std::cin >> block.y;
    
    if(goal.x > goal.y) {
        te = abs(goal.x);
    }
    else {
        te = abs(goal.y);
    }
    
    if(block.x == block.y && goal.x == goal.y && block.x < goal.x) {
        te++;
    }
    
    std::cout << te << "\n";
    return 0;
}
0