結果
問題 |
No.201 yukicoderじゃんけん
|
ユーザー |
|
提出日時 | 2015-11-21 20:54:14 |
言語 | Go (1.23.4) |
結果 |
RE
|
実行時間 | - |
コード長 | 917 bytes |
コンパイル時間 | 11,448 ms |
コンパイル使用メモリ | 229,204 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-10 20:12:46 |
合計ジャッジ時間 | 12,042 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 RE * 4 |
ソースコード
package main import ( "bufio" "os" "strconv" "fmt" ) type Data struct { Name string Point string X string } func scan() *Data { c := Data{} fmt.Scanf("%s %s %s", &c.Name, &c.Point, &c.X) return &c } func (a *Data)sort(b *Data) *Data { if len(a.Point) < len(b.Point) { return b } if len(a.Point) > len(b.Point) { return a } if a.Point < b.Point { return b } if a.Point > b.Point { return a } return nil } func main() { A := scan() B := scan() ans := A.sort(B) fmt.Println(ans.Name) } var s = bufio.NewScanner(os.Stdin) func next() string { s.Split(bufio.ScanWords) s.Scan() return s.Text() } func nextLine() string { s.Split(bufio.ScanLines) s.Scan() return s.Text() } func nextInt() int { i, e := strconv.Atoi(next()) if e != nil { panic(e) } return i } func nextLong() int64 { i, e := strconv.ParseInt(next(), 10, 64) if e != nil { panic(e) } return i }