結果

問題 No.342 一番ワロタww
ユーザー mbanmban
提出日時 2017-01-01 22:56:58
言語 C#(csc)
(csc 3.9.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,309 bytes
コンパイル時間 3,623 ms
コンパイル使用メモリ 103,496 KB
実行使用メモリ 22,584 KB
最終ジャッジ日時 2023-08-22 09:43:14
合計ジャッジ時間 5,185 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
18,524 KB
testcase_01 AC 49 ms
22,476 KB
testcase_02 AC 49 ms
20,480 KB
testcase_03 WA -
testcase_04 AC 49 ms
20,524 KB
testcase_05 AC 49 ms
20,604 KB
testcase_06 AC 50 ms
20,540 KB
testcase_07 WA -
testcase_08 AC 49 ms
18,456 KB
testcase_09 AC 50 ms
20,384 KB
testcase_10 AC 49 ms
20,440 KB
testcase_11 WA -
testcase_12 AC 49 ms
18,572 KB
testcase_13 AC 49 ms
20,588 KB
testcase_14 WA -
testcase_15 AC 49 ms
20,492 KB
testcase_16 AC 50 ms
22,584 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.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