結果
問題 | No.2073 Concon Substrings (Swap Version) |
ユーザー |
![]() |
提出日時 | 2023-03-03 09:45:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 593 bytes |
コンパイル時間 | 4,730 ms |
コンパイル使用メモリ | 258,280 KB |
最終ジャッジ日時 | 2025-02-11 01:22:32 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 17 WA * 20 |
ソースコード
#include <bits/stdc++.h>#include <atcoder/all>using namespace atcoder;using namespace std;using ll=long long;using ld=double;ld pie=3.14159265359;ll mod=998244353;long long inf=100000000000000001;int main(){ll n;cin >> n;string s;cin >> s;map<pair<char,ll>,ll>memo;for (ll i = 0; i < s.size(); i++){memo[{s[i],i%3}]+=1;}ll ans=min(memo[{'c',0}],min(memo[{'o',1}],memo[{'n',2}]));ans+=min(memo[{'c',1}],min(memo[{'o',2}],memo[{'n',0}]));ans+=min(memo[{'c',2}],min(memo[{'o',0}],memo[{'n',1}]));cout << ans << endl;}