結果

問題 No.2843 Birthday Present Struggle
ユーザー HIcoderHIcoder
提出日時 2024-08-31 12:01:19
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,663 bytes
コンパイル時間 1,381 ms
コンパイル使用メモリ 122,640 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-08-31 12:01:25
合計ジャッジ時間 5,669 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 3 ms
6,940 KB
testcase_25 AC 2 ms
6,940 KB
testcase_26 AC 2 ms
6,944 KB
testcase_27 WA -
testcase_28 AC 3 ms
6,940 KB
testcase_29 AC 2 ms
6,944 KB
testcase_30 WA -
testcase_31 AC 2 ms
6,940 KB
testcase_32 AC 3 ms
6,944 KB
testcase_33 AC 3 ms
6,944 KB
testcase_34 AC 3 ms
6,940 KB
testcase_35 AC 3 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
    }

}
0