結果

問題 No.131 マンハッタン距離
ユーザー dnish
提出日時 2017-07-05 01:30:33
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 221 bytes
コンパイル時間 1,323 ms
コンパイル使用メモリ 165,000 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-05 16:25:18
合計ジャッジ時間 2,286 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define p(s) cout<<(s)<<endl
using namespace std;

int main(){
	int x,y,d;
	cin>>x>>y>>d;
	int ans;
	if(x+y<d) ans=0;
	else if(x>=d&&y>=d) ans=d+1;
	else ans=x+1-max(d-y,0);

	p(ans);
	return 0;
}
0