Submission #8916384


Source Code Expand

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cout << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//#define int long long

void solve() {
	string s; cin >> s;
    string t = "AKIHABARA";
    int n = s.size();
    int i = 0, j = 0;
    while(i < 9) {
        if(s[i] != t[j]) {
            s.insert(s.begin() + i, 'A');
        } else {
            ++i;
            ++j;
        }
    }
    if(s == t) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Submission Info

Submission Time
Task A - AKIBA
User otera
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1916 Byte
Status TLE
Exec Time 2103 ms
Memory 900 KB

Judge Result

Set Name sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 1
TLE × 2
AC × 10
TLE × 14
Set Name Test Cases
sample sample-01.txt, sample-02.txt, sample-03.txt
All sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, sample-01.txt, sample-02.txt, sample-03.txt
Case Name Status Exec Time Memory
01-01.txt AC 1 ms 256 KB
01-02.txt AC 1 ms 256 KB
01-03.txt TLE 2103 ms 896 KB
01-04.txt TLE 2103 ms 896 KB
01-05.txt AC 1 ms 256 KB
01-06.txt AC 1 ms 256 KB
01-07.txt AC 1 ms 256 KB
01-08.txt TLE 2103 ms 900 KB
01-09.txt TLE 2103 ms 900 KB
01-10.txt TLE 2103 ms 896 KB
01-11.txt AC 1 ms 256 KB
01-12.txt TLE 2103 ms 896 KB
01-13.txt TLE 2103 ms 900 KB
01-14.txt TLE 2103 ms 896 KB
01-15.txt TLE 2103 ms 896 KB
01-16.txt TLE 2103 ms 900 KB
01-17.txt AC 1 ms 256 KB
01-18.txt AC 1 ms 256 KB
sample-01.txt AC 1 ms 256 KB
sample-02.txt TLE 2103 ms 900 KB
sample-03.txt TLE 2103 ms 896 KB