結果
| 問題 | No.859 路線A、路線B、路線C |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-09 22:41:14 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 568 bytes |
| 記録 | |
| コンパイル時間 | 372 ms |
| コンパイル使用メモリ | 86,872 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-18 17:28:16 |
| 合計ジャッジ時間 | 2,022 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 WA * 1 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> x(3);
cin >> x[0] >> x[1] >> x[2];
char S0, S1; int t0, t1;
cin >> S0 >> t0 >> S1 >> t1;
auto Inter = [=](bool i, char S, int t) {
return i ? t : x[S - 'A'] - t + 1;
};
int Xmin = min({ x[0],x[1],x[2] }) - 1;
cout << min({
S0 == S1 ? abs(t0 - t1) : (int)2e9,
Inter(1, S0, t0) + Inter(1, S1, t1) - 1, Inter(0, S0, t0) + Inter(0, S1, t1) - 1,
Inter(1, S0, t0) + Xmin + Inter(0, S1, t1), Inter(0, S0, t0) + Xmin + Inter(2, S1, t1),
}) << endl;
}