結果
| 問題 | 
                            No.2843 Birthday Present Struggle
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-08-31 12:01:19 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 2,663 bytes | 
| コンパイル時間 | 1,238 ms | 
| コンパイル使用メモリ | 117,096 KB | 
| 最終ジャッジ日時 | 2025-02-24 03:29:46 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 10 WA * 24 | 
ソースコード
#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;
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;
    bool ok=false;
    for(int i=1;i<=N && !ok;i++){
        //x=iの軸に沿って壁を作るとする
        if(A.second<i && B.second<i && C.second>i){
            bool is_satisfied=true;
            
            for(int y=1;y<=N;y++){
                ans.push_back({y,i});
                //if(y==A.first || y==B.first || y==C.first) is_satisfied=false;
                
            }
            
            if(is_satisfied){
                ok=true;
            }else{
                ans.clear();
            }
        }
    }
    for(int i=1;i<=N && !ok;i++){
        //x=iの軸に沿って壁を作るとする
        if(A.second>i && B.second>i && C.second<i){
            bool is_satisfied=true;
            
            for(int y=1;y<=N;y++){
                ans.push_back({y,i});
                //if(y==A.first || y==B.first || y==C.first) is_satisfied=false;
                
            }
            
            if(is_satisfied){
                ok=true;
            }else{
                ans.clear();
            }
        }
    }
    for(int i=1;i<=N && !ok; i++){
        //y=iの軸に沿って壁を作るとする
        if(A.first<i && B.first<i && C.first>i){
            bool is_satisfied=true;
            for(int x=1;x<=N;x++){
                ans.push_back({i,x});
                //if(x==A.second || x==B.second || x==C.second) is_satisfied=false;
            }
            if(is_satisfied){
                ok=true;
            }else{
                ans.clear();
            }
        }
    }
    for(int i=1;i<=N && !ok; i++){
        //y=iの軸に沿って壁を作るとする
        if(A.first>i && B.first>i && C.first<i){
            bool is_satisfied=true;
            for(int x=1;x<=N;x++){
                ans.push_back({i,x});
                //if(x==A.second || x==B.second || x==C.second) is_satisfied=false;
            }
            if(is_satisfied){
                ok=true;
            }else{
                ans.clear();
            }
        }
    }
    cout<<ans.size()<<endl;
    for(auto [y,x]:ans){
        cout<<y<<" "<<x<<endl;
    }
}