結果

問題 No.1469 programing
ユーザー ninoinuininoinui
提出日時 2021-04-09 21:21:44
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 407 ms / 3,000 ms
コード長 3,469 bytes
コンパイル時間 8,133 ms
コンパイル使用メモリ 313,772 KB
実行使用メモリ 14,348 KB
最終ジャッジ日時 2023-09-07 09:35:40
合計ジャッジ時間 7,172 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 9 ms
4,384 KB
testcase_09 AC 11 ms
4,380 KB
testcase_10 AC 10 ms
4,384 KB
testcase_11 AC 7 ms
4,380 KB
testcase_12 AC 4 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 8 ms
4,376 KB
testcase_15 AC 25 ms
4,380 KB
testcase_16 AC 42 ms
4,412 KB
testcase_17 AC 407 ms
14,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifndef _DEBUG
#define _DEBUG
#include __FILE__

signed main() {
  string S;
  cin >> S;

  int N = (int)S.size();
  for (int i = 1; i < N; i++) {
    if (S.at(i) == S.at(i - 1)) S.at(i - 1) = 'A';
  }

  S = regex_replace(S, regex("A"), "");
  cout << S << "\n";
}

#else
// #undef _DEBUG
#pragma GCC diagnostic warning "-Wextra"
#pragma GCC diagnostic warning "-Wshadow"
#include <bits/stdc++.h>
using namespace std;

struct io_setup {
  io_setup() { cin.tie(nullptr)->sync_with_stdio(false); }
} io_setup;

template <class A, class B> bool cmin(A& a, const B& b) {
  if (a > b) return a = b, true;
  return false;
}

template <class A, class B> bool cmax(A& a, const B& b) {
  if (a < b) return a = b, true;
  return false;
}

template <class A, class B> ostream& operator<<(ostream& os, const pair<A, B>& p);

template <class A, class B, class C> ostream& operator<<(ostream& os, const tuple<A, B, C>& t);

template <class A, class B, class C, class D> ostream& operator<<(ostream& os, const tuple<A, B, C, D>& t);

#define foreach(it, a) for (auto it = a.begin(); it != a.end(); it++)

ostream& operator<<(ostream& os, const vector<char>& vec) {
  os << "{";
  foreach (it, vec) { os << (it == vec.begin() ? "" : " ") << *it; }
  return os << "}";
}

template <class A> ostream& operator<<(ostream& os, const vector<A>& vec) {
  os << "{";
  foreach (it, vec) { os << (it == vec.begin() ? "" : ", ") << *it; }
  return os << "}";
}

template <class A> ostream& operator<<(ostream& os, const vector<vector<A> >& vec) {
  os << "{\n";
  foreach (it, vec) { os << (it == vec.begin() ? " " : "\n ") << *it; }
  return os << "\n}";
}

template <class A> ostream& operator<<(ostream& os, const vector<vector<vector<A> > >& vec) {
  os << "{\n";
  foreach (it, vec) { os << (it == vec.begin() ? "" : "\n") << it - vec.begin() << ": " << *it; }
  return os << "\n}";
}

template <class A> ostream& operator<<(ostream& os, const set<A>& se) {
  os << "{";
  foreach (it, se) { os << (it == se.begin() ? "" : ", ") << *it; }
  return os << "}";
}

template <class A> ostream& operator<<(ostream& os, const multiset<A>& ms) {
  os << "{";
  foreach (it, ms) { os << (it == ms.begin() ? "" : ", ") << *it; }
  return os << "}";
}

template <class A, class B> ostream& operator<<(ostream& os, const map<A, B>& ma) {
  os << "{";
  foreach (it, ma) { os << (it == ma.begin() ? "" : ", ") << *it; }
  return os << "}";
}

template <class A> ostream& operator<<(ostream& os, priority_queue<A> pq) {
  os << "{";
  while (!pq.empty()) {
    os << pq.top(), pq.pop();
    if (!pq.empty()) os << ", ";
  }
  return os << "}";
}

template <class A, class B> ostream& operator<<(ostream& os, const pair<A, B>& p) {
  const auto& [a, b] = p;
  return os << "(" << a << ", " << b << ")";
}

template <class A, class B, class C> ostream& operator<<(ostream& os, const tuple<A, B, C>& t) {
  const auto& [a, b, c] = t;
  return os << "(" << a << ", " << b << ", " << c << ")";
}

template <class A, class B, class C, class D> ostream& operator<<(ostream& os, const tuple<A, B, C, D>& t) {
  const auto& [a, b, c, d] = t;
  return os << "(" << a << ", " << b << ", " << c << ", " << d << ")";
}

void dump_func() {}
template <class A, class... B> void dump_func(const A& a, const B&... b) {
  cout << a << (sizeof...(b) ? ", " : "\n");
  dump_func(b...);
}

#ifdef _DEBUG
#define dump(...) cout << "[" << (#__VA_ARGS__) << "]: ", dump_func(__VA_ARGS__)
#else
#define dump(...)
#endif
#endif
0