結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
![]() |
提出日時 | 2017-12-14 23:09:21 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 390 bytes |
コンパイル時間 | 98 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-12-14 13:36:13 |
合計ジャッジ時間 | 2,172 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 9 RE * 7 |
ソースコード
s = input() l = [] count = 0 temp = '' max = 0 for i in range(len(s)): count = 0 temp = '' if s[i] == 'c': for j in range(i, len(s)): temp += s[j] if s[j] == 'w': count += 1 if count == 2: break l.append(temp) for i in l: if not i[1] == 'c' and i.count('w') == 2 and len(i) > max: max = len(i) if max: print(max) else: print(-1)