結果

問題 No.365 ジェンガソート
ユーザー 💕💖💞💕💖💞
提出日時 2016-09-11 15:33:09
言語 Go
(1.22.1)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 657 bytes
コンパイル時間 12,172 ms
コンパイル使用メモリ 210,668 KB
実行使用メモリ 14,380 KB
最終ジャッジ日時 2023-08-10 18:39:19
合計ジャッジ時間 11,965 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,060 KB
testcase_01 AC 2 ms
6,060 KB
testcase_02 AC 2 ms
6,064 KB
testcase_03 AC 2 ms
6,064 KB
testcase_04 AC 3 ms
6,060 KB
testcase_05 AC 2 ms
6,060 KB
testcase_06 AC 2 ms
6,064 KB
testcase_07 AC 2 ms
6,064 KB
testcase_08 AC 2 ms
6,064 KB
testcase_09 AC 2 ms
6,064 KB
testcase_10 AC 2 ms
6,064 KB
testcase_11 AC 2 ms
6,064 KB
testcase_12 AC 3 ms
6,064 KB
testcase_13 AC 2 ms
6,064 KB
testcase_14 AC 2 ms
6,064 KB
testcase_15 AC 2 ms
6,064 KB
testcase_16 AC 6 ms
14,352 KB
testcase_17 AC 6 ms
14,372 KB
testcase_18 AC 3 ms
8,192 KB
testcase_19 AC 7 ms
14,372 KB
testcase_20 AC 4 ms
8,128 KB
testcase_21 AC 3 ms
8,124 KB
testcase_22 AC 6 ms
14,356 KB
testcase_23 AC 4 ms
10,176 KB
testcase_24 AC 6 ms
14,356 KB
testcase_25 AC 3 ms
8,128 KB
testcase_26 AC 5 ms
12,280 KB
testcase_27 AC 6 ms
14,372 KB
testcase_28 AC 5 ms
12,288 KB
testcase_29 AC 6 ms
14,376 KB
testcase_30 AC 5 ms
12,288 KB
testcase_31 AC 3 ms
8,128 KB
testcase_32 AC 3 ms
8,124 KB
testcase_33 AC 7 ms
14,376 KB
testcase_34 AC 3 ms
8,124 KB
testcase_35 AC 6 ms
14,352 KB
testcase_36 AC 7 ms
14,376 KB
testcase_37 AC 7 ms
14,380 KB
testcase_38 AC 7 ms
14,376 KB
testcase_39 AC 6 ms
14,376 KB
testcase_40 AC 7 ms
14,376 KB
権限があれば一括ダウンロードができます

ソースコード

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{}
  for _, x := range strings.Split(gets(), " ") {
    x2, _ := strconv.Atoi(x)
    srcs = append(srcs, x2)
  }
  diff := 0
  for i := len(srcs) - 1; i >= 0; i-- {
    if srcs[i] == N - diff {
      diff += 1
    }
  }
  fmt.Println(N - diff)
}

var rdr = bufio.NewReaderSize(os.Stdin, 10000000)
func gets() string {
  buf := make([]byte, 0, 10000000)
  for {
    l, p, _ := rdr.ReadLine()
    buf = append(buf, l...)
    if !p { break }
  }
  return string(buf)
}
0