結果
| 問題 | No.131 マンハッタン距離 | 
| コンテスト | |
| ユーザー |  koyumeishi | 
| 提出日時 | 2015-01-20 23:41:12 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 390 bytes | 
| コンパイル時間 | 671 ms | 
| コンパイル使用メモリ | 72,640 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-22 23:21:44 | 
| 合計ジャッジ時間 | 1,492 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 24 | 
ソースコード
#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <set>
using namespace std;
int main(){
	long long x,y,d;
	cin >> x >> y >> d;
	long long ans = 0;
	long long l = max(0LL, d-y);
	long long r = min(x,d);
	if(l<=r){
		ans = r-l+1;
	}
	cout << ans << endl;
	return 0;
}
            
            
            
        