Submission #24765
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include<bits/stdc++.h> using namespace std; typedef struct ST{ string name; int point; bool operator<( const ST &r) const { if (point!=r.point) return point>r.point; else return name<r.name; } }; main(){ int n,a,b,c; ST st[10]; cin>>n; for ( int i=0;i<n;i++){ cin>>st[i].name>>a>>b>>c; st[i].point=a+b+c; } sort(st,st+n); for ( int i=0;i<n;i++){ cout<<i+1<< " " <<st[i].name<< " " <<st[i].point<<endl; } } |
ステータス
項目 | データ |
---|---|
問題 | 0054 - てすと |
ユーザー名 | ei1516 |
投稿日時 | 2017-08-10 11:54:44 |
言語 | C++ |
状態 | Accepted |
得点 | 2 |
ソースコード長 | 461 Byte |
最大実行時間 | 33 ms |
最大メモリ使用量 | 564 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 2 / 2 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in1.txt | AC | 31 ms | 476 KB |
1
|
in2.txt | AC | 33 ms | 456 KB |
1
|
in3.txt | AC | 21 ms | 564 KB |
1
|
in4.txt | AC | 22 ms | 536 KB |
1
|
in5.txt | AC | 21 ms | 508 KB |
1
|