結果
問題 |
No.208 王将
|
ユーザー |
|
提出日時 | 2016-06-18 00:38:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 773 bytes |
コンパイル時間 | 835 ms |
コンパイル使用メモリ | 98,696 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 05:17:28 |
合計ジャッジ時間 | 1,592 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <limits> #include <climits> #include <cfloat> #include <functional> using namespace std; int main() { int x, y, x2, y2; cin >> x >> y >> x2 >> y2; long long ans = max(x, y); if(abs(x) == abs(y) && abs(x2) == abs(y2) && abs(x) > abs(x2)){ x /= max(1, abs(x) ); y /= max(1, abs(y) ); x2 /= max(1, abs(x2)); y2 /= max(1, abs(y2)); if(x == x2 && y == y2) ++ ans; } cout << ans << endl; return 0; }