結果

問題 No.325 マンハッタン距離2
ユーザー testestesttestestest
提出日時 2017-03-02 23:08:45
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 236 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 28,872 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-03 21:13:43
合計ジャッジ時間 1,704 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 0 ms
4,380 KB
testcase_05 AC 0 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 0 ms
4,376 KB
testcase_08 AC 0 ms
4,376 KB
testcase_09 AC 0 ms
4,380 KB
testcase_10 AC 0 ms
4,380 KB
testcase_11 AC 0 ms
4,380 KB
testcase_12 AC 0 ms
4,380 KB
testcase_13 AC 0 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 0 ms
4,376 KB
testcase_16 AC 0 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 0 ms
4,380 KB
testcase_19 AC 0 ms
4,376 KB
testcase_20 AC 0 ms
4,376 KB
testcase_21 AC 0 ms
4,380 KB
testcase_22 AC 0 ms
4,376 KB
testcase_23 AC 0 ms
4,380 KB
testcase_24 AC 0 ms
4,380 KB
testcase_25 AC 0 ms
4,376 KB
testcase_26 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:18: 警告: データ定義が型または記憶域クラスを持っていません
    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;printf("%ld",m);}
      |                  ^
main.c:2:18: 警告: 型がデフォルトの ‘int’ に ‘C’ の宣言内でなります [-Wimplicit-int]
main.c:2:20: 警告: 型がデフォルトの ‘int’ に ‘D’ の宣言内でなります [-Wimplicit-int]
    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;printf("%ld",m);}
      |                    ^
main.c:2:22: 警告: 型がデフォルトの ‘int’ に ‘d’ の宣言内でなります [-Wimplicit-int]
    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;printf("%ld",m);}
      |                      ^
main.c:2:24: 警告: 戻り値の型をデフォルトの ‘int’ にします [-Wimplicit-int]
    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;printf("%ld",m);}
      |                        ^~~~
main.c: 関数 ‘main’ 内:
main.c:2:24: 警告: ‘i’ の型をデフォルトの ‘int’ にします [-Wimplicit-int]
main.c:2:32: 警告: 関数 ‘scanf’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    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;printf("%ld",m);}
      |                                ^~~~~
main.c:1:1: 備考: include ‘<stdio.h>’ or prov

ソースコード

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;printf("%ld",m);}
0