Submission #50726


ソースコード

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
#include<bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<n;i++)
#define SFOR(i,a,b) for(int i=a;i<b;i++)
#define elif(a) else if(a)
#define INF INT_MAX
#define F first
#define S second
#define endl '\n'
using namespace std;
typedef long long ll;
typedef struct{
char name[21];
ll j,m,e,sum;
}Stu;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n;
Stu data[11];
cin>>n;
FOR(i,n){
cin>>data[i].name>>data[i].j>>data[i].m>>data[i].e;
data[i].sum=data[i].j+data[i].m+data[i].e;
}
FOR(i,n){
FOR(j,n-1-i){
if(data[j].sum<data[j+1].sum) swap(data[j],data[j+1]);
}
}
FOR(i,n){
printf("%s %lld %lld %lld %lld\n",data[i].name,data[i].j,data[i].m,data[i].e,data[i].sum);
}
return 0;
}

ステータス

項目 データ
問題 0941 - 中間テスト
ユーザー名 Zzz..ei1704..Zzz
投稿日時 2019-06-20 16:00:05
言語 C++14
状態 Accepted
得点 1
ソースコード長 770 Byte
最大実行時間 33 ms
最大メモリ使用量 584 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input001.txt AC 33 ms 472 KB
1
input002.txt AC 18 ms 552 KB
1
input003.txt AC 20 ms 504 KB
1
input004.txt AC 22 ms 584 KB
1
input005.txt AC 22 ms 532 KB
1