結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
|
提出日時 | 2024-02-28 11:59:52 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 361 bytes |
コンパイル時間 | 336 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-09-29 12:19:21 |
合計ジャッジ時間 | 2,162 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 9 WA * 20 |
ソースコード
import math N=list(input()) running=True ans=0 while running: try: c1=N.index('c') running=True del N[0:c1+1] except: running=False if running: try: ww=N.count("w") if ww<=1: running=False else: w_comb=math.comb(ww,2) ans+=w_comb except: running=False if ans==0: ans=-1 print(ans)