結果

問題 No.466 ジオラマ
ユーザー vjudge1
提出日時 2025-06-21 18:49:15
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,525 bytes
コンパイル時間 3,295 ms
コンパイル使用メモリ 279,132 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-06-21 18:49:25
合計ジャッジ時間 8,375 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 70 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define fi first
#define sc second
#define pii pair<int,int>
#define pdd pair<double,double>
#define pb push_back
#define umap unordered_map
#define mset multiset
#define pq priority_queue
#define ull unsigned long long
#define i128 __int128
#define ld long double
#define fixs fixed<<setprecision
int a,b,c,d,cnt;
void solve(){
    cin>>a>>b>>c>>d,cnt=1;
    if(a==c){
        b--;
        if(b>d) return cout<<"-1"<<endl,void();
        cout<<b+1<<" "<<b<<endl<<"1 0"<<endl;
        for(int i=1;i<=b-c;i++) cout<<1<<" "<<++cnt<<endl;
        for(int i=1;i<c;i++) cout<<0<<" "<<++cnt<<endl;
        return ;
    }
    if(b==c){
        a--;
        if(a>d) return cout<<"-1"<<endl,void();
        cout<<a+1<<" "<<a<<endl<<"0 1"<<endl;
        for(int i=1;i<=a-c;i++) cout<<0<<" "<<++cnt<<endl;
        for(int i=1;i<c;i++) cout<<1<<" "<<++cnt<<endl;
        return ;
    }
    a--,b--;
    if((a-c)+(b-c)+(c?c+1:0)>d) return cout<<"-1"<<endl,void();
    cout<<(a-c)+(b-c)+c+2<<" "<<(a-c)+(b-c)+(c?c+1:0)<<endl;
    for(int i=1;i<=a-c;i++) cout<<0<<" "<<++cnt<<endl;
    for(int i=1;i<=b-c;i++) cout<<1<<" "<<++cnt<<endl;
    if(!c) return ;
    int rt=++cnt;
    cout<<0<<" "<<rt<<endl<<1<<" "<<rt<<endl;
    for(int i=1;i<c;i++) cout<<rt<<" "<<++cnt<<endl;
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--) solve();
    return 0;
}
/*
Samples
input:

output:

THINGS TODO:
??freopen???????
????
????????????
*/
0