結果

問題 No.542 1円玉と5円玉
ユーザー mban
提出日時 2017-07-14 22:26:06
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 893 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 113,240 KB
実行使用メモリ 20,224 KB
最終ジャッジ日時 2024-10-07 22:57:33
合計ジャッジ時間 1,703 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
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