結果

問題 No.634 硬貨の枚数1
ユーザー NoNo
提出日時 2018-01-26 01:48:17
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 830 bytes
コンパイル時間 3,182 ms
コンパイル使用メモリ 106,060 KB
実行使用メモリ 25,528 KB
最終ジャッジ日時 2023-08-27 06:00:21
合計ジャッジ時間 154,312 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,726 ms
23,436 KB
testcase_01 AC 59 ms
21,432 KB
testcase_02 AC 60 ms
23,464 KB
testcase_03 AC 66 ms
21,532 KB
testcase_04 AC 1,750 ms
19,376 KB
testcase_05 AC 60 ms
21,324 KB
testcase_06 AC 66 ms
21,388 KB
testcase_07 AC 66 ms
21,480 KB
testcase_08 AC 1,742 ms
21,532 KB
testcase_09 AC 60 ms
23,556 KB
testcase_10 AC 64 ms
19,420 KB
testcase_11 AC 1,743 ms
21,372 KB
testcase_12 AC 62 ms
23,468 KB
testcase_13 AC 1,741 ms
21,340 KB
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 AC 146 ms
21,428 KB
testcase_20 AC 231 ms
21,416 KB
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 AC 1,755 ms
23,492 KB
testcase_25 AC 1,741 ms
21,324 KB
testcase_26 AC 1,755 ms
21,376 KB
testcase_27 AC 1,744 ms
21,432 KB
testcase_28 AC 1,755 ms
21,444 KB
testcase_29 AC 1,757 ms
23,444 KB
testcase_30 AC 1,750 ms
23,428 KB
testcase_31 AC 1,756 ms
23,444 KB
testcase_32 AC 1,732 ms
21,400 KB
testcase_33 AC 1,746 ms
23,440 KB
testcase_34 AC 1,987 ms
21,260 KB
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 AC 59 ms
23,436 KB
testcase_45 AC 1,830 ms
21,404 KB
testcase_46 AC 197 ms
21,484 KB
testcase_47 AC 466 ms
21,308 KB
testcase_48 AC 57 ms
21,416 KB
testcase_49 AC 85 ms
23,452 KB
testcase_50 TLE -
testcase_51 TLE -
testcase_52 AC 58 ms
21,436 KB
testcase_53 AC 1,728 ms
21,564 KB
testcase_54 AC 1,730 ms
19,392 KB
testcase_55 TLE -
testcase_56 TLE -
testcase_57 TLE -
testcase_58 TLE -
testcase_59 TLE -
testcase_60 TLE -
testcase_61 TLE -
testcase_62 TLE -
testcase_63 TLE -
testcase_64 TLE -
testcase_65 TLE -
testcase_66 TLE -
testcase_67 TLE -
testcase_68 TLE -
testcase_69 TLE -
testcase_70 TLE -
testcase_71 TLE -
testcase_72 TLE -
testcase_73 TLE -
testcase_74 TLE -
testcase_75 TLE -
testcase_76 AC 1,766 ms
21,324 KB
testcase_77 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;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var li = new List<int>();

            int y = (int)Math.Sqrt(n) + 10000;
            for (int i = 1; i <= y; i++)
            {
                li.Add(i * (i + 1) / 2);
            }

            for (int i = 0; i < li.Count; i++)
            {
                if (n == li[i])
                {
                    Console.WriteLine(1);
                    return;
                }
                if (li.Count(x => x + li[i] == n) > 0)
                {
                    Console.WriteLine(2);
                    return;
                }
            }

            Console.WriteLine(3);
        }
    }
}
0