結果
| 問題 |
No.2843 Birthday Present Struggle
|
| コンテスト | |
| ユーザー |
Today03
|
| 提出日時 | 2024-08-23 21:08:43 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 2,000 ms |
| コード長 | 585 bytes |
| コンパイル時間 | 2,027 ms |
| コンパイル使用メモリ | 197,548 KB |
| 最終ジャッジ日時 | 2025-02-23 23:25:09 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 34 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9 + 10;
const ll INFL = 4e18;
int main() {
int N;
cin >> N;
int ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
vector<pair<int, int>> ans;
for (auto [dx, dy] : {pair{1, 0}, {0, 1}, {0, -1}, {-1, 0}}) {
int x = cx + dx;
int y = cy + dy;
if (x > N || x < 1 || y > N || y < 1) continue;
ans.push_back({x, y});
}
cout << ans.size() << endl;
for (auto [x, y] : ans) {
cout << x << ' ' << y << endl;
}
}
Today03