結果
問題 |
No.1412 Super Ryuo
|
ユーザー |
|
提出日時 | 2024-03-23 12:03:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 541 bytes |
コンパイル時間 | 4,194 ms |
コンパイル使用メモリ | 250,464 KB |
最終ジャッジ日時 | 2025-02-20 13:11:06 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; using ld = long double; int a, b, c, d; int dx[12] = {-1, -1, 1, 1, -2, -2, -1, -1, 1, 1, 2, 2}; int dy[12] = {-1, 1, -1, 1, -1, 1, -2, 2, -2, 2, -1, 1}; int main() { cin >> a >> b >> c >> d; if (a == c || b == d) { cout << 1 << endl; return 0; } for (int i = 0; i < 12; i++) { if (a + dx[i] == c && b + dy[i] == d) { cout << 1 << endl; return 0; } } cout << 2 << endl; return 0; }