結果
問題 | No.131 マンハッタン距離 |
ユーザー |
![]() |
提出日時 | 2015-02-21 23:08:24 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 172 bytes |
コンパイル時間 | 286 ms |
コンパイル使用メモリ | 34,276 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-23 21:46:01 |
合計ジャッジ時間 | 1,186 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d %d %d", &x, &y, &d); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>#include <algorithm>int main(){int x, y, d;scanf("%d %d %d", &x, &y, &d);printf("%d\n", std::max(d+1 - (d>x)*(d-x) - (d>y)*(d-y), 0));}