Submission #00053
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include<stdio.h> int main(){ int n,m,i,j; scanf ( "%d %d" ,&m,&n); int data[m]; for (i=0;i<m;i++){ scanf ( "%d" ,&data[i]); } for (i=0;i<n;i++){ for (j=0;j<m-i-1;j++){ if (data[j]>data[j+1]){ int temp; temp=data[j]; data[j]=data[j+1]; data[j+1]=temp; } } } for (i=m-1;i>m-n-1;i--){ printf ( "%d\n" ,data[i]); } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - お〜い お |
ユーザー名 | ei1612 |
投稿日時 | 2016-07-05 14:54:10 |
言語 | C++11 |
状態 | Accepted |
得点 | 40 |
ソースコード長 | 384 Byte |
最大実行時間 | 29 ms |
最大メモリ使用量 | 800 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 40 / 40 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in1.txt | AC | 13 ms | 472 KB |
1
|
in2.txt | AC | 10 ms | 452 KB |
1
|
in3.txt | AC | 10 ms | 436 KB |
1
|
in4.txt | AC | 14 ms | 428 KB |
1
|
in5.txt | AC | 29 ms | 800 KB |
1
|
in6.txt | AC | 12 ms | 400 KB |
1
|