結果
問題 | No.466 ジオラマ |
ユーザー | FF256grhy |
提出日時 | 2016-12-16 01:21:54 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,730 bytes |
コンパイル時間 | 1,379 ms |
コンパイル使用メモリ | 159,344 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-05-07 15:42:26 |
合計ジャッジ時間 | 6,740 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 1 ms
6,944 KB |
testcase_03 | WA | - |
testcase_04 | AC | 1 ms
6,944 KB |
testcase_05 | AC | 2 ms
6,944 KB |
testcase_06 | AC | 4 ms
6,944 KB |
testcase_07 | AC | 3 ms
6,940 KB |
testcase_08 | AC | 5 ms
6,940 KB |
testcase_09 | AC | 4 ms
6,944 KB |
testcase_10 | AC | 4 ms
6,940 KB |
testcase_11 | AC | 4 ms
6,944 KB |
testcase_12 | AC | 4 ms
6,940 KB |
testcase_13 | AC | 3 ms
6,940 KB |
testcase_14 | AC | 2 ms
6,944 KB |
testcase_15 | AC | 3 ms
6,944 KB |
testcase_16 | AC | 1 ms
6,944 KB |
testcase_17 | AC | 3 ms
6,940 KB |
testcase_18 | AC | 3 ms
6,944 KB |
testcase_19 | AC | 3 ms
6,940 KB |
testcase_20 | AC | 3 ms
6,940 KB |
testcase_21 | AC | 3 ms
6,940 KB |
testcase_22 | AC | 3 ms
6,940 KB |
testcase_23 | AC | 3 ms
6,940 KB |
testcase_24 | AC | 4 ms
6,940 KB |
testcase_25 | AC | 4 ms
6,940 KB |
testcase_26 | AC | 3 ms
6,940 KB |
testcase_27 | AC | 4 ms
6,940 KB |
testcase_28 | AC | 4 ms
6,940 KB |
testcase_29 | AC | 4 ms
6,940 KB |
testcase_30 | AC | 3 ms
6,940 KB |
testcase_31 | AC | 3 ms
6,944 KB |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 4 ms
6,940 KB |
testcase_35 | AC | 3 ms
6,944 KB |
testcase_36 | WA | - |
testcase_37 | AC | 2 ms
6,940 KB |
testcase_38 | WA | - |
testcase_39 | AC | 1 ms
6,940 KB |
testcase_40 | WA | - |
testcase_41 | AC | 1 ms
6,940 KB |
testcase_42 | WA | - |
testcase_43 | AC | 1 ms
6,940 KB |
testcase_44 | WA | - |
testcase_45 | AC | 1 ms
6,940 KB |
testcase_46 | WA | - |
testcase_47 | AC | 2 ms
6,944 KB |
testcase_48 | WA | - |
testcase_49 | AC | 1 ms
6,940 KB |
testcase_50 | WA | - |
testcase_51 | AC | 2 ms
6,944 KB |
testcase_52 | WA | - |
testcase_53 | AC | 2 ms
6,940 KB |
testcase_54 | WA | - |
testcase_55 | AC | 2 ms
6,944 KB |
testcase_56 | AC | 2 ms
6,944 KB |
testcase_57 | AC | 2 ms
6,940 KB |
testcase_58 | AC | 2 ms
6,940 KB |
testcase_59 | AC | 2 ms
6,940 KB |
testcase_60 | AC | 2 ms
6,948 KB |
testcase_61 | AC | 2 ms
6,940 KB |
testcase_62 | AC | 2 ms
6,944 KB |
testcase_63 | AC | 2 ms
6,940 KB |
testcase_64 | AC | 2 ms
6,944 KB |
testcase_65 | AC | 1 ms
6,944 KB |
testcase_66 | AC | 3 ms
6,944 KB |
testcase_67 | AC | 2 ms
6,944 KB |
testcase_68 | AC | 4 ms
6,940 KB |
testcase_69 | AC | 2 ms
6,944 KB |
testcase_70 | AC | 3 ms
6,940 KB |
testcase_71 | AC | 2 ms
6,940 KB |
testcase_72 | AC | 2 ms
6,940 KB |
testcase_73 | AC | 2 ms
6,940 KB |
testcase_74 | AC | 3 ms
6,940 KB |
testcase_75 | AC | 2 ms
6,940 KB |
testcase_76 | AC | 2 ms
6,944 KB |
testcase_77 | AC | 2 ms
6,940 KB |
testcase_78 | AC | 1 ms
6,944 KB |
testcase_79 | AC | 1 ms
6,940 KB |
testcase_80 | AC | 2 ms
6,940 KB |
testcase_81 | AC | 1 ms
6,940 KB |
testcase_82 | WA | - |
testcase_83 | AC | 2 ms
6,944 KB |
testcase_84 | AC | 3 ms
6,940 KB |
testcase_85 | AC | 6 ms
6,944 KB |
testcase_86 | AC | 1 ms
6,940 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long signed int LL; typedef long long unsigned int LU; #define incID(i, l, r) for(int i = (l) ; i < (r); i++) #define incII(i, l, r) for(int i = (l) ; i <= (r); i++) #define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--) #define decII(i, l, r) for(int i = (r) ; i >= (l); i--) #define inc( i, n) incID(i, 0, n) #define inc1(i, n) incII(i, 1, n) #define dec( i, n) decID(i, 0, n) #define dec1(i, n) decII(i, 1, n) #define inII(v, l, r) ((l) <= (v) && (v) <= (r)) #define inID(v, l, r) ((l) <= (v) && (v) < (r)) #define PB push_back #define EB emplace_back #define MP make_pair #define FI first #define SE second #define UB upper_bound #define LB lower_bound #define PQ priority_queue #define ALL(v) v.begin(), v.end() #define RALL(v) v.rbegin(), v.rend() #define FOR(i, v) for(auto i = v.begin(); i != v.end(); ++i) #define RFOR(i, v) for(auto i = v.rbegin(); i != v.rend(); ++i) template<typename T> bool setmin(T & a, T b) { if(a <= b) { return false; } else { a = b; return true; } } template<typename T> bool setmax(T & a, T b) { if(b <= a) { return false; } else { a = b; return true; } } template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); } template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; } template<typename T> ostream & operator<<(ostream & os, const vector<T> & v) { os << "["; FOR(it, v) { if(it != v.begin()) { os << ", "; } os << *it; } os << "]"; return os; } template<typename F, typename S> ostream & operator<<(ostream & os, const pair<F, S> & p) { os << "<" << p.FI << ", " << p.SE << ">"; return os; } // ---- ---- int a, b, c, d; int main() { cin >> a >> b >> c >> d; if(a == b && b == c && c == 1) { cout << 2 << " " << 0 << endl; } else if(a == b && b == c) { if(d < c) { cout << -1 << endl; return 0; } cout << c << " " << c << "\n"; inc(i, c) { cout << i << " " << (i + 1) % c << "\n"; } } else if(a == c || b == c) { int n = max(a, b), mi = min(a, b); if(d < n - 1) { cout << -1 << endl; return 0; } cout << n << " " << n - 1 << "\n"; int zero = 0, one = 1; if(a < b) { swap(zero, one); } inc(i, n - mi) { cout << (i == 0 ? zero : i + 1) << " " << (i == n - mi - 1 ? one : i + 2) << "\n"; } inc(i, mi - 1) { cout << (i == 0 ? one : mi + i) << " " << mi + i + 1 << "\n"; } } else { int n = a + b - c; int m = n - 1 - (c == 0); if(d < m) { cout << -1 << endl; return 0; } cout << n << " " << m << "\n"; inc(i, a - 1) { cout << (i == 0 ? 0 : i + 1) << " " << i + 2 << "\n"; } inc(i, m - (a - 1)) { cout << (i == 0 ? 1 : a + i) << " " << (c != 0 && i == m - (a - 1) - 1 ? a + 1 - c : a + i + 1) << "\n"; } } return 0; }