結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー ixTL255
提出日時 2016-09-07 22:37:42
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 2,217 ms
コンパイル使用メモリ 106,240 KB
実行使用メモリ 42,116 KB
平均クエリ数 3.70
最終ジャッジ日時 2024-07-17 00:25:02
合計ジャッジ時間 5,965 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

public class Test
{
	public static void Main()
	{
		var list = Console.ReadLine()
					.Split(' ')
					.Select(x => int.Parse(x))
					.ToList();
		var n = list[0];
		var k = list[1];
		var next = (n - 1) % (k + 1);
		
		Console.WriteLine(next);
		next += k + 1;
		
		while(true)
		{
			var d = int.Parse(Console.ReadLine());
			
			if(d >= n) break;
			else
			{
				Console.WriteLine(next);
				next += k + 1;
			}
		}
	}
}
0