結果
| 問題 | No.131 マンハッタン距離 |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2021-11-13 15:28:57 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 479µs | |
| コード長 | 287 bytes |
| 記録 | |
| コンパイル時間 | 276 ms |
| コンパイル使用メモリ | 72,852 KB |
| 実行使用メモリ | 9,872 KB |
| 最終ジャッジ日時 | 2026-09-30 20:15:30 |
| 合計ジャッジ時間 | 2,308 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <iostream>
using namespace std;
int main(){
int x,y,d;cin>>x>>y>>d;
if(d < y){
y = d;
}
if(d < x){
x = d;
}
int ans = d+1;
if(d > y){
ans -= d-y;
}
if(d > x){
ans -= d-x;
}
cout << max(0,ans) << endl;
}