結果

問題 No.131 マンハッタン距離
ユーザー hanorver
提出日時 2016-05-25 21:55:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 354 bytes
コンパイル時間 594 ms
コンパイル使用メモリ 57,400 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-07 14:28:50
合計ジャッジ時間 1,486 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>

int main() {
	long long x, y, d;

	std::cin >> x >> y >> d;

	if (x < d && y < d) {
		std::cout << 0 << std::endl;
		return 0;
	}

	long long ans;
	if (x >= d || y >= d) {
		int min = std::min(x, y);
		if (min < d) {
			ans = min + 1;
		} else {
			ans = d + 1;
		}
	}

	std::cout << ans << std::endl;
	return 0;
}
0