結果
問題 | No.131 マンハッタン距離 |
ユーザー |
![]() |
提出日時 | 2018-02-08 21:22:43 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 532 bytes |
コンパイル時間 | 649 ms |
コンパイル使用メモリ | 79,860 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 02:54:29 |
合計ジャッジ時間 | 1,505 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <iostream>#include <vector>#include <string>#include <cstring>#include <math.h>#include <cmath>#include <limits.h>#include <map>#include <set>#include <queue>#include <algorithm>#include <functional>#include <stdio.h>using namespace std;long long MOD = 1000000007;int main() {long long x,y,d;cin >> x >> y >> d;long long a = 0, b = 0;if ( d >= x ) {a = d - x;}if ( d >= y ) {b = d - y;}cout << max( 0LL, d + 1 - (a + b) ) << endl;return 0;}