結果
問題 |
No.410 出会い
|
ユーザー |
![]() |
提出日時 | 2018-01-17 15:29:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 394 bytes |
コンパイル時間 | 462 ms |
コンパイル使用メモリ | 56,656 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 06:42:40 |
合計ジャッジ時間 | 1,274 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 18 WA * 1 |
ソースコード
#include<iostream> #include<vector> #include<string> #include<cstdio> using namespace std; int main(){ long int x1,x2,y1,y2,a,b,ans; cin >> x1 >> y1 >> x2 >> y2; if(x1-x2>0) a=x1-x2; else a=(x1-x2)*-1; if(y1-y2>0) b=y1-y2; else b=(y1-y2)*-1; ans = (a+b)/2; if((a%2==0&&b%2==0)||(a%2==1&&b%2==1)) cout << ans; else cout << (double)ans+0.5; return 0; }