結果

問題 No.340 雪の足跡
ユーザー YasukeXXXYasukeXXX
提出日時 2016-02-11 00:35:33
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,013 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 23,996 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 22:38:38
合計ジャッジ時間 1,972 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 0 ms
4,348 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
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 -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%d%d%d",&w,&h,&n);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
main.c:15:26: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |         for(i=0;i<n;i++){scanf("%d",&m);int tmp[m+1];
      |                          ^~~~~~~~~~~~~~
main.c:16:36: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |                 for(j=0;j<m+1;j++){scanf("%d",tmp+j);}
      |                                    ^~~~~~~~~~~~~~~~~
main.c:25:58: warning: ‘__builtin_memcpy’ reading between 4 and 8589934588 bytes from a region of size 0 [-Wstringop-overread]
   25 |         for(i=0;i<w*h;i++){for(j=0;j<w*h;j++){H_org[i][j]=H[i][j];}}
      |                                               ~~~~~~~~~~~^~~~~~~~
main.c:13:13: note: source object ‘H’ of size 0
   13 |         int H[w*h][w*h],d=1;
      |             ^
main.c:13:13: note: source object ‘H’ of size 0
main.c:26:22: warning: ‘dot’ accessing 1 byte in a region of size 0 [-Wstringop-overflow=]
   26 |         while(w*h-d){dot(H,H_org);d++;
      |                      ^~~~~~~~~~~~
main.c:26:22: note: referencing argument 1 of type ‘int (*)[<Udb40>]’
main.c:3:6: note: in a call to function ‘dot’
    3 | void dot(int list[w*h][w*h], int H[w*h][w*h]){
      |      ^~~

ソースコード

diff #

#include<stdio.h>
int w,h,n,m,ld,min,i,j,k;
void dot(int list[w*h][w*h], int H[w*h][w*h]){
	int tmp[w*h][w*h],ans=0;
	for(i=0;i<w*h;i++){for(j=0;j<w*h;j++){tmp[i][j]=list[i][j];}}
	for(i=0;i<w*h;i++){for(j=0;j<w*h;j++){
		for(k=0;k<w*h;k++){ans+=tmp[i][k]*H[k][j];}
		list[i][j]=ans;
		ans=0;}}}
int main(){
	scanf("%d%d%d",&w,&h,&n);
	if(w&&h){puts("0");return 0;}
	int H[w*h][w*h],d=1;
	for(i=0;i<w*h;i++){for(j=0;j<w*h;j++){H[i][j]=0;}}
	for(i=0;i<n;i++){scanf("%d",&m);int tmp[m+1];
		for(j=0;j<m+1;j++){scanf("%d",tmp+j);}
		for(j=0;j<m;j++){
			ld=tmp[j]>tmp[j+1]?(tmp[j]-tmp[j+1]):(tmp[j+1]-tmp[j]);
			min=tmp[j]>tmp[j+1]?tmp[j+1]:tmp[j];
			for(k=0;k<ld/w;k++){
				H[min+k*w][min+(k+1)*w]=1;H[min+(k+1)*w][min+k*w]=1;}
			if(ld/w==0){for(k=0;k<ld;k++){
				H[min+k][min+(k+1)]=1;H[min+(k+1)][min+k]=1;}}}}
	int H_org[w*h][w*h];
	for(i=0;i<w*h;i++){for(j=0;j<w*h;j++){H_org[i][j]=H[i][j];}}
	while(w*h-d){dot(H,H_org);d++;
		if(H[0][w*h-1]){printf("%d",d);return 0;}}
	puts("Odekakedekinai..");return 0;}
0