結果
| 問題 |
No.123 カードシャッフル
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-10 23:37:08 |
| 言語 | Go (1.23.4) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 492 bytes |
| コンパイル時間 | 11,883 ms |
| コンパイル使用メモリ | 230,856 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-10 04:05:44 |
| 合計ジャッジ時間 | 12,590 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 RE * 4 |
ソースコード
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
func main() {
var n, m int
var s string
cards := make([]int, 0, 50)
fmt.Scanln(&n, &m)
scanner := bufio.NewScanner(os.Stdin)
scanner.Scan()
s = scanner.Text()
for i := 1; i <= n; i++ {
cards = append(cards, i)
}
for _, v := range strings.Split(s, " ") {
i, _ := strconv.Atoi(v)
j := i - 1
tmp := append([]int{cards[j]}, cards[:j]...)
cards = append(tmp, cards[j+1:]...)
}
fmt.Println(cards[0])
}