結果

問題 No.542 1円玉と5円玉
ユーザー 14番14番
提出日時 2017-07-14 22:28:04
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 1,250 bytes
コンパイル時間 1,385 ms
コンパイル使用メモリ 114,776 KB
実行使用メモリ 20,992 KB
最終ジャッジ日時 2024-04-16 20:22:06
合計ジャッジ時間 2,204 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
20,608 KB
testcase_01 AC 34 ms
20,992 KB
testcase_02 AC 35 ms
20,736 KB
testcase_03 AC 35 ms
20,736 KB
testcase_04 AC 34 ms
20,736 KB
testcase_05 AC 36 ms
20,608 KB
testcase_06 AC 34 ms
20,864 KB
testcase_07 AC 33 ms
20,992 KB
testcase_08 AC 34 ms
20,864 KB
testcase_09 AC 35 ms
20,608 KB
testcase_10 AC 36 ms
20,864 KB
testcase_11 AC 34 ms
20,608 KB
testcase_12 AC 36 ms
20,864 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.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;

public class Program
{

	public void Proc()
	{
        int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();

        SortedDictionary<int, bool> ans = new SortedDictionary<int, bool>();
        for (int i = 0; i <= inpt[0]; i++) {
            for (int j = 0; j <= inpt[1];j++) {
                int tmp = j * 5 + i;
                if(tmp == 0) {
                    continue;
                }
                ans[tmp] = true;
            }
        }
        StringBuilder sb = new StringBuilder();
        ans.ToList().ForEach(a=>sb.AppendLine(a.Key.ToString()));
        Console.Write(sb.ToString());
    }

	public class Reader
	{
		private static StringReader sr;
		public static bool IsDebug = false;
		public static string ReadLine()
		{
			if (IsDebug)
			{
				if (sr == null)
				{
					sr = new StringReader(InputText.Trim());
				}
				return sr.ReadLine();
			}
			else
			{
				return Console.ReadLine();
			}
		}
		private static string InputText = @"
 
 
2 1


 
";
	}

	public static void Main(string[] args)
	{
#if DEBUG
		Reader.IsDebug = true;
#endif
		Program prg = new Program();
		prg.Proc();
	}
}
0