Submission #36857
ソースコード
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 | #include<stdio.h> #include<string.h> int main() { long long n,i,j,temp; long long ko[101],su[101],ei[101],a[101]; char name[101][21],str[21]; scanf ( "%lld" ,&n); for (i=0;i<n;i++){ scanf ( "%s%lld%lld%lld" ,name[i],&ko[i],&su[i],&ei[i]); a[i]=ko[i]+su[i]+ei[i]; } for (i=0;i<n-1;i++){ for (j=0;j<n-1-i;j++){ if (a[j]<a[j+1]){ temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; temp=ko[j]; ko[j]=ko[j+1]; ko[j+1]=temp; temp=su[j]; su[j]=su[j+1]; su[j+1]=temp; temp=ei[j]; ei[j]=ei[j+1]; ei[j+1]=temp; strcpy (str,name[j]); strcpy (name[j],name[j+1]); strcpy (name[j+1],str); } } } for (i=0;i<n;i++){ printf ( "%s %lld %lld %lld %lld\n" ,name[i],ko[i],su[i],ei[i],a[i]); } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0941 - 中間テスト |
ユーザー名 | ei1832 |
投稿日時 | 2018-06-07 16:32:59 |
言語 | C++11 |
状態 | Accepted |
得点 | 1 |
ソースコード長 | 781 Byte |
最大実行時間 | 25 ms |
最大メモリ使用量 | 480 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 1 / 1 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
input001.txt | AC | 24 ms | 480 KB |
1
|
input002.txt | AC | 18 ms | 444 KB |
1
|
input003.txt | AC | 25 ms | 408 KB |
1
|
input004.txt | AC | 21 ms | 372 KB |
1
|
input005.txt | AC | 24 ms | 460 KB |
1
|