結果
問題 | No.859 路線A、路線B、路線C |
ユーザー |
![]() |
提出日時 | 2019-08-09 22:35:13 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 899 bytes |
コンパイル時間 | 101 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-19 14:40:27 |
合計ジャッジ時間 | 1,382 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 4 |
ソースコード
#import sys #input = sys.stdin.readline def main(): x, y, z = map( int, input().split()) s0, t0 = input().split() s1, t1 = input().split() t0, t1 = int(t0), int(t1) if t0 > t1: s0, s1 = s1, s0 t0, t1 = t1, t0 if s0 != "A": if s0 == s1: if s0 == "B": x, y = y, x else: x, z = z, x s0 = s1 = "A" else: if s1 == "B": x, z = z, x else: x, y = y, x s0 = "A" if s1 == "C": y, z = z, y s1 = "B" # print(x,y,z,s0,t0,s1,t1) if s0 == s1: print( min(t1 - t0, t0 + x+1-t1 + min(y-1, z-1))) else: # print( min(t0, x-t0 + z) + t1-1, min(x+1-t0, t0+z) +y-t1) print( min( min(t0, x+1-t0 + z) + t1-1, min(x+1-t0, t0+z) +y-t1)) if __name__ == '__main__': main()