結果

問題 No.2843 Birthday Present Struggle
ユーザー ochiaigawa
提出日時 2024-08-23 22:21:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 712 bytes
コンパイル時間 1,778 ms
コンパイル使用メモリ 198,296 KB
最終ジャッジ日時 2025-02-23 23:58:57
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
int main() {
  cin.tie(0); cout.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  int ax, ay;
  cin >> ax >> ay;
  int bx, by;
  cin >> bx >> by;
  int cx, cy;
  cin >> cx >> cy;
  vector<int> X, Y;
  for(int k = 0; k < 4; k++) {
    int nx = cx + dx[k];
    int ny = cy + dy[k];
    if(nx <= 0 || nx > N || ny <= 0 || ny > N) {
      continue;
    }
    X.emplace_back(nx);
    Y.emplace_back(ny);
  }
  int M = X.size();
  cout << M << '\n';
  for(int i = 0; i < M; i++) {
    cout << X[i] << ' ' << Y[i] << '\n';
  }
  return 0;
}
0