結果
問題 |
No.293 4>7の世界
|
ユーザー |
![]() |
提出日時 | 2016-09-11 11:00:39 |
言語 | Go (1.23.4) |
結果 |
WA
|
実行時間 | - |
コード長 | 730 bytes |
コンパイル時間 | 12,915 ms |
コンパイル使用メモリ | 226,940 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-17 00:19:21 |
合計ジャッジ時間 | 11,968 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 17 WA * 3 |
ソースコード
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]) }