結果
問題 | No.1992 Tendon Walk |
ユーザー |
|
提出日時 | 2024-05-11 20:39:56 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 331 bytes |
コンパイル時間 | 11,206 ms |
コンパイル使用メモリ | 227,764 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-20 08:48:15 |
合計ジャッジ時間 | 11,928 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
// No.1992 Tendon Walkpackage mainimport ("fmt""math")func main() {var x intfmt.Scan(&x)const a = 2const b = -1set := []int{a, a, b, b, a, b, b}pos, ans := 0, 0.0for {for _, v := range set {pos += vans += math.Abs(float64(v))if pos == x {goto Exit}}}Exit:fmt.Println(ans)}