結果

問題 No.131 マンハッタン距離
ユーザー masa
提出日時 2015-01-20 23:32:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2,103 ms / 5,000 ms
コード長 354 bytes
コンパイル時間 432 ms
コンパイル使用メモリ 59,500 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-22 23:16:49
合計ジャッジ時間 13,774 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

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

	cin >> x >> y >> d;

	int ans = 0;
	int xx, yy;

	for (int i = 0; i <= d; i++) {
		xx = d - i;
		yy = i;
		if (0 <= xx && xx <= x && 0 <= yy && yy <= y) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}
0