結果

問題 No.293 4>7の世界
ユーザー 💕💖💞💕💖💞
提出日時 2016-09-11 11:00:39
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 730 bytes
コンパイル時間 12,129 ms
コンパイル使用メモリ 234,684 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-28 10:15:41
合計ジャッジ時間 12,400 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 WA -
testcase_04 AC 1 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 WA -
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 WA -
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

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

func main() {
  scanner := bufio.NewScanner(os.Stdin)
  hold := []int{}
  edit_raw := make(map[int]string)
  for scanner.Scan() {
    for _, num_s := range strings.Split(scanner.Text(), " ") {
      runes := []rune(num_s)
      for i, r := range runes{
        if r == []rune("4")[0] {
          runes[i] = []rune("7")[0]
        }else if r == []rune("7")[0] {
          runes[i] = []rune("4")[0]
        }
      }
      num, _ := strconv.Atoi(string(runes))
      edit_raw[num] = num_s
      hold = append(hold, num)
    }
    break
  }
  nums := hold
  sort.Ints(nums)
  _, tail := nums[0], nums[1]
  
  fmt.Println(edit_raw[tail])
}
0