結果
| 問題 |
No.1992 Tendon Walk
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-24 01:12:47 |
| 言語 | Go (1.23.4) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 365 bytes |
| コンパイル時間 | 12,107 ms |
| コンパイル使用メモリ | 232,512 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-18 05:03:40 |
| 合計ジャッジ時間 | 12,864 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 6 |
ソースコード
package main
import (
"fmt"
"os"
"strconv"
)
func main() {
x, _ := strconv.Atoi(os.Args[1])
d := []int{2, 2, -1, -1, 2, -1, -1}
i := 0
ans := 0
for x != 0 {
x += d[i]
ans += abs(d[i])
i = (i + 1) % 7
}
fmt.Println(ans)
}
func abs(x int) int {
if x < 0 {
return -x
}
return x
}