結果

問題 No.5 数字のブロック
ユーザー A63295A63295
提出日時 2015-12-19 13:50:10
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 1,206 ms
コンパイル使用メモリ 24,464 KB
実行使用メモリ 4,540 KB
最終ジャッジ日時 2023-10-14 14:18:47
合計ジャッジ時間 3,227 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 0 ms
4,348 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 71 ms
4,348 KB
testcase_04 AC 18 ms
4,348 KB
testcase_05 AC 122 ms
4,352 KB
testcase_06 AC 50 ms
4,352 KB
testcase_07 AC 35 ms
4,348 KB
testcase_08 AC 61 ms
4,352 KB
testcase_09 AC 9 ms
4,376 KB
testcase_10 AC 118 ms
4,348 KB
testcase_11 AC 30 ms
4,352 KB
testcase_12 AC 76 ms
4,352 KB
testcase_13 AC 103 ms
4,352 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 116 ms
4,348 KB
testcase_17 AC 167 ms
4,352 KB
testcase_18 AC 133 ms
4,352 KB
testcase_19 AC 183 ms
4,352 KB
testcase_20 WA -
testcase_21 AC 0 ms
4,352 KB
testcase_22 AC 1 ms
4,356 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 1 ms
4,348 KB
testcase_25 AC 2 ms
4,352 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 18 ms
4,348 KB
testcase_30 AC 11 ms
4,352 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
int main(void){
int i, j, tmp, L, N;
int W[10000] = {};
scanf("%d%d", &L, &N);

for( i = 0; i < N; i++){
scanf("%d",&W[i]);
}
for( i = 0; i < N - 1; ++i){
	for ( j = i + 1; j < N; ++j){
		if ( W[i] > W[j]){
			tmp = W[i];
			W[i] = W[j];
			W[j] = tmp;
	
		} 
	}
}
int goukei = 0, count = 0;
for ( i = 0; goukei < L; i++){
	goukei += W[i];
	count++;
}
if(goukei > L){
	count--;
}
printf ("%d",count);
return 0;
}
0