結果

問題 No.342 一番ワロタww
ユーザー mban
提出日時 2017-01-01 22:56:58
言語 C#(csc)
(csc 3.9.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,309 bytes
コンパイル時間 1,271 ms
コンパイル使用メモリ 103,296 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-12-16 05:31:52
合計ジャッジ時間 2,192 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 11 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;


class Magatro
{
    static void Main()
    {
        string ans = "";
        string S = Console.ReadLine();
        int max = 0;
        int cnt = 0;
        string d = "";
        string be = "";
        for(int i = 0; i < S.Length; i++)
        {
            if (S[i] == 'w')
            {
                if (cnt == 0)
                {
                    be = d;
                }
                cnt++;
                d = "";
            }
            else
            {
                if (d == "")
                {
                    if (cnt > max&&be!="")
                    {
                        max = cnt;
                        ans = be;
                    }
                    else if(cnt==max)
                    {
                        ans +="\n"+ be;
                    }
                }
                d += S[i];
                cnt = 0;
            }
        }
        if (cnt > max && be != "")
        {
            max = cnt;
            ans = be;
        }
        else if (cnt == max)
        {
            ans += " " + be;
        }
        Console.WriteLine(ans);
    }
}

0