結果
問題 | No.208 王将 |
ユーザー |
![]() |
提出日時 | 2016-02-16 23:59:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 497 bytes |
コンパイル時間 | 459 ms |
コンパイル使用メモリ | 60,252 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 16:29:43 |
合計ジャッジ時間 | 1,237 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; #define RREP(i,s,e) for (int i = e-1; i >= s; i--) #define rrep(i,n) RREP(i,0,n) #define REP(i,s,e) for (int i = s; i < e; i++) #define rep(i,n) REP(i,0,n) int main() { int x1, y1, x2, y2, ans; cin >> x1 >> y1 >> x2 >> y2; ans = max(abs(x1),abs(y1)); if (abs(x1) == abs(y1) && abs(x2) == abs(y2) && abs(x1) > abs(x2) && x1*x2 > 0 && y1*y2 > 0) ans++; cout << ans << endl; return 0; }