結果

問題 No.542 1円玉と5円玉
ユーザー noriocnorioc
提出日時 2017-07-18 00:39:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 784 bytes
コンパイル時間 3,449 ms
コンパイル使用メモリ 108,824 KB
実行使用メモリ 20,352 KB
最終ジャッジ日時 2024-04-17 00:08:44
合計ジャッジ時間 1,891 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
20,096 KB
testcase_01 AC 34 ms
20,352 KB
testcase_02 AC 33 ms
20,224 KB
testcase_03 AC 33 ms
20,352 KB
testcase_04 AC 33 ms
20,352 KB
testcase_05 AC 34 ms
20,224 KB
testcase_06 AC 36 ms
20,352 KB
testcase_07 AC 35 ms
20,224 KB
testcase_08 AC 36 ms
20,224 KB
testcase_09 AC 36 ms
19,968 KB
testcase_10 AC 34 ms
20,224 KB
testcase_11 AC 34 ms
20,224 KB
testcase_12 AC 37 ms
20,352 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

class Program {
    static int ReadInt() { return int.Parse(Console.ReadLine()); }
    static int[] ReadInts() { return Console.ReadLine().Split().Select(int.Parse).ToArray(); }
    static string[] ReadStrings() { return Console.ReadLine().Split(); }

    static void Calc(int a, int b) {
        var hs = new SortedSet<int>();
        for (int i = 0; i <= a; i++) {
            for (int j = 0; j <= b; j++) {
                if (i == 0 && j == 0) continue;
                hs.Add(i + j * 5);
            }
        }

        foreach (var e in hs) {
            Console.WriteLine(e);
        }
    }

    static void Main() {
        var ab = ReadInts();
        int a = ab[0], b = ab[1];
        Calc(a, b);
    }
}
0