結果

問題 No.466 ジオラマ
ユーザー chaemonchaemon
提出日時 2016-12-16 00:24:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,631 bytes
コンパイル時間 1,039 ms
コンパイル使用メモリ 96,732 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-07 15:23:36
合計ジャッジ時間 10,664 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
5,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
5,376 KB
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 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 2 ms
5,376 KB
testcase_38 WA -
testcase_39 AC 2 ms
5,376 KB
testcase_40 WA -
testcase_41 AC 2 ms
5,376 KB
testcase_42 WA -
testcase_43 AC 2 ms
5,376 KB
testcase_44 WA -
testcase_45 AC 2 ms
5,376 KB
testcase_46 WA -
testcase_47 AC 2 ms
5,376 KB
testcase_48 WA -
testcase_49 AC 2 ms
5,376 KB
testcase_50 WA -
testcase_51 AC 2 ms
5,376 KB
testcase_52 WA -
testcase_53 AC 2 ms
5,376 KB
testcase_54 WA -
testcase_55 AC 1 ms
5,376 KB
testcase_56 WA -
testcase_57 AC 2 ms
5,376 KB
testcase_58 WA -
testcase_59 AC 2 ms
5,376 KB
testcase_60 WA -
testcase_61 AC 2 ms
5,376 KB
testcase_62 WA -
testcase_63 AC 2 ms
5,376 KB
testcase_64 WA -
testcase_65 AC 2 ms
5,376 KB
testcase_66 WA -
testcase_67 AC 2 ms
5,376 KB
testcase_68 WA -
testcase_69 AC 2 ms
5,376 KB
testcase_70 WA -
testcase_71 AC 2 ms
5,376 KB
testcase_72 WA -
testcase_73 AC 2 ms
5,376 KB
testcase_74 WA -
testcase_75 AC 2 ms
5,376 KB
testcase_76 AC 2 ms
5,376 KB
testcase_77 AC 2 ms
5,376 KB
testcase_78 AC 2 ms
5,376 KB
testcase_79 AC 2 ms
5,376 KB
testcase_80 AC 2 ms
5,376 KB
testcase_81 WA -
testcase_82 WA -
testcase_83 WA -
testcase_84 WA -
testcase_85 WA -
testcase_86 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

// #includes {{{
#include <algorithm>
#include <numeric>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <list>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <cstring>
#include <cmath>
using namespace std;
// }}}
// pre-written code {{{
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define RREP(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define LET(x,a) __typeof(a) x(a)
//#define IFOR(i,it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();++it,++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair

#define EXIST(e,s) ((s).find(e)!=(s).end())

#define RESET(a) memset((a),0,sizeof(a))
#define SET(a) memset((a),-1,sizeof(a))
#define PB push_back
#define DEC(it,command) __typeof(command) it=command

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define debug2(x) cerr << #x << " = [";REP(__ind,(x).size()){cerr << (x)[__ind] << ", ";}cerr << "] (L" << __LINE__ << ")" << endl;

const int INF=0x3f3f3f3f;

typedef long long Int;
typedef unsigned long long uInt;
#ifdef __MINGW32__
typedef double rn;
#else
typedef long double rn;
#endif

typedef pair<int,int> pii;

/*
#ifdef MYDEBUG
#include"debug.h"
#include"print.h"
#endif
*/
// }}}

int N;
int A,B,C,D;

int main(){
	vector<int> a,b,c;
	cin>>A>>B>>C>>D;
	if(A==C){
		c.push_back(0);
		int t = 1;
		REP(i,C-1)c.push_back(t++);
		b.push_back(1);
		REP(j,B-C-1)b.push_back(t++);
		N = (int)a.size()+(int)b.size()+(int)c.size()-1;
	}else if(B==C){
		c.push_back(1);
		int t = 2;
		REP(i,C-1)c.push_back(t++);
		a.push_back(0);
		REP(j,A-C-1)a.push_back(t++);
	}else{
		int t = 2;
		a.push_back(0);
		REP(i,A-C-1){
			a.push_back(t++);
		}
		b.push_back(1);
		REP(j,B-C-1){
			b.push_back(t++);
		}
		REP(k,C){
			c.push_back(t++);
		}
	}
	N = (int)a.size()+(int)b.size()+(int)c.size()+10;
	vector<pii> e;
	REP(i,a.size()){
		if(i+1<a.size())e.push_back(make_pair(a[i],a[i+1]));
	}
	REP(i,b.size()){
		if(i+1<b.size())e.push_back(make_pair(b[i],b[i+1]));
	}
	if(a.size()>0 and c.size()>0)e.push_back(make_pair(a.back(),c.front()));
	if(b.size()>0 and c.size()>0)e.push_back(make_pair(b.back(),c.front()));
	REP(i,c.size()){
		if(i+1<c.size())e.push_back(make_pair(c[i],c[i+1]));
	}
	if(D<e.size()){
//	if(false){
		cout<<-1<<endl;
	}else{
		cout<<N<<" "<<e.size()<<endl;
		REP(i,e.size()){
			cout<<e[i].first<<" "<<e[i].second<<endl;
		}
	}
	return 0;
}
0