結果
| 問題 |
No.542 1円玉と5円玉
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-07 18:52:17 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 2,000 ms |
| コード長 | 739 bytes |
| コンパイル時間 | 2,124 ms |
| コンパイル使用メモリ | 106,880 KB |
| 実行使用メモリ | 19,456 KB |
| 最終ジャッジ日時 | 2024-10-01 15:01:17 |
| 合計ジャッジ時間 | 3,100 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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.Linq;
using System.Collections.Generic;
namespace _0542
{
class Program
{
static void Main(string[] args)
{
var _ = Console.ReadLine().Split();
var a = int.Parse(_[0]);
var b = int.Parse(_[1]);
var s = new Dictionary<int,int>();
for(var i = 0; i <= a; i++){
for(var j = 0; j <= b; j++){
var x = j * 5 + i;
if(!s.ContainsKey(x)){
s.Add(x,1);
}
}
}
foreach(var n in s.Where(t => t.Key != 0).OrderBy(t => t.Key)){
Console.WriteLine(n.Key);
}
}
}
}