結果
問題 | No.345 最小チワワ問題 |
ユーザー | R N |
提出日時 | 2020-10-12 21:36:05 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 435 bytes |
コンパイル時間 | 86 ms |
コンパイル使用メモリ | 10,656 KB |
実行使用メモリ | 9,128 KB |
最終ジャッジ日時 | 2023-09-27 23:50:35 |
合計ジャッジ時間 | 1,836 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | AC | 21 ms
8,944 KB |
testcase_05 | AC | 26 ms
9,008 KB |
testcase_06 | AC | 21 ms
8,988 KB |
testcase_07 | AC | 21 ms
9,008 KB |
testcase_08 | AC | 22 ms
9,012 KB |
testcase_09 | AC | 21 ms
8,952 KB |
testcase_10 | WA | - |
testcase_11 | AC | 21 ms
8,996 KB |
testcase_12 | AC | 22 ms
8,972 KB |
testcase_13 | AC | 22 ms
8,968 KB |
testcase_14 | AC | 22 ms
8,996 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 23 ms
8,892 KB |
testcase_19 | AC | 23 ms
8,948 KB |
testcase_20 | WA | - |
testcase_21 | AC | 22 ms
8,996 KB |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 21 ms
8,992 KB |
testcase_29 | AC | 21 ms
9,064 KB |
testcase_30 | AC | 21 ms
8,928 KB |
testcase_31 | AC | 22 ms
8,996 KB |
ソースコード
# coding=utf-8: import re s = str(input()) if "cww" in s: print(3) elif "cww" not in s: print(-1) elif len(s) < 3: print(-1) elif len(s) >= 4: c = re.compile(r'.*c.*w.*w') countList = list() for i in range(len(s)): temp1 = re.search(c, s[i:]) if temp1 != None: temp2 = temp1.group() countList.append(len(temp2)) else: break print(min(countList))