結果
問題 |
No.2843 Birthday Present Struggle
|
ユーザー |
![]() |
提出日時 | 2024-08-23 21:18:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 33 ms / 2,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 2,051 ms |
コンパイル使用メモリ | 197,656 KB |
最終ジャッジ日時 | 2025-02-23 23:28:37 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; int cx, cy; cin >> N >> cx >> cy >> cx >> cy >> cx >> cy; vector<pair<int, int>> ans; if(cx - 1 >= 1) ans.push_back(make_pair(cx - 1, cy)); if(cx + 1 <= N) ans.push_back(make_pair(cx + 1, cy)); if(cy - 1 >= 1) ans.push_back(make_pair(cx, cy - 1)); if(cy + 1 <= N) ans.push_back(make_pair(cx, cy + 1)); cout << ans.size() << endl; for(const auto &[x, y] : ans) cout << x << " " << y << endl; }