結果
問題 | No.346 チワワ数え上げ問題 |
ユーザー | maruyuki95 |
提出日時 | 2018-01-08 03:39:37 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 439 bytes |
コンパイル時間 | 145 ms |
コンパイル使用メモリ | 10,736 KB |
実行使用メモリ | 8,768 KB |
最終ジャッジ日時 | 2023-08-24 23:51:41 |
合計ジャッジ時間 | 4,425 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
7,892 KB |
testcase_01 | AC | 14 ms
7,828 KB |
testcase_02 | AC | 14 ms
7,824 KB |
testcase_03 | AC | 15 ms
7,788 KB |
testcase_04 | AC | 14 ms
7,848 KB |
testcase_05 | AC | 14 ms
7,740 KB |
testcase_06 | AC | 15 ms
7,760 KB |
testcase_07 | AC | 15 ms
7,784 KB |
testcase_08 | AC | 14 ms
7,740 KB |
testcase_09 | AC | 14 ms
7,840 KB |
testcase_10 | TLE | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
ソースコード
def execute(arg): ans = 0 cIndex = [] wIndex = [] for idx, s in enumerate(arg): if(s == "c"): cIndex.append(idx) if(s == "w"): if(len(cIndex) > 0 and len(wIndex) > 0): for c in cIndex: for w in wIndex: if(c < w): ans+=1 wIndex.append(idx) return ans print(execute(input()))