結果
問題 | No.131 マンハッタン距離 |
ユーザー |
![]() |
提出日時 | 2018-01-14 20:56:18 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 336 bytes |
コンパイル時間 | 671 ms |
コンパイル使用メモリ | 63,360 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 03:04:46 |
合計ジャッジ時間 | 1,325 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <iostream>using namespace std;using int64 = long long;int main() {int64 X, Y, D;cin >> X >> Y >> D;int64 x = max(0LL, D - Y);int64 y = max(0LL, D - X);int64 x2 = D - y;if (x > X or y > Y) {cout << 0 << endl;return 0;}cout << x2 - x + 1 << endl;return 0;}