結果

問題 No.542 1円玉と5円玉
ユーザー Maeda
提出日時 2025-04-02 10:41:57
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 803 bytes
コンパイル時間 7,968 ms
コンパイル使用メモリ 168,520 KB
実行使用メモリ 188,328 KB
最終ジャッジ日時 2025-04-02 10:42:07
合計ジャッジ時間 9,667 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (112 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

    class Program
    {
        static void Main(string[] args)
        {
            string[] coin = Console.ReadLine().Split(' ');
            List<int> priceCalculation = new List<int>();
            for (int i = 0; i <= int.Parse(coin[1]); i++)
            {
                if(i != 0 && !priceCalculation.Contains(i * 5))
                {
                    priceCalculation.Add(i*5);
                }
                for (int j = 1; j <= int.Parse(coin[0]); j++)
                {
                    if(!priceCalculation.Contains(i * 5 + j))
                    {
                        priceCalculation.Add(i * 5 + j);
                    }
                }
            }
            foreach (int i in priceCalculation) {
                Console.WriteLine(i);
            }
        } 
    }
0