結果

問題 No.1010 折って重ねて
ユーザー phsplsphspls
提出日時 2020-03-28 23:49:29
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,195 bytes
コンパイル時間 2,237 ms
コンパイル使用メモリ 105,372 KB
実行使用メモリ 29,176 KB
最終ジャッジ日時 2023-08-30 18:21:14
合計ジャッジ時間 7,197 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
25,040 KB
testcase_01 AC 70 ms
25,016 KB
testcase_02 AC 69 ms
24,960 KB
testcase_03 WA -
testcase_04 AC 70 ms
25,004 KB
testcase_05 AC 70 ms
24,964 KB
testcase_06 AC 71 ms
24,956 KB
testcase_07 AC 70 ms
24,992 KB
testcase_08 AC 70 ms
24,972 KB
testcase_09 AC 69 ms
27,048 KB
testcase_10 AC 69 ms
25,040 KB
testcase_11 AC 70 ms
27,024 KB
testcase_12 AC 70 ms
24,948 KB
testcase_13 AC 70 ms
24,924 KB
testcase_14 AC 70 ms
24,820 KB
testcase_15 AC 70 ms
26,992 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 70 ms
23,040 KB
testcase_20 WA -
testcase_21 AC 70 ms
24,952 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 70 ms
25,008 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 68 ms
25,048 KB
testcase_31 AC 71 ms
24,952 KB
testcase_32 AC 71 ms
24,924 KB
testcase_33 AC 71 ms
24,948 KB
testcase_34 AC 70 ms
26,992 KB
testcase_35 AC 70 ms
27,056 KB
testcase_36 AC 69 ms
24,884 KB
testcase_37 AC 70 ms
25,044 KB
testcase_38 WA -
testcase_39 AC 71 ms
24,876 KB
testcase_40 WA -
testcase_41 AC 70 ms
25,068 KB
testcase_42 AC 70 ms
25,036 KB
testcase_43 AC 71 ms
25,076 KB
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

public class P1010 {
    public static void Main() {
        var xyh = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToList();
        var x = xyh[0] * 1000L;
        var y = xyh[1] * 1000L;
        var h = xyh[2];
        var cands = new Queue<(long, long, int, int)>();
        var used = new HashSet<(long, long, int, int)>();
        var target = (x: x, y: y, h: h, count: 0);
        cands.Enqueue(target);
        used.Add(target);
        while (cands.Count() > 0) {
            target = cands.Dequeue();
            if(target.x > target.h) {
                var next = (target.x / 2, target.y, target.h * 2, target.count+1);
                if(!cands.Contains(next)) {
                    cands.Enqueue(next);
                    used.Add(next);
                }
            }
            if(target.y > target.h) {
                var next = (target.x, target.y / 2, target.h * 2, target.count+1);
                if(!cands.Contains(next)) {
                    cands.Enqueue(next);
                    used.Add(next);
                }
            }
        }
        Console.WriteLine(target.count);
    }
}
0