結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー syoken_desukasyoken_desuka
提出日時 2015-05-08 23:41:42
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 7,642 bytes
コンパイル時間 1,296 ms
コンパイル使用メモリ 107,264 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-04-21 13:20:16
合計ジャッジ時間 3,602 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 25 ms
17,664 KB
testcase_05 AC 25 ms
17,536 KB
testcase_06 AC 24 ms
17,664 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 25 ms
17,664 KB
testcase_30 AC 25 ms
17,664 KB
testcase_31 AC 25 ms
17,536 KB
testcase_32 AC 25 ms
17,536 KB
testcase_33 AC 24 ms
17,920 KB
testcase_34 AC 25 ms
17,664 KB
testcase_35 WA -
testcase_36 AC 24 ms
17,408 KB
testcase_37 AC 25 ms
17,536 KB
testcase_38 AC 25 ms
17,664 KB
testcase_39 AC 26 ms
17,408 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 25 ms
17,664 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 25 ms
17,792 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

#region ZIPPER
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using sc = Scanner;
using ci = CharInterpreter;
//using System.Numerics;
//using Geometry;
//using gl = Geometry.GeometryLibrary;
//using grl = GraphLibrary;
class Program
{
    static void Main(string[] args)
    {
        Solver solver = new Solver();
        solver.Solve();
#if DEBUG
        System.Console.WriteLine("続行するには何かキーを押してください...");
        System.Console.ReadKey();
#endif

    }
}
/// <summary>
/// 標準入力読み取り支援,自作(某最速の人を参考)
/// </summary>

#endregion ZIPPER

public class Solver
{
    #region IGNORE_ME
    public Solver()
    {
        //こんすとらくたん きにしなくてよろしい
    }
    #endregion IGNORE_ME

    public int MOD = 1000000007;//10^9 + 7

    public void Solve()
    {
        /*
        int n = sc.NextInt();
        string ans = "";
        int count = 0;
        Queue<char>[] s = new Queue<char>[n];
        for (int i = 0; i < n; i++)
        {
            string tmp = Console.ReadLine();
            s[i] = new Queue<char>();
            count += tmp.Length;
            for (int j = 0; j < tmp.Length; j++)
            {
                s[i].Enqueue(tmp[j]);
            }
        }
        for (int i = 0; i < count; i++)
        {
            int minI = 0;
            char minC = 'z';
            for (int j = 0; j < s.Length; j++)
            {

                if (s[j].Count != 0)
                {
                    if (minC >= s[j].Peek())
                    {
                        minI = j;
                        minC = s[j].Peek();
                    }
                }

            }
            ans += s[minI].Dequeue().ToString();
        }
        Console.WriteLine(ans);*/
        int p = sc.NextInt();
        string m = "xxxxxxxxxxxxxxx" +Console.ReadLine() + Console.ReadLine() + "xxxxxxxxxxxxxxx";
        int ans = 0;
        int t = 0;
        for (int k = 1; k <= p; k++)
        {
            for (int i = 0; i <= m.Length - k; i++)
            {
                if (!m.Substring(i, k).Contains('o'))
                {
                    string tmp = m.Substring(0, i) + "ooooooooooooooooooooooooo".Substring(0, p) + m.Substring(i + k, m.Length - i - k);
                    t = 0;
                    for (int j = 0; j < tmp.Length; j++)
                    {
                        if (tmp[j] == 'o')
                        {
                            t++;
                        }
                        else
                        {
                            ans = Math.Max(ans, t);
                            t = 0;
                        }
                    }
                    ans = Math.Max(ans, t);
                }
            }
        }
            Console.WriteLine(ans);
#if DEBUG
        Console.WriteLine("t");//local check
#endif
    }
}

#region STANDARD_READER
public static class Scanner
{
    public static string NextString()
    {
        string tmp = "";
        while (true)
        {
            int readData;
            string data;
            readData = Console.Read();
            if (readData == -1) //EOF
            {
                break;
            }
            data = char.ConvertFromUtf32(readData);
            if (data == " " || data == "\n")
            {
                break;
            }
            tmp += data;
        }
        return tmp;
    }
    public static int NextInt()
    {
        string tmp = "";
        while (true)
        {
            int readData;
            string data;
            readData = Console.Read();
            if (readData == -1) //EOF
            {
                break;
            }
            data = char.ConvertFromUtf32(readData);
            if (data == " " || data == "\n")
            {
                break;
            }
            tmp += data;
        } 
        return int.Parse(tmp);
    }
    public static long NextLong()
    {
        string tmp = "";
        while (true)
        {
            int readData;
            string data;
            readData = Console.Read();
            if (readData == -1) //EOF
            {
                break;
            }
            data = char.ConvertFromUtf32(readData);
            if (data == " " || data == "\n")
            {
                break;
            }
            tmp += data;
        }
        return long.Parse(tmp);
    }
    public static double NextDouble()
    {
        string tmp = "";
        while (true)
        {
            int readData;
            string data;
            readData = Console.Read();
            if (readData == -1) //EOF
            {
                break;
            }
            data = char.ConvertFromUtf32(readData);
            if (data == " " || data == "\n")
            {
                break;
            }
            tmp += data;
        }
        return double.Parse(tmp);
    }

    public static string[] NextStrArray()
    {
        return Console.ReadLine().Split(' ');
    }
    public static int[] NextIntArray()
    {

        string[] s = NextStrArray();
        int[] a = new int[s.Length];
        for (int i = 0; i < a.Length; i++)
        {
            a[i] = int.Parse(s[i]);
        }
        return a;
    }
    public static long[] NextLongArray()
    {
        string[] s = NextStrArray();
        long[] a = new long[s.Length];
        for (int i = 0; i < a.Length; i++)
        {
            a[i] = long.Parse(s[i]);
        }
        return a;
    }
    public static double[] NextDoubleArray()
    {
        string[] s = NextStrArray();
        double[] a = new double[s.Length];
        for (int i = 0; i < a.Length; i++)
        {
            a[i] = double.Parse(s[i]);
        }
        return a;
    }
}
/// <summary>
/// 二次元グリッドなどの文字列で与えられたマップなどで、
/// 手軽にデータ変換を適用するためのクラス
/// </summary>
public static class CharInterpreter
{
    /// <summary>
    /// 変換用辞書
    /// </summary>
    private static Dictionary<char, int> MapToInt = new Dictionary<char, int>(); 
    /// <summary>
    /// 変換法則を追加する
    /// </summary>
    /// <param name="c">char文字</param>
    /// <param name="i">対応する整数値</param>
    public static void AddCorrespondence(char c,int i)
    {
        MapToInt.Add(c,i);
    }
    /// <summary>
    /// 文字列に対して、対応付けされた
    /// 例外処理をしていないので注意
    /// </summary>
    /// <returns>対応対応がなかった場合はバグる;;</returns>
    public static int Inquiry(char c)
    {
        int ret = 0;
        MapToInt.TryGetValue(c, out ret);
        return ret;
    }
    /// <summary>
    /// 指定された変換法則の元でint[,]の二次元平面を生成する
    /// 対応関係がない場合の例外処理をしていないので注意
    /// </summary>
    /// <param name="field">配列の各文字列の長さが全て同じでないとうまく作動しないので注意</param>
    /// <returns> int[ field.length , field[0].length]型の配列 </returns>
    public static int[,] GenerateSquareField(string[] field)
    {
        int[,] ret = new int[field.Length, field[0].Length];
        for (int i = 0; i < field.Length; i++)
        {
            for (int j = 0; j < field[0].Length; j++)
            {
                MapToInt.TryGetValue(field[i][j], out ret[i, j]);
            }
        }
        return ret;
    }
}
#endregion STANDARD_READER
0