結果
問題 |
No.346 チワワ数え上げ問題
|
ユーザー |
![]() |
提出日時 | 2016-03-12 22:26:09 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 225 bytes |
コンパイル時間 | 447 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 19,840 KB |
最終ジャッジ日時 | 2024-09-25 11:11:36 |
合計ジャッジ時間 | 15,956 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 8 RE * 12 TLE * 2 -- * 1 |
ソースコード
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']) sum += (f(n) // f(n-2)) // f(2) print(sum)