結果
| 問題 |
No.1412 Super Ryuo
|
| コンテスト | |
| ユーザー |
warm4C0
|
| 提出日時 | 2023-05-07 21:51:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 443 bytes |
| コンパイル時間 | 1,257 ms |
| コンパイル使用メモリ | 159,336 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-24 20:34:07 |
| 合計ジャッジ時間 | 1,942 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
bool ok = false;
for (int dy = -3; dy <= 3; dy++) {
for (int dx = -3; dx <= 3; dx++) {
int nx = a + dx;
int ny = b + dy;
if (abs(a-nx) + abs(b-ny) <= 3) {
if (nx == c && ny == d) {
ok = true;
}
}
}
}
if (a == c || b == d) {
ok = true;
}
if (ok) {
puts("1");
} else {
puts("2");
}
return 0;
}
warm4C0