結果
| 問題 |
No.2073 Concon Substrings (Swap Version)
|
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2022-09-22 20:55:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 377 bytes |
| コンパイル時間 | 319 ms |
| コンパイル使用メモリ | 82,792 KB |
| 実行使用メモリ | 63,836 KB |
| 最終ジャッジ日時 | 2024-12-22 05:04:08 |
| 合計ジャッジ時間 | 3,850 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 17 WA * 20 |
ソースコード
import sys input=lambda:sys.stdin.readline().rstrip() N=int(input()) S=input() targ='con' mem=[[0 for i in range(3)] for j in range(3)] for i in range(3*N): if S[i] in targ: mem[i%3][targ.find(S[i])]+=1 if mem[0][0]==mem[1][1]==mem[2][2]==N: print(N) else: ans=0 for i in range(3): temp=3*N for j in range(3): temp=min(mem[j][(i+j)%3],temp) ans+=temp print(ans)
ytft