結果

問題 No.325 マンハッタン距離2
ユーザー FF256grhyFF256grhy
提出日時 2015-12-21 23:28:13
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 278 bytes
コンパイル時間 839 ms
コンパイル使用メモリ 21,152 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-18 22:10:06
合計ジャッジ時間 2,152 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 0 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 0 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1 ms
4,348 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 1 ms
4,348 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1 ms
4,348 KB
testcase_24 WA -
testcase_25 AC 0 ms
4,348 KB
testcase_26 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:65: warning: return type defaults to ‘int’ [-Wimplicit-int]
    1 | typedef long long l;l q,i,m;l f(l n){m+=n;return m>0?m*-~m/2:0;}main(s,t,u,v,d,x,y){scanf("%d%d%d%d%d",&s,&t,&u,&v,&d);q=s<=0&0<=u&t<=0&0<=v;while(i++<4){x=s>0?s:0;y=t>1?t:1;m=d-x-y+1;x-=u+1;y-=v+1;if(x<0&y<0)q+=f(0)-f(x)-f(y)+f(x+y);x=s;s=-v;v=u;u=-t;t=x;}i=!printf("%lld",q);}
      |                                                                 ^~~~
main.c: In function ‘main’:
main.c:1:65: warning: type of ‘s’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:65: warning: type of ‘t’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:65: warning: type of ‘u’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:65: warning: type of ‘v’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:65: warning: type of ‘d’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:65: warning: type of ‘x’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:65: warning: type of ‘y’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:85: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    1 | typedef long long l;l q,i,m;l f(l n){m+=n;return m>0?m*-~m/2:0;}main(s,t,u,v,d,x,y){scanf("%d%d%d%d%d",&s,&t,&u,&v,&d);q=s<=0&0<=u&t<=0&0<=v;while(i++<4){x=s>0?s:0;y=t>1?t:1;m=d-x-y+1;x-=u+1;y-=v+1;if(x<0&y<0)q+=f(0)-f(x)-f(y)+f(x+y);x=s;s=-v;v=u;u=-t;t=x;}i=!printf("%lld",q);}
      |                                                                                     ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | typedef long long l;l q,i,m;l f(l n){m+=n;return m>0?m*-~m/2:0;}main(s,t,u,v,d,x,y){scanf("%d%d%d%d%d",&s,&t,&u,&v,&d);q=s<=0&0<=u&t<=0&0<=v;while(i++<4){x=s>0?s:0;y=t>1?t:1;m=d-x-y+1;x-=u+1;y-=v+1;if(x<0&y<0)q+=f(0)-f(x)-f(y)+f(x+y);x=s;s=-v;v=u;u=-t;t=x;}i=!printf("%lld",q);}
main.c:1:85: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaratio

ソースコード

diff #

typedef long long l;l q,i,m;l f(l n){m+=n;return m>0?m*-~m/2:0;}main(s,t,u,v,d,x,y){scanf("%d%d%d%d%d",&s,&t,&u,&v,&d);q=s<=0&0<=u&t<=0&0<=v;while(i++<4){x=s>0?s:0;y=t>1?t:1;m=d-x-y+1;x-=u+1;y-=v+1;if(x<0&y<0)q+=f(0)-f(x)-f(y)+f(x+y);x=s;s=-v;v=u;u=-t;t=x;}i=!printf("%lld",q);}
0