Submission #37051


ソースコード

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import java.io.*;
import java.util.*;
import java.lang.*;
class Main{
static Scanner scan = new Scanner(System.in);
public static void main(String args[]){
int n = getInt();
List<String> name = new ArrayList<>();
List<Long> jap = new ArrayList<>();
List<Long> math = new ArrayList<>();
List<Long> eng = new ArrayList<>();
List<Long> sum = new ArrayList<>();
int i;
for ( i = 0; i < n; i++ ) {
name.add(getStr());
long a = getLong();
long b = getLong();
long c = getLong();
jap.add(a);
math.add(b);
eng.add(c);
sum.add(a+b+c);
}
for ( i = 0; i < n; i++ ) {
long temp = -1;
int id = 0;
int j = 0;
for ( long number : sum ) {
if ( temp < number ){
temp = number;
id = j;
}
j++;
}
print( name.get(id) + " " + jap.get(id) + " " + math.get(id) + " " + eng.get(id) + " " + sum.get(id) );
sum.set(id, -2L);
}
}
static int getInt(){
return scan.nextInt();
}
static String getStr(){
return scan.next();
}
static String getLine(){
return scan.nextLine();
}
static char getChar(){
return getStr().charAt(0);
}
static long getLong(){
return scan.nextLong();
}
static void print(Object a){
System.out.println(a);
}
static void printf(Object a){
System.out.print(a);
}
}

ステータス

項目 データ
問題 0941 - 中間テスト
ユーザー名 r1825
投稿日時 2018-06-11 21:26:38
言語 Java
状態 Accepted
得点 1
ソースコード長 1643 Byte
最大実行時間 102 ms
最大メモリ使用量 16296 KB

セット

セット 得点 Cases
1 ALL 1 / 1 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input001.txt AC 100 ms 16296 KB
1
input002.txt AC 93 ms 16032 KB
1
input003.txt AC 98 ms 16016 KB
1
input004.txt AC 92 ms 15132 KB
1
input005.txt AC 102 ms 16160 KB
1