結果
| 問題 |
No.542 1円玉と5円玉
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-26 17:59:18 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 841 bytes |
| コンパイル時間 | 823 ms |
| コンパイル使用メモリ | 109,856 KB |
| 実行使用メモリ | 29,204 KB |
| 最終ジャッジ日時 | 2024-11-21 20:07:08 |
| 合計ジャッジ時間 | 1,904 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 7 |
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;
namespace YukiCoder
{
public static class OneAndFive
{
public static void Main()
{
List<int> AmountMoney = new List<int>();
string[] Amount = Console.ReadLine().Split(' ');
int OneAmount = int.Parse(Amount[0]);
int FiveAmount = int.Parse(Amount[1]);
for (int One = 1; One <= OneAmount; One++)
{
AmountMoney.Add(One);
}
for(int Five = 1; Five <= FiveAmount; Five++)
{
AmountMoney.Add(Five * 5);
}
for(int Five = 1; Five <= FiveAmount; Five++)
{
for (int One = 1; One <= OneAmount; One++)
{
AmountMoney.Add(One + Five * 5);
}
}
foreach(var Money in AmountMoney.Distinct())
{
Console.WriteLine(Money);
}
Console.ReadKey();
}
}
}