結果

問題 No.325 マンハッタン距離2
ユーザー testestesttestestest
提出日時 2016-07-10 14:47:17
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 239 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 24,740 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-25 02:46:41
合計ジャッジ時間 1,679 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,376 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 AC 0 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 0 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 0 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 0 ms
4,376 KB
testcase_13 AC 0 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 0 ms
4,376 KB
testcase_19 AC 0 ms
4,376 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 0 ms
4,376 KB
testcase_23 AC 0 ms
4,380 KB
testcase_24 AC 1 ms
4,384 KB
testcase_25 AC 0 ms
4,376 KB
testcase_26 AC 0 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:18: warning: data definition has no type or storage class
 long x,y,z,m,A,B;C,D,d;main(i){scanf("%ld%ld%d%d%d",&A,&B,&C,&D,&d);for(m=A*C<=0&B*D<=0;++i<6;z=(x*=A>0)+(y=B>1?B:1)-d,x-=C,y-=D,m-=f(1)-f(y)-f(x)+f(x+y-1))x=B,B=-C,C=D,D=-A,A=x;m=!printf("%ld",m);}
                  ^
main.c:2:18: warning: type defaults to ‘int’ in declaration of ‘C’ [-Wimplicit-int]
main.c:2:20: warning: type defaults to ‘int’ in declaration of ‘D’ [-Wimplicit-int]
 long x,y,z,m,A,B;C,D,d;main(i){scanf("%ld%ld%d%d%d",&A,&B,&C,&D,&d);for(m=A*C<=0&B*D<=0;++i<6;z=(x*=A>0)+(y=B>1?B:1)-d,x-=C,y-=D,m-=f(1)-f(y)-f(x)+f(x+y-1))x=B,B=-C,C=D,D=-A,A=x;m=!printf("%ld",m);}
                    ^
main.c:2:22: warning: type defaults to ‘int’ in declaration of ‘d’ [-Wimplicit-int]
 long x,y,z,m,A,B;C,D,d;main(i){scanf("%ld%ld%d%d%d",&A,&B,&C,&D,&d);for(m=A*C<=0&B*D<=0;++i<6;z=(x*=A>0)+(y=B>1?B:1)-d,x-=C,y-=D,m-=f(1)-f(y)-f(x)+f(x+y-1))x=B,B=-C,C=D,D=-A,A=x;m=!printf("%ld",m);}
                      ^
main.c:2:24: warning: return type defaults to ‘int’ [-Wimplicit-int]
 long x,y,z,m,A,B;C,D,d;main(i){scanf("%ld%ld%d%d%d",&A,&B,&C,&D,&d);for(m=A*C<=0&B*D<=0;++i<6;z=(x*=A>0)+(y=B>1?B:1)-d,x-=C,y-=D,m-=f(1)-f(y)-f(x)+f(x+y-1))x=B,B=-C,C=D,D=-A,A=x;m=!printf("%ld",m);}
                        ^~~~
main.c: In function ‘main’:
main.c:2:24: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int]
main.c:2:32: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
 long x,y,z,m,A,B;C,D,d;main(i){scanf("%ld%ld%d%d%d",&A,&B,&C,&D,&d);for(m=A*C<=0&B*D<=0;++i<6;z=(x*=A>0)+(y=B>1?B:1)-d,x-=C,y-=D,m-=f(1)-f(y)-f(x)+f(x+y-1))x=B,B=-C,C=D,D=-A,A=x;m=!printf("%ld",m);}
                                ^~~~~
main.c:2:32: warning: incompatible implicit declaration of built-in function ‘scanf’
main.c:2:32: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+#include <stdio.h>
 #define f(n)(x<1&y<1&n>z)*~(n-z)*(n-z)/2
 long x

ソースコード

diff #

#define f(n)(x<1&y<1&n>z)*~(n-z)*(n-z)/2
long x,y,z,m,A,B;C,D,d;main(i){scanf("%ld%ld%d%d%d",&A,&B,&C,&D,&d);for(m=A*C<=0&B*D<=0;++i<6;z=(x*=A>0)+(y=B>1?B:1)-d,x-=C,y-=D,m-=f(1)-f(y)-f(x)+f(x+y-1))x=B,B=-C,C=D,D=-A,A=x;m=!printf("%ld",m);}
0