結果
問題 |
No.1412 Super Ryuo
|
ユーザー |
|
提出日時 | 2021-03-11 13:08:36 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 485 bytes |
コンパイル時間 | 698 ms |
コンパイル使用メモリ | 65,664 KB |
最終ジャッジ日時 | 2025-01-19 13:30:42 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <iostream> using namespace std; void solve() { int sx, sy, gx, gy; cin >> sx >> sy >> gx >> gy; auto dx = abs(gx - sx), dy = abs(gy - sy); if (dx == 0 && dy == 0) { cout << "0\n"; } else if (dx == 0 || dy == 0 || (dx <= 3 && dy <= 3 && dx + dy <= 3)) { cout << "1\n"; } else { cout << "2\n"; } } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); solve(); return 0; }