結果

問題 No.859 路線A、路線B、路線C
ユーザー yuruhiya
提出日時 2019-08-09 23:26:50
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 237 bytes
コンパイル時間 1,616 ms
コンパイル使用メモリ 166,748 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-19 15:52:52
合計ジャッジ時間 2,257 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
main(){
  int x[3],t,u,P,Q;char S,T;
  cin>>x[0]>>x[1]>>x[2]>>S>>t>>T>>u;
  P=x[S-65]-t,Q=x[T-65]-u;
  cout<<min({t+u-1,P+Q+1,min(t+Q,P+u)+min({x[0],x[1],x[2]}),S==T?abs(t-u):2<<29})<<endl;
}
0