結果

問題 No.1313 N言っちゃダメゲーム (4)
ユーザー さかぽんさかぽん
提出日時 2020-12-16 16:11:55
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 620 bytes
コンパイル時間 886 ms
コンパイル使用メモリ 111,424 KB
実行使用メモリ 26,292 KB
最終ジャッジ日時 2023-10-20 09:39:34
合計ジャッジ時間 3,897 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
25,436 KB
testcase_01 AC 34 ms
25,640 KB
testcase_02 AC 34 ms
25,640 KB
testcase_03 AC 33 ms
25,624 KB
testcase_04 AC 32 ms
25,420 KB
testcase_05 AC 33 ms
25,420 KB
testcase_06 AC 33 ms
25,624 KB
testcase_07 AC 33 ms
25,420 KB
testcase_08 AC 33 ms
25,420 KB
testcase_09 AC 34 ms
25,624 KB
testcase_10 AC 35 ms
25,624 KB
testcase_11 AC 34 ms
25,624 KB
testcase_12 AC 33 ms
25,420 KB
testcase_13 AC 40 ms
26,092 KB
testcase_14 AC 43 ms
26,292 KB
testcase_15 AC 42 ms
26,292 KB
testcase_16 AC 39 ms
26,292 KB
testcase_17 AC 39 ms
26,292 KB
testcase_18 AC 38 ms
25,768 KB
testcase_19 AC 39 ms
25,644 KB
testcase_20 AC 34 ms
25,644 KB
testcase_21 AC 37 ms
25,644 KB
testcase_22 AC 36 ms
25,644 KB
testcase_23 AC 40 ms
25,644 KB
testcase_24 AC 34 ms
25,644 KB
testcase_25 AC 38 ms
25,644 KB
testcase_26 AC 35 ms
25,644 KB
testcase_27 AC 40 ms
25,644 KB
testcase_28 AC 42 ms
26,292 KB
testcase_29 AC 40 ms
26,292 KB
testcase_30 AC 42 ms
26,292 KB
testcase_31 AC 40 ms
26,292 KB
testcase_32 AC 42 ms
26,292 KB
testcase_33 AC 41 ms
26,292 KB
testcase_34 AC 41 ms
26,292 KB
testcase_35 AC 41 ms
26,092 KB
testcase_36 AC 41 ms
26,092 KB
testcase_37 AC 39 ms
26,092 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Linq;

class J
{
	static int[] Read() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
	static (int, int) Read2() { var a = Read(); return (a[0], a[1]); }
	static void Main()
	{
		var (n, k) = Read2();
		var s = "x" + Console.ReadLine();

		var u = s.Select(c => c == 'o').ToArray();

		for (int i = n - 1; i >= 0; i--)
		{
			if (!u[i]) continue;

			for (int j = Math.Max(0, i - k); j < i; j++)
				u[j] = false;
			i -= k;
		}

		var r = Enumerable.Range(1, k).Where(i => u[i]).ToArray();
		if (r.Any()) Console.WriteLine(string.Join("\n", r));
		else Console.WriteLine(0);
	}
}
0