結果
問題 |
No.400 鏡
|
ユーザー |
![]() |
提出日時 | 2016-09-09 11:31:56 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 814 bytes |
コンパイル時間 | 16,414 ms |
コンパイル使用メモリ | 227,088 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-16 05:13:07 |
合計ジャッジ時間 | 15,473 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 8 |
ソースコード
package main import ( "bufio" "fmt" "os" _ "strconv" _ "strings" _ "math" _ "sort" ) func Reverse(s []rune) []rune { runes := s for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 { runes[i], runes[j] = runes[j], runes[i] } return runes } func main() { scanner := bufio.NewScanner(os.Stdin) holder := []rune{} th := 0 for scanner.Scan() { th += 1 text := scanner.Text() if text == "" { break } for i, x2 := range text { _ = i holder = append(holder, x2) } if th == 1 { break } } holder = Reverse(holder) result_runes := []rune{} for _, r := range holder { if string(r) == ">" { result_runes = append(result_runes, []rune("<")[0]) } if string(r) == "<" { result_runes = append(result_runes, []rune(">")[0]) } } fmt.Println(string(result_runes)) }