結果
| 問題 |
No.342 一番ワロタww
|
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2016-11-23 12:37:42 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 5,000 ms |
| コード長 | 1,158 bytes |
| コンパイル時間 | 1,219 ms |
| コンパイル使用メモリ | 106,368 KB |
| 実行使用メモリ | 18,688 KB |
| 最終ジャッジ日時 | 2024-10-15 13:34:16 |
| 合計ジャッジ時間 | 2,124 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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 != "" && wcnt > 0)
{
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);
}
}
}
}
くれちー