結果
問題 | No.208 王将 |
ユーザー |
![]() |
提出日時 | 2016-03-27 18:32:53 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 760 bytes |
コンパイル時間 | 581 ms |
コンパイル使用メモリ | 83,212 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 16:30:06 |
合計ジャッジ時間 | 1,387 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
/* -*- coding: utf-8 -*- * * 208.cc: No.208 王将 - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int x, y, x2, y2; cin >> x >> y >> x2 >> y2; int ax = abs(x), ay = abs(y), ax2 = abs(x2), ay2 = abs(y2); int ans = max(ax, ay); if (ax == ay && ax2 == ay2 && ax2 < ax && x * x2 > 0 && y * y2 > 0) ans++; printf("%d\n", ans); return 0; }