結果

問題 No.466 ジオラマ
ユーザー te-shte-sh
提出日時 2017-12-07 16:53:54
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 1,584 bytes
コンパイル時間 1,330 ms
コンパイル使用メモリ 86,332 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-03 17:18:09
合計ジャッジ時間 9,716 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 6 ms
4,380 KB
testcase_07 AC 4 ms
4,388 KB
testcase_08 AC 7 ms
4,380 KB
testcase_09 AC 5 ms
4,376 KB
testcase_10 AC 6 ms
4,380 KB
testcase_11 AC 5 ms
4,380 KB
testcase_12 AC 6 ms
4,380 KB
testcase_13 AC 4 ms
4,376 KB
testcase_14 AC 4 ms
4,376 KB
testcase_15 AC 4 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 4 ms
4,380 KB
testcase_18 AC 4 ms
4,376 KB
testcase_19 AC 4 ms
4,376 KB
testcase_20 AC 4 ms
4,376 KB
testcase_21 AC 4 ms
4,380 KB
testcase_22 AC 6 ms
4,384 KB
testcase_23 AC 4 ms
4,376 KB
testcase_24 AC 6 ms
4,376 KB
testcase_25 AC 6 ms
4,380 KB
testcase_26 AC 4 ms
4,380 KB
testcase_27 AC 7 ms
4,380 KB
testcase_28 AC 5 ms
4,380 KB
testcase_29 AC 7 ms
4,376 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 6 ms
4,376 KB
testcase_35 AC 5 ms
4,380 KB
testcase_36 WA -
testcase_37 AC 1 ms
4,384 KB
testcase_38 WA -
testcase_39 AC 2 ms
4,380 KB
testcase_40 WA -
testcase_41 AC 2 ms
4,380 KB
testcase_42 WA -
testcase_43 AC 2 ms
4,376 KB
testcase_44 WA -
testcase_45 AC 1 ms
4,380 KB
testcase_46 WA -
testcase_47 AC 1 ms
4,380 KB
testcase_48 WA -
testcase_49 AC 1 ms
4,376 KB
testcase_50 WA -
testcase_51 AC 1 ms
4,380 KB
testcase_52 WA -
testcase_53 AC 1 ms
4,380 KB
testcase_54 WA -
testcase_55 AC 1 ms
4,380 KB
testcase_56 WA -
testcase_57 AC 2 ms
4,376 KB
testcase_58 WA -
testcase_59 AC 1 ms
4,380 KB
testcase_60 WA -
testcase_61 AC 1 ms
4,376 KB
testcase_62 WA -
testcase_63 AC 2 ms
4,376 KB
testcase_64 WA -
testcase_65 AC 1 ms
4,376 KB
testcase_66 WA -
testcase_67 AC 1 ms
4,376 KB
testcase_68 WA -
testcase_69 AC 1 ms
4,380 KB
testcase_70 WA -
testcase_71 AC 1 ms
4,380 KB
testcase_72 WA -
testcase_73 AC 2 ms
4,380 KB
testcase_74 WA -
testcase_75 AC 1 ms
4,380 KB
testcase_76 AC 2 ms
4,380 KB
testcase_77 AC 1 ms
4,380 KB
testcase_78 AC 1 ms
4,380 KB
testcase_79 AC 1 ms
4,376 KB
testcase_80 AC 1 ms
4,376 KB
testcase_81 AC 1 ms
4,380 KB
testcase_82 WA -
testcase_83 AC 1 ms
4,380 KB
testcase_84 WA -
testcase_85 AC 9 ms
4,380 KB
testcase_86 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto rd = readln.split.to!(int[]), a = rd[0], b = rd[1], c = rd[2], d = rd[3];
  auto v0 = a-c, v1 = b-c, v2 = c, v = a+b-c;

  if (v2 == 0) {
    auto e = v0-1 + v1-1;
    if (d < e) {
      writeln(-1);
      return;
    }
    writeln(v, " ", e);
    foreach (i; 0..v0-1)
      writeln(0, " ", i+2);
    foreach (i; 0..v1-1)
      writeln(1, " ", i+v1+1);
  } else if (v0 > 0 && v1 > 0) {
    auto e = v0-1 + v1-1 + v2+1;
    if (d < e) {
      writeln(-1);
      return;
    }
    writeln(v, " ", e);
    foreach (i; 0..v0-1)
      writeln(0, " ", i+2);
    foreach (i; 0..v1-1)
      writeln(1, " ", i+v0+1);
    writeln(0, " ", v0+v1);
    writeln(1, " ", v0+v1);
    foreach (i; 0..v2-1)
      writeln(v0+v1, " ", i+v0+v1+1);
  } else if (v0 == 0 && v1 > 0) {
    auto e = v2-1 + v1-1 + 1;
    if (d < e) {
      writeln(-1);
      return;
    }
    writeln(v, " ", e);
    writeln(1, " ", 0);
    foreach (i; 0..v2-1)
      writeln(0, " ", i+2);
    foreach (i; 0..v1-1)
      writeln(1, " ", i+v2+2);
  } else if (v0 > 0 && v1 == 0) {
    auto e = v2-1 + v0-1 + 1;
    if (d < e) {
      writeln(-1);
      return;
    }
    writeln(v, " ", e);
    writeln(0, " ", 1);
    foreach (i; 0..v2-1)
      writeln(1, " ", i+2);
    foreach (i; 0..v0-1)
      writeln(0, " ", i+v2+2);
  } else {
    auto e = v2+2;
    if (d < e) {
      writeln(-1);
      return;
    }
    writeln(v, " ", e);
    writeln(0, " ", 1);
    writeln(1, " ", 0);
    foreach (i; 0..v2)
      writeln(0, " ", i+2);
  }
}
0