結果
| 問題 | No.325 マンハッタン距離2 |
| コンテスト | |
| ユーザー |
FF256grhy
|
| 提出日時 | 2015-12-21 23:41:02 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 278 bytes |
| 記録 | |
| コンパイル時間 | 149 ms |
| コンパイル使用メモリ | 20,992 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-18 18:11:21 |
| 合計ジャッジ時間 | 881 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);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){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);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){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);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
ソースコード
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);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);}
FF256grhy