結果
問題 | No.126 2基のエレベータ |
ユーザー |
![]() |
提出日時 | 2016-08-15 23:11:44 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 438 bytes |
コンパイル時間 | 1,875 ms |
コンパイル使用メモリ | 30,848 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-10 18:30:36 |
合計ジャッジ時間 | 2,798 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
program mainimplicit noneinteger::A,B,S,move=0read *,A,B,Sif(A.eq.0) thenmove = move + 1A = 1end ifif(S.eq.1) thenmove = move + Aelse if(ABS(B-S).lt.ABS(A-S)) thenif(B.lt.A) thenmove = move + ABS(B-S) + MIN((S-1),ABS(A-S)) + Aelsemove = move + ABS(B-S) + ABS(S-A) + Aend ifelsemove = move + ABS(A-S) + Send ifprint '(i0)', moveend program main