結果
| 問題 | No.131 マンハッタン距離 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-01-20 19:29:04 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 313 bytes | 
| コンパイル時間 | 2,048 ms | 
| コンパイル使用メモリ | 159,376 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-22 23:04:54 | 
| 合計ジャッジ時間 | 2,829 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 24 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll solve(ll x, ll y, ll d){
    ll yt = min(d, y);
    ll xs = d - yt;
    ll xt = min(d, x);
    
    return max(0ll, xt - xs + 1);
}
int main(){
    ll x, y, d;
    cin >> x >> y >> d;
    
    cout << solve(x, y, d) << endl;
    return 0;
}
            
            
            
        