結果
| 問題 |
No.126 2基のエレベータ
|
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2015-01-28 19:06:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 264 bytes |
| コンパイル時間 | 355 ms |
| コンパイル使用メモリ | 57,208 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-23 03:39:08 |
| 合計ジャッジ時間 | 1,095 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 8 |
ソースコード
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int a, b, s;
cin>>a>>b>>s;
if (s==1) { cout<<abs(a-1)+1<<endl; return 0; }
int x=abs(a-s), y=abs(b-s);
if (x<=y) { cout<<x+s<<endl; return 0; }
cout<<y+x+a<<endl;
}
hogeover30