結果
問題 | No.131 マンハッタン距離 |
ユーザー |
![]() |
提出日時 | 2016-07-09 23:41:12 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 257 bytes |
コンパイル時間 | 442 ms |
コンパイル使用メモリ | 40,512 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-13 09:47:14 |
合計ジャッジ時間 | 1,123 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <cstdio> #include <algorithm> using namespace std; int main(void) { long long x, y, d; scanf("%lld%lld%lld", &x, &y, &d); long long res = d+1; res -= max(0ll, d-x); res -= max(0ll, d-y); printf("%lld\n", max(0ll, res)); return 0; }