結果

問題 No.542 1円玉と5円玉
ユーザー mbanmban
提出日時 2017-07-14 22:26:06
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 893 bytes
コンパイル時間 809 ms
コンパイル使用メモリ 105,216 KB
実行使用メモリ 20,352 KB
最終ジャッジ日時 2024-04-16 20:18:05
合計ジャッジ時間 1,784 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
19,840 KB
testcase_01 AC 28 ms
19,840 KB
testcase_02 AC 29 ms
20,352 KB
testcase_03 AC 29 ms
19,968 KB
testcase_04 AC 29 ms
20,224 KB
testcase_05 AC 30 ms
19,968 KB
testcase_06 AC 31 ms
19,840 KB
testcase_07 AC 31 ms
20,096 KB
testcase_08 AC 30 ms
20,096 KB
testcase_09 AC 31 ms
19,840 KB
testcase_10 AC 29 ms
19,840 KB
testcase_11 AC 30 ms
20,096 KB
testcase_12 AC 32 ms
19,840 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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;

class Program
{
    static void Main()
    {
        new Magatro().Solve();
    }
}

class Magatro
{
    private int A, B;
    private void Scan()
    {
        var line = Console.ReadLine().Split(' ');
        A = int.Parse(line[0]);
        B = int.Parse(line[1]);
    }

    public void Solve()
    {
        Scan();
        var hs = new HashSet<int>();
        for (int i = 0; i <= A; i++)
        {
            for (int j = 0; j <= B; j++)
            {
                hs.Add(i + j * 5);
            }
        }
        var ans = hs.ToArray();
        Array.Sort(ans);
        for (int i = 1; i < ans.Length; i++)
        {
            Console.WriteLine(ans[i]);
        }
    }
}
0