結果
問題 |
No.208 王将
|
ユーザー |
![]() |
提出日時 | 2015-07-26 19:12:04 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 398 bytes |
コンパイル時間 | 96 ms |
コンパイル使用メモリ | 20,864 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 14:09:49 |
合計ジャッジ時間 | 766 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 WA * 2 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:13:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%d%d%d%d",&x,&y,&x2,&y2); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> #include<stdlib.h> #define ABS(x) ((x)>0?(x):-(x)) #define MAX(a,b) ((a)>(b)?(a):(b)) typedef long long int ln; int main(void){ int x,y; int x2,y2; scanf("%d%d%d%d",&x,&y,&x2,&y2); if(ABS(x)==ABS(y) && ABS(x2)==ABS(y2) && x/ABS(x)==x2/ABS(x2) && y/ABS(y)==y2/ABS(y2)){ printf("%d\n",MAX(ABS(x),ABS(y))+1); } else { printf("%d\n",MAX(ABS(x),ABS(y))); } return 0; }