結果
| 問題 |
No.836 じょうよ
|
| コンテスト | |
| ユーザー |
Risen
|
| 提出日時 | 2019-06-14 21:38:02 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 1,000 ms |
| コード長 | 640 bytes |
| コンパイル時間 | 3,884 ms |
| コンパイル使用メモリ | 104,064 KB |
| 実行使用メモリ | 27,264 KB |
| 最終ジャッジ日時 | 2024-11-09 00:36:09 |
| 合計ジャッジ時間 | 3,611 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 41 |
コンパイルメッセージ
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;
public class Solution
{
public static void Main()
{
var vals = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
var l = vals[0];
var r = vals[1];
var n = (int)vals[2];
var x = (r + 1 - l) / n;
var list = Enumerable.Repeat(x, n).ToArray();
var mod = l % n;
var remain = r + 1 - l - x * n;
for (int i = 0; i < remain; i++)
{
list[mod] = x + 1;
mod = (mod + 1) % n;
}
Console.WriteLine(string.Join(Environment.NewLine, list));
}
}
Risen