結果
問題 |
No.208 王将
|
ユーザー |
![]() |
提出日時 | 2020-12-22 11:12:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 344 bytes |
コンパイル時間 | 1,793 ms |
コンパイル使用メモリ | 191,168 KB |
最終ジャッジ日時 | 2025-01-17 06:05:17 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int sx, sy, tx, ty; cin >> sx >> sy >> tx >> ty; auto dist = [](int x1, int y1, int x2, int y2) { return max(abs(x1 - x2), abs(y1 - y2)); }; int ans = dist(0, 0, sx, sy); if (sx == sy && tx == ty && sx > tx) ans++; cout << ans << endl; }