Submission #52743


ソースコード

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
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define int long long
using pii = pair<int,int>;
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
string name[100];
int p[100][10];
signed main(){
int n;
vector<pii > man;
cin >> n;
for(int i = n;i > 0;i--){
cin >> name[i] >> p[i][0] >> p[i][1] >> p[i][2];
man.push_back(make_pair(p[i][0] + p[i][1] + p[i][2],i));
}
sort(all(man),greater<pii >());
rep(i,n){
cout << name[man[i].second] << ' ' <<p[man[i].second][0] << ' ' << p[man[i].second][1] << ' ' << p[man[i].second][2] << ' ' << man[i].first << '\n';
}
return 0;
}

ステータス

項目 データ
問題 0941 - 中間テスト
ユーザー名 ei1903
投稿日時 2019-08-14 20:52:35
言語 C++14
状態 Accepted
得点 1
ソースコード長 909 Byte
最大実行時間 33 ms
最大メモリ使用量 700 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input001.txt AC 33 ms 604 KB
1
input002.txt AC 22 ms 700 KB
1
input003.txt AC 23 ms 540 KB
1
input004.txt AC 25 ms 504 KB
1
input005.txt AC 14 ms 468 KB
1