Submission #19460632


Source Code Expand

Copy
#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << "\n"
#define COUTF(x) cout << setprecision(15) << (x) << "\n"
#define ENDL cout << "\n"
#define DF(x) x.erase(x.begin())
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define RSORT(x) sort(x.rbegin(), x.rend())
#define REVERSE(x) reverse(ALL(x))
#define MAX(x) *max_element(ALL(x))
#define MAXI(x) max_element(ALL(x)) - x.begin()
#define SUM(x) accumulate(ALL(x), 0ll)
#define COUNT(x, y) count(ALL(x), y);
#define ANS cout << ans << "\n"
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define Yes cout << "Yes\n";
#define No cout << "No\n";
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define LINE cerr << "[debug] line: " << __LINE__ << endl;
#define debug(x) cerr << "[debug] " << #x << ": " << x << endl;
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(z, v.size()) cerr << " " << v[z]; \
  cerr << endl;
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using mll = map<ll, ll>;
using qll = queue<ll>;
using P = pair<ll, ll>;
using vp = vector<P>;
using vs = vector<string>;

template <typename T>
inline istream& operator>>(istream& i, vector<T>& v) {
  rep(j, v.size()) i >> v[j];
  return i;
}

template <typename T1, typename T2>
inline istream& operator>>(istream& i, pair<T1, T2>& v) {
  return i >> v.first >> v.second;
}

constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}

ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x * x % mod, n / 2, mod);
  if (n & 1) res *= x;
  res %= mod;
  return res;
}

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

  ll c = 0;
  vector<char> b;
  string m = "HAGIYA";
  rep(i, S.size()) {
    if (c == -1) {
      cout << S[i];
      continue;
    }
    if (S[i] == m[c]) {
      c++;
      b.push_back(S[i]);

      if (b.size() == 6) {
        cout << "HAGIXILE";
        c = -1;
        continue;
      }
    } else {
      for (char bb : b) cout << bb;
      b = vector<char>();
      cout << S[i];
      c = 0;
    }
  }
  ENDL;

  return 0;
}

Submission Info

Submission Time
Task A - HAGIXILE
User sotozaki
Language C++ (GCC 9.2.1)
Score 20
Code Size 2792 Byte
Status AC
Exec Time 5 ms
Memory 3640 KB

Judge Result

Set Name All
Score / Max Score 20 / 20
Status
AC × 64
Set Name Test Cases
All 00_manual1.txt, 00_manual2.txt, 00_sample.txt, 00_small00.txt, 00_small01.txt, 00_small02.txt, 00_small03.txt, 00_small04.txt, 00_small05.txt, 00_small06.txt, 00_small07.txt, 00_small08.txt, 00_small09.txt, 00_small10.txt, 00_small11.txt, 00_small12.txt, 00_small13.txt, 00_small14.txt, 00_small15.txt, 00_small16.txt, 00_small17.txt, 00_small18.txt, 00_small19.txt, 00_small20.txt, 00_small21.txt, 00_small22.txt, 00_small23.txt, 00_small24.txt, 00_small25.txt, 00_small26.txt, 00_small27.txt, 00_small28.txt, 00_small29.txt, 01_large00.txt, 01_large01.txt, 01_large02.txt, 01_large03.txt, 01_large04.txt, 01_large05.txt, 01_large06.txt, 01_large07.txt, 01_large08.txt, 01_large09.txt, 01_large10.txt, 01_large11.txt, 01_large12.txt, 01_large13.txt, 01_large14.txt, 01_large15.txt, 01_large16.txt, 01_large17.txt, 01_large18.txt, 01_large19.txt, 01_large20.txt, 01_large21.txt, 01_large22.txt, 01_large23.txt, 01_large24.txt, 01_large25.txt, 01_large26.txt, 01_large27.txt, 01_large28.txt, 01_large29.txt, 03_manual00.txt
Case Name Status Exec Time Memory
00_manual1.txt AC 5 ms 3596 KB
00_manual2.txt AC 2 ms 3632 KB
00_sample.txt AC 3 ms 3556 KB
00_small00.txt AC 2 ms 3600 KB
00_small01.txt AC 2 ms 3620 KB
00_small02.txt AC 2 ms 3484 KB
00_small03.txt AC 2 ms 3600 KB
00_small04.txt AC 3 ms 3560 KB
00_small05.txt AC 2 ms 3596 KB
00_small06.txt AC 2 ms 3556 KB
00_small07.txt AC 2 ms 3488 KB
00_small08.txt AC 3 ms 3532 KB
00_small09.txt AC 2 ms 3556 KB
00_small10.txt AC 2 ms 3584 KB
00_small11.txt AC 3 ms 3556 KB
00_small12.txt AC 2 ms 3464 KB
00_small13.txt AC 2 ms 3632 KB
00_small14.txt AC 2 ms 3528 KB
00_small15.txt AC 3 ms 3608 KB
00_small16.txt AC 2 ms 3600 KB
00_small17.txt AC 3 ms 3584 KB
00_small18.txt AC 2 ms 3468 KB
00_small19.txt AC 3 ms 3496 KB
00_small20.txt AC 2 ms 3620 KB
00_small21.txt AC 3 ms 3628 KB
00_small22.txt AC 2 ms 3628 KB
00_small23.txt AC 2 ms 3628 KB
00_small24.txt AC 2 ms 3560 KB
00_small25.txt AC 2 ms 3600 KB
00_small26.txt AC 2 ms 3544 KB
00_small27.txt AC 3 ms 3596 KB
00_small28.txt AC 4 ms 3476 KB
00_small29.txt AC 4 ms 3600 KB
01_large00.txt AC 2 ms 3612 KB
01_large01.txt AC 2 ms 3600 KB
01_large02.txt AC 4 ms 3608 KB
01_large03.txt AC 2 ms 3628 KB
01_large04.txt AC 2 ms 3612 KB
01_large05.txt AC 3 ms 3440 KB
01_large06.txt AC 2 ms 3596 KB
01_large07.txt AC 4 ms 3596 KB
01_large08.txt AC 3 ms 3484 KB
01_large09.txt AC 3 ms 3540 KB
01_large10.txt AC 2 ms 3588 KB
01_large11.txt AC 2 ms 3632 KB
01_large12.txt AC 2 ms 3500 KB
01_large13.txt AC 4 ms 3628 KB
01_large14.txt AC 2 ms 3444 KB
01_large15.txt AC 2 ms 3476 KB
01_large16.txt AC 3 ms 3484 KB
01_large17.txt AC 2 ms 3588 KB
01_large18.txt AC 2 ms 3604 KB
01_large19.txt AC 2 ms 3556 KB
01_large20.txt AC 3 ms 3640 KB
01_large21.txt AC 2 ms 3600 KB
01_large22.txt AC 3 ms 3556 KB
01_large23.txt AC 3 ms 3640 KB
01_large24.txt AC 2 ms 3488 KB
01_large25.txt AC 2 ms 3536 KB
01_large26.txt AC 3 ms 3544 KB
01_large27.txt AC 2 ms 3544 KB
01_large28.txt AC 2 ms 3532 KB
01_large29.txt AC 2 ms 3556 KB
03_manual00.txt AC 2 ms 3540 KB