結果

問題 No.612 Move on grid
ユーザー tailstails
提出日時 2017-12-12 01:00:18
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 216 ms / 2,500 ms
コード長 510 bytes
コンパイル時間 1,802 ms
コンパイル使用メモリ 29,952 KB
実行使用メモリ 62,464 KB
最終ジャッジ日時 2024-12-18 00:45:30
合計ジャッジ時間 2,988 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,816 KB
testcase_02 AC 1 ms
6,816 KB
testcase_03 AC 12 ms
6,820 KB
testcase_04 AC 216 ms
62,336 KB
testcase_05 AC 181 ms
62,336 KB
testcase_06 AC 173 ms
62,336 KB
testcase_07 AC 190 ms
62,336 KB
testcase_08 AC 171 ms
62,464 KB
testcase_09 AC 177 ms
62,208 KB
testcase_10 AC 71 ms
25,856 KB
testcase_11 AC 17 ms
7,424 KB
testcase_12 AC 95 ms
35,712 KB
testcase_13 AC 31 ms
12,800 KB
testcase_14 AC 132 ms
47,360 KB
testcase_15 AC 17 ms
8,064 KB
testcase_16 AC 172 ms
60,928 KB
testcase_17 AC 33 ms
13,824 KB
testcase_18 AC 127 ms
49,280 KB
testcase_19 AC 80 ms
30,592 KB
testcase_20 AC 158 ms
55,808 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:4:1: warning: data definition has no type or storage class
    4 | t;a;b;c;d;e;r;
      | ^
main.c:4:1: warning: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
main.c:4:3: warning: data definition has no type or storage class
    4 | t;a;b;c;d;e;r;
      |   ^
main.c:4:3: warning: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:4:5: warning: data definition has no type or storage class
    4 | t;a;b;c;d;e;r;
      |     ^
main.c:4:5: warning: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
main.c:4:7: warning: data definition has no type or storage class
    4 | t;a;b;c;d;e;r;
      |       ^
main.c:4:7: warning: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:4:9: warning: data definition has no type or storage class
    4 | t;a;b;c;d;e;r;
      |         ^
main.c:4:9: warning: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
main.c:4:11: warning: data definition has no type or storage class
    4 | t;a;b;c;d;e;r;
      |           ^
main.c:4:11: warning: type defaults to 'int' in declaration of 'e' [-Wimplicit-int]
main.c:4:13: warning: data definition has no type or storage class
    4 | t;a;b;c;d;e;r;
      |             ^
main.c:4:13: warning: type defaults to 'int' in declaration of 'r' [-Wimplicit-int]
main.c:5:1: warning: data definition has no type or storage class
    5 | s[600][C*2];
      | ^
main.c:5:1: warning: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:7:1: warning: return type defaults to 'int' [-Wimplicit-int]
    7 | main(u,i){
      | ^~~~
main.c: In function 'main':
main.c:7:1: warning: type of 'u' defaults to 'int' [-Wimplicit-int]
main.c:7:1: warning: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:8:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |         scanf("%d%d%d%d%d%d",&t,&a,&b,&c,&d,&e);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaratio

ソースコード

diff #

#define M 1000000007
#define C 70000

t;a;b;c;d;e;r;
s[600][C*2];

main(u,i){
	scanf("%d%d%d%d%d%d",&t,&a,&b,&c,&d,&e);
	s[0][C]=1;
	for(u=0;u<t;++u){
		for(i=u*-60;i<=u*60;++i){
			int sui=s[u][C+i];
			s[u+1][C+i-a]=(s[u+1][C+i-a]+sui)%M;
			s[u+1][C+i+a]=(s[u+1][C+i+a]+sui)%M;
			s[u+1][C+i-b]=(s[u+1][C+i-b]+sui)%M;
			s[u+1][C+i+b]=(s[u+1][C+i+b]+sui)%M;
			s[u+1][C+i-c]=(s[u+1][C+i-c]+sui)%M;
			s[u+1][C+i+c]=(s[u+1][C+i+c]+sui)%M;
		}
	}
	for(i=d;i<=e;++i){
		r=(r+s[t][C+i])%M;
	}
	printf("%d",r);
}
0