結果

問題 No.51 やる気の問題
ユーザー 明智重蔵明智重蔵
提出日時 2015-10-31 20:59:59
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 2,407 bytes
コンパイル時間 2,270 ms
コンパイル使用メモリ 105,760 KB
実行使用メモリ 29,064 KB
最終ジャッジ日時 2023-10-11 07:22:50
合計ジャッジ時間 7,650 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
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 -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("30");
            WillReturn.Add("5");
            //19
            //仕事量が30で、締め切りまでの日数は5である。
            //この時、
            //1日目のやる気は30/(5の2乗) =1.2 であるため、この日の作業量は1である。
            //2日目のやる気は29/(4の2乗) =1.8125 であるため、この日も作業量は1である。
            //3日目のやる気は28/(3の2乗) =3.111.. であるため、この日の作業量は3である。
            //4日目のやる気は25/(2の2乗) =6.25 であるため、この日の作業量は6である。
            //5日目のやる気は19/(1の2乗) =19 であるため、この日の作業量は19である。
            //
            //つまり、最後の日に行った作業量は19である。
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("100");
            WillReturn.Add("2");
            //75
            //1日目のやる気は 100/(2の2乗) =25であるため、この日の作業量25である。
            //2日目のやる気は  75/(1の2乗) =75であるため、この日の作業量75である。
            //
            //最終日に行った作業量は75になる。
        }
        else if (InputPattern == "Input3") {
            WillReturn.Add("100000");
            WillReturn.Add("1");
            //100000
            //
            //作業量100000を一日で終わらせました
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        long W = long.Parse(InputList[0]);
        long D = long.Parse(InputList[1]);

        for (; 1 <= D; D--) {
            long CurrSagyouyou = W / (D * D);
            W -= CurrSagyouyou;
            Console.WriteLine("残り{0}日での作業量={1}", D, CurrSagyouyou);
            if (W <= 0) {
                Console.WriteLine(CurrSagyouyou);
                break;
            }
        }
    }
}
0