結果
| 問題 | No.126 2基のエレベータ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-16 22:11:13 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 853 bytes |
| 記録 | |
| コンパイル時間 | 619 ms |
| コンパイル使用メモリ | 79,348 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-08 04:33:55 |
| 合計ジャッジ時間 | 1,663 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 10 |
ソースコード
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, string> pls;
int main()
{
ll A, B, S;
cin >> A >> B >> S;
ll ans = 0;
if (S <= A ||((A == B) && A > S)) {
ans = A;
}
else if (B > S && S > A) {
ans = min(B,((S - A) * 2)+A);
if (A == 0)ans++;
}
else if (S > A && A >= B) {
ans = (S - A) + S;
if (A == 0)ans++;
}
else if (S > B && B > A) {
ans = 2 * S - B;
if (A == 0)ans++;
}
else if (S == B && S > A) {
ans = (S-A)*2 + A;
}
cout << ans << endl;
return 0;
}