結果

問題 No.2843 Birthday Present Struggle
ユーザー HIcoder
提出日時 2024-08-31 12:19:25
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 1,037 bytes
コンパイル時間 876 ms
コンパイル使用メモリ 115,816 KB
最終ジャッジ日時 2025-02-24 03:29:51
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

/*

CとAが斜めに隣接する場合
.......
...C...
..A....
.....B.
.......


.......
###C###
..A#...
.....B.
.......




.......
.......
..A....
...C.B.
.......


*/
#include<iostream>
#include<string>
#include<queue>
#include<vector>
#include<cassert>
#include<random>
#include<set>
#include<map>
#include<cassert>
#include<unordered_map>
#include<bitset>
#include<numeric>
#include<algorithm>
using namespace std;
typedef long long ll;
const int inf=1<<30;
const ll INF=1LL<<62;
typedef pair<int,ll> P;
typedef pair<int,P> PP; 
const ll MOD=998244353;
const int dy[]={0,1,0,-1};
const int dx[]={1,0,-1,0};

int main(){
    int N;
    cin>>N;

    P A,B,C;
    cin>>A.first>>A.second;
    cin>>B.first>>B.second;
    cin>>C.first>>C.second;

    vector<P> ans;

    for(int k=0;k<4;k++){
        int nx=C.second+dx[k],ny=C.first+dy[k];
        if(1<=nx && nx<=N && 1<=ny && ny<=N){
            ans.push_back({ny,nx});
        }
    }




    cout<<ans.size()<<endl;
    for(auto [y,x]:ans){
        cout<<y<<" "<<x<<endl;
    }

}
0