Submission #52918


ソースコード

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
#include <stdio.h>
typedef struct {
char name[32];
long long jap, math, eng;
long long sum;
} Student;
int main()
{
int n;
Student data[10];
int i, j;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%s %lld %lld %lld", data[i].name, &data[i].jap, &data[i].math, &data[i].eng);
data[i].sum = data[i].jap + data[i].math + data[i].eng;
}
int mpos;
for (i = 0; i < n; i++) {
mpos = 0;
for (j = 1; j < n; j++) {
if (data[j].sum > data[mpos].sum) {
mpos = j;
}
}
printf("%s %lld %lld %lld %lld\n", data[mpos].name, data[mpos].jap, data[mpos].math, data[mpos].eng, data[mpos].sum);
data[mpos].sum = -1;
}
return 0;
}

ステータス

項目 データ
問題 0941 - 中間テスト
ユーザー名 sth19_t-ogura
投稿日時 2019-08-19 11:53:01
言語 C
状態 Accepted
得点 1
ソースコード長 815 Byte
最大実行時間 35 ms
最大メモリ使用量 504 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input001.txt AC 35 ms 504 KB
1
input002.txt AC 18 ms 312 KB
1
input003.txt AC 32 ms 332 KB
1
input004.txt AC 24 ms 392 KB
1
input005.txt AC 22 ms 348 KB
1