結果

問題 No.145 yukiover
ユーザー 37kt_37kt_
提出日時 2016-04-27 10:45:50
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 1,374 ms
コンパイル使用メモリ 160,016 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 04:35:36
合計ジャッジ時間 6,074 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 329 ms
6,944 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 297 ms
6,940 KB
testcase_15 WA -
testcase_16 AC 317 ms
6,944 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 301 ms
6,944 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 307 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

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