結果

問題 No.365 ジェンガソート
ユーザー 💕💖💞
提出日時 2016-09-11 15:27:58
言語 Go
(1.23.4)
結果
WA  
実行時間 -
コード長 531 bytes
コンパイル時間 12,586 ms
コンパイル使用メモリ 225,264 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 03:26:43
合計ジャッジ時間 14,448 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
  "bufio"
  "fmt"
  "os"
  "strconv"
  "strings"
  _ "math"
  _ "sort"
)


func main() {
  //scanner := bufio.NewScanner(os.Stdin)
  N := 0
  fmt.Scan(&N)
  srcs := []int{}
  scanner := bufio.NewScanner(os.Stdin)
  for scanner.Scan() {
    for _, x := range strings.Split(scanner.Text(), " ") {
      x2, _ := strconv.Atoi(x)
      srcs = append(srcs, x2)
    }
    break
  }
  diff := 0
  for i := len(srcs) - 1; i >= 0; i-- {
    if srcs[i] == N - diff {
      diff += 1
    }
  }
  fmt.Println(N - diff)
}
0