結果

問題 No.1628 Sorting Integers (MAX of M)
ユーザー arutairuarutairu
提出日時 2021-08-13 22:04:21
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 554 ms
コンパイル使用メモリ 30,848 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 18:01:41
合計ジャッジ時間 969 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
	int n;
	int i,j;
	int c[9];
	int a[9];
	int temp=0;
	for(i=0;i<9;i++){
		a[i]=0;
	}
	scanf("%d",&n);
	for(i=0;i<9;i++){
		
		scanf("%d",&c[i]);

	}
	for(i=0;i<9;i++){
		for(j=0;j<c[i];j++){
			
			a[temp]=i+1;
			temp++;
		}
		
		
	}
	/*for(i=0;i<9;i++){
		printf("%d ",a[i]);
		
	}*/
	for(i=8;i>=0;i--){
		if(a[i]!=0){
		printf("%d",a[i]);
		}
		
	}
	printf("\n");
	
	
return 0;
}
0