結果
問題 |
No.542 1円玉と5円玉
|
ユーザー |
![]() |
提出日時 | 2017-07-18 00:39:11 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 784 bytes |
コンパイル時間 | 1,050 ms |
コンパイル使用メモリ | 112,804 KB |
実行使用メモリ | 26,724 KB |
最終ジャッジ日時 | 2024-10-08 07:33:13 |
合計ジャッジ時間 | 2,226 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 Program { static int ReadInt() { return int.Parse(Console.ReadLine()); } static int[] ReadInts() { return Console.ReadLine().Split().Select(int.Parse).ToArray(); } static string[] ReadStrings() { return Console.ReadLine().Split(); } static void Calc(int a, int b) { var hs = new SortedSet<int>(); for (int i = 0; i <= a; i++) { for (int j = 0; j <= b; j++) { if (i == 0 && j == 0) continue; hs.Add(i + j * 5); } } foreach (var e in hs) { Console.WriteLine(e); } } static void Main() { var ab = ReadInts(); int a = ab[0], b = ab[1]; Calc(a, b); } }