結果

問題 No.41 貯金箱の溜息(EASY)
コンテスト
ユーザー ciel
提出日時 2015-11-22 00:15:30
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 279 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 111 ms
コンパイル使用メモリ 29,896 KB
最終ジャッジ日時 2026-02-23 19:54:06
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:21: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long long int *’ [-Wformat=]
    9 |         for(scanf("%d",&m);~scanf("%lld",&m);){
      |                    ~^  ~~
      |                     |  |
      |                     |  long long int *
      |                     int *
      |                    %lld
main.c:9:13: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         for(scanf("%d",&m);~scanf("%lld",&m);){
      |             ^~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>
#define M 1000000
int A[M+1],i;
int main(z){
	A[0]=1;
	for(;z<=9;z++)for(i=0;i<=M-z;i++)A[i+z]=(A[i+z]+A[i])%1000000009;
	for(i=0;i<M;i++)A[i+1]=(A[i+1]+A[i])%1000000009;
	long long m;
	for(scanf("%d",&m);~scanf("%lld",&m);){
		printf("%d\n",A[m/111111]);
	}
}
0