結果

問題 No.495 (^^*) Easy
ユーザー test
提出日時 2020-09-09 04:23:02
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 682 bytes
コンパイル時間 30,296 ms
コンパイル使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-14 08:47:06
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
コンパイルが30秒の制限時間を超えました

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, ss, ee) for (int i = ss; i < ee; ++i)
using namespace std;

int countRegexIterator(const string str, const string pattern) {
  vector<string> v;
  regex pt(pattern);
  std::sregex_iterator end, it{str.begin(), str.end(), pt};
  for (; it != end; ++it) {
    v.emplace_back(it->str());
  }
  return v.size();
}
auto solve() {
  string ans;
  string s, p;
  cin >> s;
  p = "(\\(\\^\\^\\*\\))";
  ans += to_string(countRegexIterator(s, p));
  ans += " ";
  p = "(\\(\\*\\^\\^\\))";
  ans += to_string(countRegexIterator(s, p));
  return ans;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << solve() << endl;
  getchar();
}
0