Submission #28544
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | import java.util.ArrayList; import java.util.Comparator; import java.util.Scanner; public class Main{ static Scanner s= new Scanner(System.in); static int gInt(){ return Integer.parseInt(s.next());} static class Person{ String name; int score; Person(){ name=s.next(); score=gInt()+gInt()+gInt(); } @Override public String toString(){ return name+ " " +score; } } public static void main(String[] $){ ArrayList<Person>p= new ArrayList<>(); int n=gInt(); for ( int i=0;i<n;++i) p.add( new Person()); p.sort(Comparator.<Person>comparingInt(o->o.score).reversed().thenComparing(o->o.name)); for ( int i=0;i<n;++i) System.out.println(i+1+ " " +p.get(i)); } } |
ステータス
項目 | データ |
---|---|
問題 | 0054 - てすと |
ユーザー名 | fal_rnd |
投稿日時 | 2017-11-11 18:53:34 |
言語 | Java |
状態 | Accepted |
得点 | 2 |
ソースコード長 | 718 Byte |
最大実行時間 | 183 ms |
最大メモリ使用量 | 19632 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 2 / 2 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in1.txt | AC | 183 ms | 18860 KB |
1
|
in2.txt | AC | 112 ms | 19520 KB |
1
|
in3.txt | AC | 104 ms | 18788 KB |
1
|
in4.txt | AC | 105 ms | 19524 KB |
1
|
in5.txt | AC | 108 ms | 19632 KB |
1
|