結果

問題 No.41 貯金箱の溜息(EASY)
コンテスト
ユーザー ciel
提出日時 2015-11-22 00:20:29
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 210 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 119 ms
コンパイル使用メモリ 29,764 KB
最終ジャッジ日時 2026-02-23 19:54:08
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class
    2 | A[M+1]={1},i;main(z){
      | ^
main.c: In function ‘main’:
main.c:5:13: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    5 |         for(scanf("%d",&m);~scanf("%lld",&m);)printf("%d\n",A[m/111111]);
      |             ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | #define M 1000000
main.c:5:21: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long long int *’ [-Wformat=]
    5 |         for(scanf("%d",&m);~scanf("%lld",&m);)printf("%d\n",A[m/111111]);
      |                    ~^  ~~
      |                     |  |
      |                     |  long long int *
      |                     int *
      |                    %lld
main.c:5:47: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
    5 |         for(scanf("%d",&m);~scanf("%lld",&m);)printf("%d\n",A[m/111111]);
      |                                               ^~~~~~
main.c:5:47: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:6:9: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
    6 |         exit(0);
      |         ^~~~
main.c:1:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
  +++ |+#include <stdlib.h>
    1 | #define M 1000000

ソースコード

diff #
raw source code

#define M 1000000
A[M+1]={1},i;main(z){
	for(z=10;z--;)for(i=0;i<=M-(z+!z);i++)A[i+z+!z]=(A[i+z+!z]+A[i])%1000000009;
	long long m;
	for(scanf("%d",&m);~scanf("%lld",&m);)printf("%d\n",A[m/111111]);
	exit(0);
}
0