結果
問題 | No.571 3人兄弟(その2) |
ユーザー |
![]() |
提出日時 | 2019-02-27 12:46:04 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 501 bytes |
コンパイル時間 | 9,547 ms |
コンパイル使用メモリ | 233,464 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 05:05:42 |
合計ジャッジ時間 | 10,302 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
package mainimport ("fmt""sort")func main() {var h, w intps := make([]P, 3)for i := range ps {_, _ = fmt.Scan(&h, &w)ps[i] = P{i, h, w}}sort.Slice(ps, func(i, j int) bool {if ps[i].H > ps[j].H {return true} else if ps[i].H == ps[j].H && ps[i].W < ps[j].W {return true}return false})for _, p := range ps {switch p.N {case 0:fmt.Println("A")case 1:fmt.Println("B")case 2:fmt.Println("C")}}}type P struct {N, H, W int}