結果
| 問題 | No.325 マンハッタン距離2 |
| コンテスト | |
| ユーザー |
FF256grhy
|
| 提出日時 | 2015-12-22 13:58:13 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 273 bytes |
| 記録 | |
| コンパイル時間 | 265 ms |
| コンパイル使用メモリ | 20,736 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-18 18:36:12 |
| 合計ジャッジ時間 | 1,217 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
コンパイルメッセージ
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){n+=m;return n>0?n*-~n/2:0;}main(s,t,u,v,d,x,y){scanf("%d%d%d%d%d",&s,&t,&u,&v,&d);for(q=!(s>0|0>u|t>0|0>v);x=s>0?s:0,y=t>1?t:1,m=d-x-y+1,x-=u+1,y-=v+1,i++<4;x=s,s=-v,v=u,u=-t,t=x)if(x<0&y<0)q+=f(0)-f(x)-f(y)+f(x+y);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){n+=m;return n>0?n*-~n/2:0;}main(s,t,u,v,d,x,y){scanf("%d%d%d%d%d",&s,&t,&u,&v,&d);for(q=!(s>0|0>u|t>0|0>v);x=s>0?s:0,y=t>1?t:1,m=d-x-y+1,x-=u+1,y-=v+1,i++<4;x=s,s=-v,v=u,u=-t,t=x)if(x<0&y<0)q+=f(0)-f(x)-f(y)+f(x+y);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){n+=m;return n>0?n*-~n/2:0;}main(s,t,u,v,d,x,y){scanf("%d%d%d%d%d",&s,&t,&u,&v,&d);for(q=!(s>0|0>u|t>0|0>v);x=s>0?s:0,y=t>1?t:1,m=d-x-y+1,x-=u+1,y-=v+1,i++<4;x=s,s=-v,v=u,u=-t,t=x)if(x<0&y<0)q+=f(0)-f(x)-f(y)+f(x+y);i=!printf("%lld",q);}
main.c:1:85: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
ソースコード
typedef long long l;l q,i,m;l f(l n){n+=m;return n>0?n*-~n/2:0;}main(s,t,u,v,d,x,y){scanf("%d%d%d%d%d",&s,&t,&u,&v,&d);for(q=!(s>0|0>u|t>0|0>v);x=s>0?s:0,y=t>1?t:1,m=d-x-y+1,x-=u+1,y-=v+1,i++<4;x=s,s=-v,v=u,u=-t,t=x)if(x<0&y<0)q+=f(0)-f(x)-f(y)+f(x+y);i=!printf("%lld",q);}
FF256grhy