結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー しらゆきしらゆき
提出日時 2016-01-10 22:02:24
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 2,631 bytes
コンパイル時間 5,565 ms
コンパイル使用メモリ 113,964 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-04-21 15:01:26
合計ジャッジ時間 2,816 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
17,408 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 20 ms
17,792 KB
testcase_05 AC 19 ms
17,664 KB
testcase_06 AC 20 ms
17,792 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 19 ms
17,664 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 20 ms
17,792 KB
testcase_17 AC 20 ms
17,536 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 21 ms
17,536 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 19 ms
17,664 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 21 ms
17,536 KB
testcase_30 AC 20 ms
17,664 KB
testcase_31 AC 20 ms
17,408 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 21 ms
17,664 KB
testcase_35 AC 20 ms
17,664 KB
testcase_36 AC 20 ms
17,920 KB
testcase_37 AC 19 ms
17,792 KB
testcase_38 AC 21 ms
17,920 KB
testcase_39 WA -
testcase_40 AC 19 ms
17,408 KB
testcase_41 AC 20 ms
17,664 KB
testcase_42 WA -
testcase_43 AC 20 ms
17,792 KB
testcase_44 AC 19 ms
17,792 KB
testcase_45 AC 20 ms
17,536 KB
testcase_46 AC 20 ms
17,792 KB
testcase_47 WA -
testcase_48 AC 21 ms
17,920 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;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        int d = ri();
        var c = new char[14];
        for(int i = 0; i < 2; i++)
        {
            var t = rs();
            for(int j = 0; j < 7; j++)
                c[i * 7 + j] = t[j];
        }

        int ans = 0;

        for(int i = 0; i < 14 - d + 1; i++)
        {
            int cnt = 0;
            int cnt2 = 0;
            var a = new bool[14];
            for(int j = 0; j < 14; j++)
                if (c[j] == 'o') a[j] = true;
            for (int j = i; j < i + d; j++)
                a[j] = true;
            for(int j = 0; j < 14; j++)
            {
                if (a[j]) cnt2++;
                else cnt2 = 0;
                cnt = Math.Max(cnt, cnt2);
            }
            ans = Math.Max(ans, cnt);
        }

        Console.WriteLine(ans);
    }

    #region Scan
    static int ri() { return int.Parse(Console.ReadLine()); }
    static long rl() { return long.Parse(Console.ReadLine()); }
    static double rd() { return double.Parse(Console.ReadLine()); }
    static string rs() { return Console.ReadLine(); }
    static int[] ria() { return Console.ReadLine().Trim().Split().Select(int.Parse).ToArray(); }
    static long[] rla() { return Console.ReadLine().Trim().Split().Select(long.Parse).ToArray(); }
    static double[] rda() { return Console.ReadLine().Trim().Split().Select(double.Parse).ToArray(); }
    static string[] rsa() { return Console.ReadLine().Trim().Split(); }
    static void mul(out int a, out int b) { var arr = ria(); a = arr[0]; b = arr[1]; }
    static void mul(out int a, out int b, out int c) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; }
    static void mul(out int a, out int b, out int c, out int d) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; d = arr[3]; }
    static void mul(out long a, out long b) { var arr = rla(); a = arr[0]; b = arr[1]; }
    static void mul(out long a, out long b, out long c) { var arr = rla(); a = arr[0]; b = arr[1]; c = arr[2]; }
    static void mul(out long a, out long b, out long c, out long d) { var arr = rla(); a = arr[0]; b = arr[1]; c = arr[2]; d = arr[3]; }
    #endregion
    #region Math
    const int mod = 1000000007;
    static bool isprime(long n)
    {
        if (n < 2) return false;
        for (long i = 2; i * i <= n; i++)
            if (n % i == 0)
                return false;
        return true;
    }
    static long gcd(long a, long b) { return a == 0 ? b : gcd(b % a, a); }
    static long lcm(long a, long b) { return a * b / gcd(a, b); }
    #endregion
}
0