結果
問題 | No.466 ジオラマ |
ユーザー | 14番 |
提出日時 | 2016-12-16 01:40:58 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 3,632 bytes |
コンパイル時間 | 1,108 ms |
コンパイル使用メモリ | 115,368 KB |
実行使用メモリ | 35,792 KB |
最終ジャッジ日時 | 2024-05-07 15:47:29 |
合計ジャッジ時間 | 12,451 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | WA | - |
testcase_03 | AC | 30 ms
19,072 KB |
testcase_04 | WA | - |
testcase_05 | AC | 29 ms
19,328 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 | RE | - |
testcase_31 | RE | - |
testcase_32 | AC | 32 ms
23,168 KB |
testcase_33 | AC | 31 ms
22,528 KB |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | AC | 29 ms
21,116 KB |
testcase_37 | AC | 28 ms
20,996 KB |
testcase_38 | AC | 33 ms
21,764 KB |
testcase_39 | AC | 32 ms
21,888 KB |
testcase_40 | AC | 32 ms
23,168 KB |
testcase_41 | AC | 31 ms
23,168 KB |
testcase_42 | AC | 31 ms
22,144 KB |
testcase_43 | AC | 32 ms
22,636 KB |
testcase_44 | AC | 30 ms
22,272 KB |
testcase_45 | AC | 32 ms
22,144 KB |
testcase_46 | AC | 29 ms
20,604 KB |
testcase_47 | AC | 30 ms
20,364 KB |
testcase_48 | AC | 37 ms
24,448 KB |
testcase_49 | AC | 36 ms
24,576 KB |
testcase_50 | AC | 32 ms
23,040 KB |
testcase_51 | AC | 32 ms
23,168 KB |
testcase_52 | AC | 32 ms
22,784 KB |
testcase_53 | AC | 31 ms
22,912 KB |
testcase_54 | AC | 31 ms
22,656 KB |
testcase_55 | AC | 31 ms
22,656 KB |
testcase_56 | WA | - |
testcase_57 | WA | - |
testcase_58 | WA | - |
testcase_59 | WA | - |
testcase_60 | WA | - |
testcase_61 | WA | - |
testcase_62 | WA | - |
testcase_63 | WA | - |
testcase_64 | WA | - |
testcase_65 | WA | - |
testcase_66 | RE | - |
testcase_67 | RE | - |
testcase_68 | RE | - |
testcase_69 | RE | - |
testcase_70 | RE | - |
testcase_71 | RE | - |
testcase_72 | RE | - |
testcase_73 | RE | - |
testcase_74 | RE | - |
testcase_75 | RE | - |
testcase_76 | AC | 37 ms
24,832 KB |
testcase_77 | AC | 31 ms
21,632 KB |
testcase_78 | AC | 36 ms
24,448 KB |
testcase_79 | AC | 37 ms
24,448 KB |
testcase_80 | AC | 35 ms
22,912 KB |
testcase_81 | WA | - |
testcase_82 | WA | - |
testcase_83 | AC | 29 ms
19,200 KB |
testcase_84 | WA | - |
testcase_85 | RE | - |
testcase_86 | WA | - |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Linq; using System.Collections.Generic; using System.Text; public class Program { public void Proc() { Reader.IsDebug = false; int[] inpt = Reader.ReadLine().Split(' ').Select(c=>int.Parse(c)).ToArray(); int a = inpt[0]; int b = inpt[1]; int aAndB = inpt[2]; int roadCount = inpt[3]; if(a+b-aAndB-1>roadCount) { Console.WriteLine(-1); } TreeNode t0 = new TreeNode(0); TreeNode t1 = new TreeNode(1); if(aAndB == a) { t1.Add(t0); int idx = 2; if(a>1) { t0.AddRange(idx, idx+a-2); } idx = idx+a-1; if(b-aAndB>1) { t1.AddRange(idx, idx+(b-aAndB)-2); } } else if(aAndB == b) { t0.Add(t1); int idx = 2; if(b>1) { t1.AddRange(idx, idx+b-2); } idx = idx+b-1; if(a-aAndB>1) { t0.AddRange(idx, idx+(a-aAndB)-2); } } else { TreeNode t2 = null; int idx = 2; if(aAndB > 0) { t2 = new TreeNode(2); idx++; if(aAndB >1) { t2.AddRange(idx, idx+aAndB-2); idx=idx+aAndB-1; } t0.Add(t2); t1.Add(t2); } if(a-aAndB>1) { t0.AddRange(idx, idx+(a-aAndB)-2); idx = idx+(a-aAndB)-1; } if(b-aAndB>1) { t1.AddRange(idx, idx+(b-aAndB)-2); } if(a>1) { t0.Add(t2); } } StringBuilder ans = new StringBuilder(); ans.Append(t0.Print()); ans.Append(t1.Print()); int mura = a+b-aAndB; Console.WriteLine(mura + " " + (mura-1)); Console.Write(ans.ToString()); } public class TreeNode { public int Id; public List<TreeNode> Items = new List<TreeNode>(); public TreeNode(int id) { this.Id = id; } public void Add(TreeNode cld) { this.Items.Add(cld); } private bool IsPrinted = false; public string Print() { if(this.IsPrinted) { return string.Empty; } StringBuilder ret = new StringBuilder(); this.Items.ForEach(a=>{ ret.AppendLine(this.Id + " " + a.Id); ret.Append(a.Print()); }); this.IsPrinted = true; return ret.ToString(); } public List<TreeNode> AddRange(int f, int t) { List<TreeNode> tmp = new List<TreeNode>(); for(int i=f; i<=t; i++) { tmp.Add(new TreeNode(i)); } this.Items.AddRange(tmp); return tmp; } } public class Reader { public static bool IsDebug = true; private static System.IO.StringReader SReader; private static string InitText = @" 6 4 2 12 "; public static string ReadLine() { if(IsDebug) { if(SReader == null) { SReader = new System.IO.StringReader(InitText.Trim()); } return SReader.ReadLine(); } else { return Console.ReadLine(); } } } public static void Main(string[] args) { Program prg = new Program(); prg.Proc(); } }