結果

問題 No.131 マンハッタン距離
ユーザー temp
提出日時 2015-02-16 08:57:46
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 497 bytes
コンパイル時間 667 ms
コンパイル使用メモリ 70,584 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 20:39:31
合計ジャッジ時間 1,490 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <functional>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <string>

using namespace std;

int main() {
  int x, y, d;
  cin >> x >> y >> d;
  if (x > y) swap(x, y);
  if (x+y < d) {
    std::cout << 0 << std::endl;
  }else if (d < x){
    std::cout << d+1 << std::endl;
  }else {
    std::cout << x+y-d+1 << std::endl;
  }
}
0