結果
| 問題 | 
                            No.3110 Like CPCTF?
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2025-04-20 10:57:26 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 409 bytes | 
| コンパイル時間 | 422 ms | 
| コンパイル使用メモリ | 12,160 KB | 
| 実行使用メモリ | 10,240 KB | 
| 最終ジャッジ日時 | 2025-04-20 10:57:27 | 
| 合計ジャッジ時間 | 1,507 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 3 | 
| other | WA * 16 | 
ソースコード
from itertools import combinations
def count_cpctf_like_subsequences(S):
    N = len(S)
    count = 0
    for i, j, k, l, m in combinations(range(N), 5):
        s1, s2, s3, s4, s5 = S[i], S[j], S[k], S[l], S[m]
        if s1 == s3:
            if len(set([s1, s2, s4, s5])) == 4:
                # s1とs3が同じで、他が全て異なれば条件を満たす
                count += 1
    return count