結果
| 問題 | No.836 じょうよ |
| コンテスト | |
| ユーザー |
Risen
|
| 提出日時 | 2019-06-14 21:38:02 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 34 ms / 1,000 ms |
| コード長 | 640 bytes |
| 記録 | |
| コンパイル時間 | 2,267 ms |
| コンパイル使用メモリ | 105,216 KB |
| 実行使用メモリ | 27,776 KB |
| 最終ジャッジ日時 | 2026-05-09 05:16:57 |
| 合計ジャッジ時間 | 4,475 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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