結果
| 問題 | No.131 マンハッタン距離 | 
| コンテスト | |
| ユーザー |  HeyHey0111 | 
| 提出日時 | 2016-03-07 22:44:52 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 316 bytes | 
| コンパイル時間 | 497 ms | 
| コンパイル使用メモリ | 60,072 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-09-24 11:51:51 | 
| 合計ジャッジ時間 | 1,629 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 24 | 
ソースコード
#include<iostream>
#include<string>
#include<vector>
#include<set>
using namespace std;
int main(){
  int x,y,d;
  cin >> x >> y >>d;
  if(x+y<d){
      cout<<0<<endl;
      return 0;
  }else{
      int min,max;
      min = y>=d ? 0 : d-y;
      max = x>=d ? d : x;
      cout<<max-min+1<<endl;
  }
    return 0;
}
            
            
            
        