結果

問題 No.648  お や す み 
ユーザー Charlotte8687Charlotte8687
提出日時 2018-11-28 17:09:05
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 858 bytes
コンパイル時間 3,415 ms
コンパイル使用メモリ 104,840 KB
実行使用メモリ 24,612 KB
最終ジャッジ日時 2023-09-09 05:49:09
合計ジャッジ時間 13,832 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
24,520 KB
testcase_01 AC 56 ms
20,652 KB
testcase_02 AC 61 ms
20,520 KB
testcase_03 AC 55 ms
20,628 KB
testcase_04 AC 55 ms
20,568 KB
testcase_05 AC 62 ms
22,464 KB
testcase_06 AC 55 ms
20,560 KB
testcase_07 AC 55 ms
18,504 KB
testcase_08 AC 55 ms
20,804 KB
testcase_09 AC 61 ms
22,588 KB
testcase_10 AC 55 ms
20,580 KB
testcase_11 AC 55 ms
18,708 KB
testcase_12 AC 56 ms
22,664 KB
testcase_13 AC 55 ms
22,616 KB
testcase_14 AC 55 ms
20,588 KB
testcase_15 AC 55 ms
20,568 KB
testcase_16 AC 57 ms
20,592 KB
testcase_17 AC 55 ms
20,632 KB
testcase_18 AC 55 ms
20,552 KB
testcase_19 AC 55 ms
20,616 KB
testcase_20 AC 61 ms
22,480 KB
testcase_21 AC 62 ms
24,492 KB
testcase_22 AC 61 ms
24,612 KB
testcase_23 AC 61 ms
22,692 KB
testcase_24 AC 61 ms
22,488 KB
testcase_25 AC 61 ms
20,492 KB
testcase_26 AC 62 ms
24,604 KB
testcase_27 AC 62 ms
24,520 KB
testcase_28 AC 61 ms
22,508 KB
testcase_29 AC 62 ms
22,504 KB
testcase_30 AC 56 ms
22,652 KB
testcase_31 AC 56 ms
20,752 KB
testcase_32 AC 55 ms
22,620 KB
testcase_33 AC 56 ms
22,628 KB
testcase_34 AC 56 ms
18,636 KB
testcase_35 AC 56 ms
22,632 KB
testcase_36 AC 55 ms
18,572 KB
testcase_37 AC 56 ms
20,580 KB
testcase_38 AC 54 ms
18,596 KB
testcase_39 AC 55 ms
20,616 KB
testcase_40 AC 55 ms
20,648 KB
testcase_41 AC 56 ms
22,684 KB
testcase_42 AC 56 ms
20,684 KB
testcase_43 AC 57 ms
20,516 KB
testcase_44 AC 56 ms
22,548 KB
testcase_45 AC 56 ms
20,604 KB
testcase_46 AC 56 ms
18,464 KB
testcase_47 AC 56 ms
22,552 KB
testcase_48 AC 55 ms
18,520 KB
testcase_49 AC 55 ms
18,460 KB
testcase_50 AC 80 ms
20,588 KB
testcase_51 AC 74 ms
24,504 KB
testcase_52 AC 81 ms
22,468 KB
testcase_53 AC 88 ms
20,752 KB
testcase_54 AC 99 ms
22,560 KB
testcase_55 AC 81 ms
22,472 KB
testcase_56 AC 88 ms
20,480 KB
testcase_57 AC 91 ms
22,664 KB
testcase_58 AC 88 ms
22,592 KB
testcase_59 AC 66 ms
24,472 KB
testcase_60 TLE -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace StudyApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            CanSleep(double.Parse(input));
        }

        public static void CanSleep(double target_num)
        {
            double second = 0; // Total seconds
            double sheep_num = 0; // The number of sheep

            while (true)
            {
                sheep_num += second;

                if (target_num > sheep_num)
                    second++;
                else
                    break;
            }

            if (target_num.Equals(sheep_num))
            {
                Console.WriteLine("YES");
                Console.WriteLine(second);
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}
0