結果
| 問題 | No.126 2基のエレベータ |
| コンテスト | |
| ユーザー |
alpha_virginis
|
| 提出日時 | 2015-03-05 21:36:34 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 440 bytes |
| 記録 | |
| コンパイル時間 | 659 ms |
| コンパイル使用メモリ | 88,636 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-10 08:21:59 |
| 合計ジャッジ時間 | 1,333 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 13 |
ソースコード
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
int main() {
long i;
long a, b, s;
long a_s;
long b_s;
long ans;
std::cin >> a >> b >> s;
a_s = abs(a-s);
b_s = abs(b-s);
if( a == 0 ) {
ans = 2 * s;
}
else {
if(a_s > b_s) {
ans = b_s + abs(a-b) + a;
}
else {
ans = a_s + s;
}
}
std::cout << ans << std::endl;
return 0;
}
alpha_virginis