結果

問題 No.342 一番ワロタww
ユーザー eitahoeitaho
提出日時 2016-02-12 22:31:00
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 110 ms / 5,000 ms
コード長 2,372 bytes
コンパイル時間 3,065 ms
コンパイル使用メモリ 111,804 KB
実行使用メモリ 26,500 KB
最終ジャッジ日時 2023-08-05 16:04:25
合計ジャッジ時間 5,413 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
24,232 KB
testcase_01 AC 102 ms
26,500 KB
testcase_02 AC 103 ms
24,528 KB
testcase_03 AC 102 ms
24,596 KB
testcase_04 AC 104 ms
26,460 KB
testcase_05 AC 103 ms
24,384 KB
testcase_06 AC 105 ms
26,344 KB
testcase_07 AC 104 ms
24,564 KB
testcase_08 AC 103 ms
24,396 KB
testcase_09 AC 103 ms
22,528 KB
testcase_10 AC 107 ms
26,408 KB
testcase_11 AC 102 ms
24,556 KB
testcase_12 AC 110 ms
24,460 KB
testcase_13 AC 104 ms
22,420 KB
testcase_14 AC 98 ms
24,284 KB
testcase_15 AC 93 ms
24,304 KB
testcase_16 AC 102 ms
26,416 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.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using Enu = System.Linq.Enumerable;
using System.Text.RegularExpressions;

class Program
{
    public void Solve()
    {
        var S = Reader.String();
        int maxLen = 0;
        var matches = Regex.Matches(S, "[^w]+(w+)");
        foreach (Match m in matches)
            maxLen = Math.Max(maxLen, m.Groups[1].Length);
        foreach (Match m in matches)
            if (m.Groups[1].Length == maxLen)
                Console.WriteLine(m.ToString().Replace("w", ""));
    }
}


class Entry { static void Main() { new Program().Solve(); } }
class Reader
{
    private static TextReader reader = Console.In;
    private static readonly char[] separator = { ' ' };
    private static readonly StringSplitOptions op = StringSplitOptions.RemoveEmptyEntries;
    private static string[] A = new string[0];
    private static int i;
    private static void Init() { A = new string[0]; }
    public static void Set(TextReader r) { reader = r; Init(); }
    public static void Set(string file) { reader = new StreamReader(file); Init(); }
    public static bool HasNext() { return CheckNext(); }
    public static string String() { return Next(); }
    public static int Int() { return int.Parse(Next()); }
    public static long Long() { return long.Parse(Next()); }
    public static double Double() { return double.Parse(Next()); }
    public static int[] IntLine() { return Array.ConvertAll(Split(Line()), int.Parse); }
    public static int[] IntArray(int N) { return Enu.Range(0, N).Select(i => Int()).ToArray(); }
    public static int[][] IntTable(int H) { return Enu.Range(0, H).Select(i => IntLine()).ToArray(); }
    public static string[] StringArray(int N) { return Enu.Range(0, N).Select(i => Next()).ToArray(); }
    public static string Line() { return reader.ReadLine().Trim(); }
    private static string[] Split(string s) { return s.Split(separator, op); }
    private static string Next() { CheckNext(); return A[i++]; }
    private static bool CheckNext()
    {
        if (i < A.Length) return true;
        string line = reader.ReadLine();
        if (line == null) return false;
        if (line == "") return CheckNext();
        A = Split(line);
        i = 0;
        return true;
    }
}
0