結果
| 問題 |
No.126 2基のエレベータ
|
| コンテスト | |
| ユーザー |
mayoko_
|
| 提出日時 | 2015-01-13 23:30:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 744 bytes |
| コンパイル時間 | 585 ms |
| コンパイル使用メモリ | 72,904 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-22 05:24:08 |
| 合計ジャッジ時間 | 1,519 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 6 |
ソースコード
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#define INF 1000000000
using namespace std;
typedef long long ll;
int main(void) {
int A, B, S;
cin >> A >> B >> S;
int ans = 0;
if (S == 1) {
ans += abs(S-A);
ans += S;
cout << ans << endl;
return 0;
}
if (abs(S-B) < abs(S-A)) {
ans += abs(S-B);
ans += abs(S-1);
ans += A;
cout << ans << endl;
} else {
ans += abs(S-A);
ans += S;
cout << ans << endl;
}
return 0;
}
mayoko_