結果

問題 No.385 カップ麺生活
ユーザー cielciel
提出日時 2016-07-03 23:23:24
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 20,864 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-20 21:43:25
合計ジャッジ時間 980 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 0 ms
6,940 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
6,944 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    6 |         scanf("%d%d",&m,&n);
      |         ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | int T[10001],A[10001];
main.c:6:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d%d",&m,&n);
      |         ^~~~~
main.c:6:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:15:13: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
   15 |         *A=!printf("%lld\n",r+ma);
      |             ^~~~~~
main.c:15:13: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:15:13: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
main.c:15:13: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

ソースコード

diff #

int T[10001],A[10001];
int main(){
	int m,n,i,j,k,ma=0;
	long long r=0;
	T[0]=T[1]=1;
	scanf("%d%d",&m,&n);
	for(i=0;i<n;i++)for(scanf("%d",&k),j=0;j<=m-k;j++)if(A[j]&&A[j+k]<=A[j])A[j+k]=A[j]+1;
	for(i=0;i<=m;i++){
		if(ma<A[i])ma=A[i];
		if(!T[i]){
			r+=A[m-i];
			for(j=i;j<=m;j+=i)T[j]=1;
		}
	}
	*A=!printf("%lld\n",r+ma);
}
0