結果

問題 No.342 一番ワロタww
ユーザー くれちーくれちー
提出日時 2016-11-23 12:21:54
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,146 bytes
コンパイル時間 789 ms
コンパイル使用メモリ 107,392 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2024-05-05 12:47:14
合計ジャッジ時間 1,911 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 23 ms
18,688 KB
testcase_02 AC 23 ms
18,944 KB
testcase_03 AC 22 ms
18,560 KB
testcase_04 AC 23 ms
19,072 KB
testcase_05 AC 25 ms
18,560 KB
testcase_06 AC 24 ms
18,816 KB
testcase_07 AC 23 ms
18,688 KB
testcase_08 AC 23 ms
18,816 KB
testcase_09 AC 24 ms
18,688 KB
testcase_10 AC 23 ms
18,560 KB
testcase_11 AC 23 ms
18,688 KB
testcase_12 AC 23 ms
18,560 KB
testcase_13 AC 23 ms
18,560 KB
testcase_14 WA -
testcase_15 AC 21 ms
18,816 KB
testcase_16 AC 22 ms
18,816 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.Generic;
using System.Linq;

class Warota : IComparable<Warota>
{
    public string Word;
    public int Len;

    public Warota(string word, int len)
    {
        Word = word;
        Len = len;
    }

    public int CompareTo(Warota w)
    {
        return Len.CompareTo(w.Len);
    }
}

class Program
{
    static void Main()
    {
        string s = Console.ReadLine();
        var w = new List<Warota>();
        string buf = "";
        int wcnt = 0;

        s = new string(s.Reverse().ToArray()) + "w";

        foreach (var c in s)
        {
            if (c != 'w')
            {
                buf = buf.Insert(0, c.ToString());
            }
            else
            {
                if (buf != "")
                {
                    w.Add(new Warota(buf, wcnt));
                    wcnt = 0;
                }
                buf = "";
                wcnt++;
            }
        }

        w.Reverse();

        foreach (var ans in w)
        {
            if (ans.Len == w.Max().Len)
            {
                Console.WriteLine(ans.Word);
            }
        }
    }
}
0