結果
| 問題 | 
                            No.345 最小チワワ問題
                             | 
                    
| コンテスト | |
| ユーザー | 
                             WagiHOH
                         | 
                    
| 提出日時 | 2016-07-11 00:39:07 | 
| 言語 | D  (dmd 2.109.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 334 bytes | 
| コンパイル時間 | 7,961 ms | 
| コンパイル使用メモリ | 309,888 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-12 03:39:03 | 
| 合計ジャッジ時間 | 9,009 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 1 | 
| other | AC * 21 WA * 8 | 
ソースコード
import std.stdio;
import std.algorithm;
import std.range;
import std.regex;
import std.exception;
void main()
{
    auto line = readln;
    iota(0, line.length)
        .map!(i => line[i..$])
        .map!(x => x.matchFirst(ctRegex!"c[^w]*?w[^w]*?w")[0].length)
        .fold!"b > 0 && a > b ? b : a".ifThrown(-1)
        .writeln;
}
            
            
            
        
            
WagiHOH