結果
問題 | No.542 1円玉と5円玉 |
ユーザー |
![]() |
提出日時 | 2017-07-14 22:24:29 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 658 bytes |
コンパイル時間 | 883 ms |
コンパイル使用メモリ | 110,800 KB |
実行使用メモリ | 19,456 KB |
最終ジャッジ日時 | 2024-10-07 22:28:59 |
合計ジャッジ時間 | 1,871 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.
ソースコード
using System; using System.Collections.Generic; using System.Linq; class Solution { static void Main() { var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); int a = vals[0]; int b = vals[1]; var moneys = new List<int>(); foreach(var i in Enumerable.Range(0,a+1)) { foreach (var j in Enumerable.Range(0, b+1)) { moneys.Add(i + j * 5); } } moneys.Remove(0); moneys = moneys.Distinct().OrderBy(m => m).ToList(); foreach (var m in moneys) { Console.WriteLine(m); } } }