結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー syoken_desukasyoken_desuka
提出日時 2015-05-08 22:24:13
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 52 ms / 1,000 ms
コード長 6,127 bytes
コンパイル時間 5,269 ms
コンパイル使用メモリ 107,664 KB
実行使用メモリ 22,668 KB
最終ジャッジ日時 2023-08-11 15:28:47
合計ジャッジ時間 5,144 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
22,544 KB
testcase_01 AC 51 ms
18,488 KB
testcase_02 AC 51 ms
20,532 KB
testcase_03 AC 50 ms
22,636 KB
testcase_04 AC 50 ms
20,580 KB
testcase_05 AC 51 ms
20,516 KB
testcase_06 AC 50 ms
22,572 KB
testcase_07 AC 51 ms
20,632 KB
testcase_08 AC 51 ms
18,544 KB
testcase_09 AC 51 ms
18,536 KB
testcase_10 AC 51 ms
22,600 KB
testcase_11 AC 50 ms
20,596 KB
testcase_12 AC 51 ms
18,400 KB
testcase_13 AC 51 ms
20,596 KB
testcase_14 AC 51 ms
18,548 KB
testcase_15 AC 51 ms
22,560 KB
testcase_16 AC 50 ms
22,636 KB
testcase_17 AC 50 ms
22,540 KB
testcase_18 AC 50 ms
20,544 KB
testcase_19 AC 49 ms
22,668 KB
testcase_20 AC 50 ms
20,580 KB
testcase_21 AC 51 ms
20,572 KB
testcase_22 AC 50 ms
20,540 KB
testcase_23 AC 50 ms
20,644 KB
testcase_24 AC 52 ms
20,500 KB
testcase_25 AC 51 ms
20,452 KB
testcase_26 AC 51 ms
20,512 KB
testcase_27 AC 50 ms
20,584 KB
testcase_28 AC 50 ms
20,628 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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()
    {
        string m = Console.ReadLine();
        string n = Console.ReadLine();
        m = m + n;
        int ans = 0;
        int tmp = 0;
        for (int i = 0; i < m.Length; i++)
        {
            if (m[i] == 'o')
            {
                tmp++;
            }
            else
            {
                ans = Math.Max(ans, tmp);
                tmp = 0;
            }
        }
        ans = Math.Max(ans, tmp);
        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