結果
| 問題 |
No.126 2基のエレベータ
|
| コンテスト | |
| ユーザー |
kyuridenamida
|
| 提出日時 | 2016-07-22 19:14:54 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 362 bytes |
| コンパイル時間 | 1,266 ms |
| コンパイル使用メモリ | 158,828 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-06 08:44:22 |
| 合計ジャッジ時間 | 2,158 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 WA * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef complex<double> P;
int main(){
int A,B,S;
cin >> A >> B >> S;
int ans = 0;
if( abs(A-S) > abs(B-S) ){
ans += abs(B-S);
if( A == 0 ){
A += 1;
ans += 1;
}
ans += abs(S-A) + abs(A);
}else{
if( A == 0 ){
A += 1;
ans += 1;
}
ans += abs(A-S) + abs(S) ;
}
cout << ans << endl;
}
kyuridenamida