結果
| 問題 | 
                            No.346 チワワ数え上げ問題
                             | 
                    
| コンテスト | |
| ユーザー | 
                             ebicochineal
                         | 
                    
| 提出日時 | 2016-03-12 22:28:08 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 233 bytes | 
| コンパイル時間 | 200 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 19,544 KB | 
| 最終ジャッジ日時 | 2024-09-25 11:11:53 | 
| 合計ジャッジ時間 | 15,319 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 3 | 
| other | AC * 20 TLE * 1 -- * 2 | 
ソースコード
import math
f = math.factorial
s = input()
l = [x for x in s if x in 'cw']
c = 0
sum = 0
for i in l:
    c += 1
    if i=='c':
        n = len([x for x in l[c:] if x == 'w'])
        if n>1: sum += (f(n) // f(n-2)) // f(2)
print(sum)
            
            
            
        
            
ebicochineal