結果
| 問題 | 
                            No.345 最小チワワ問題
                             | 
                    
| コンテスト | |
| ユーザー | 
                             nbisco
                         | 
                    
| 提出日時 | 2016-08-11 15:06:13 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 332 bytes | 
| コンパイル時間 | 273 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-11-07 10:49:04 | 
| 合計ジャッジ時間 | 2,451 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 RE * 2 | 
| other | AC * 8 WA * 1 RE * 20 | 
ソースコード
S = input()
for i in range(3, len(S)):
    for j in range(0, len(S)+1-i):
        subs = S[j:j+i]
        c = subs.find("c")
        w = subs.find("w")
        if c == -1 or w == -1:
            continue
        if c > w:
            continue
        if subs.count("w") >= 2:
            print(i)
            sys.exit(1)
print(-1)
            
            
            
        
            
nbisco