結果

問題 No.5 数字のブロック
ユーザー つなぎつなぎ
提出日時 2016-03-16 13:52:58
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 21,760 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-09 19:58:59
合計ジャッジ時間 2,448 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 WA -
testcase_03 AC 77 ms
6,940 KB
testcase_04 AC 19 ms
6,944 KB
testcase_05 WA -
testcase_06 AC 52 ms
6,944 KB
testcase_07 AC 36 ms
6,944 KB
testcase_08 AC 63 ms
6,940 KB
testcase_09 AC 9 ms
6,940 KB
testcase_10 AC 126 ms
6,940 KB
testcase_11 AC 31 ms
6,944 KB
testcase_12 AC 81 ms
6,940 KB
testcase_13 AC 110 ms
6,940 KB
testcase_14 AC 1 ms
6,940 KB
testcase_15 WA -
testcase_16 AC 127 ms
6,944 KB
testcase_17 AC 177 ms
6,944 KB
testcase_18 AC 143 ms
6,940 KB
testcase_19 AC 199 ms
6,940 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1 ms
6,940 KB
testcase_24 AC 1 ms
6,940 KB
testcase_25 AC 1 ms
6,940 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 | scanf("%d\n%d\n",&l,&n);
      | ^~~~~~~~~~~~~~~~~~~~~~~
main.c:10:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 | scanf("%d",&min[i]);
      | ^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main(void) {
int l,n,i,j,k;

scanf("%d\n%d\n",&l,&n);
i=n-1;
int min[i];

for(i=0;i<n;i++){
scanf("%d",&min[i]);
}

for(i=0;i<n-1;i++){
for(j=i+1;j<n;j++){
if(min[i]>min[j]){
k=min[i];
min[i]=min[j];
min[j]=k;
}
}
}

int sum=0;
for(i=0;i<n;i++){
if(sum<l){
sum=sum+min[i];
}
else{break;}
}
printf("%d",i-1);
	return 0;
}
0