結果
| 問題 | No.131 マンハッタン距離 | 
| コンテスト | |
| ユーザー |  beet | 
| 提出日時 | 2018-09-22 16:28:49 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 236 bytes | 
| コンパイル時間 | 1,560 ms | 
| コンパイル使用メモリ | 165,196 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-18 09:00:16 | 
| 合計ジャッジ時間 | 2,201 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 24 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  Int x,y,d;
  cin>>x>>y>>d;
  if(x+y<d) return cout<<0<<endl,0;
  Int p=max(0LL,d-y),q=min(x,d);
  cout<<q-p+1<<endl;
  return 0;
}
            
            
            
        