結果

問題 No.145 yukiover
ユーザー 37kt_
提出日時 2016-04-27 10:45:50
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 1,101 ms
コンパイル使用メモリ 160,512 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 16:00:30
合計ジャッジ時間 6,048 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 9 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int n;
string s;

int main(){
  cin >> n >> s;
  int c = 0;
  for (int i = 1; i <= 4; i++){
    string t("yuki", i);
    string u("aaaa", i);
    for (int j = 0; j + i <= n; j++){
      if (s.substr(j, j + i) > t){
        c++;
        s.replace(j, i, u);
      }
    }
  }
  cout << c << endl;
}
0