Submission #1802783
Source Code Expand
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define pb push_back
#define mp make_pair
#define x first
#define y second
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
template <class T>
void read(T &x)
{
char ch;
for (ch=getchar();(ch<'0'||ch>'9')&&ch!='-';) ch=getchar();
x=0;int t=1;if (ch=='-') {ch=getchar();t=-1;}
for (;ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0';
x*=t;
}
char a[55];
int main()
{
#ifndef ONLINE_JUDGE
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
#endif
scanf("%s",a+1);int n=strlen(a+1);
if (n>9) {puts("NO");return 0;}
for (int i=0;i<(1<<(n+1));i++)
{
int k=0;string s="";
for (int j=0;j<n+1;j++)
{
if (i&(1<<j)) s+='A';
if (j<n) s+=a[j+1];
}
if (s=="AKIHABARA") {puts("YES");return 0;}
}
puts("NO");
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - AKIBA |
| User | SanSiroWaltz |
| Language | C++14 (GCC 5.4.1) |
| Score | 300 |
| Code Size | 1049 Byte |
| Status | AC |
| Exec Time | 5 ms |
| Memory | 764 KiB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:41:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s",a+1);int n=strlen(a+1);
^
Judge Result
| Set Name | sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| 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 | 5 ms | 764 KiB |
| 01-02.txt | AC | 1 ms | 256 KiB |
| 01-03.txt | AC | 1 ms | 256 KiB |
| 01-04.txt | AC | 1 ms | 256 KiB |
| 01-05.txt | AC | 1 ms | 256 KiB |
| 01-06.txt | AC | 1 ms | 256 KiB |
| 01-07.txt | AC | 1 ms | 256 KiB |
| 01-08.txt | AC | 1 ms | 256 KiB |
| 01-09.txt | AC | 1 ms | 256 KiB |
| 01-10.txt | AC | 1 ms | 256 KiB |
| 01-11.txt | AC | 1 ms | 256 KiB |
| 01-12.txt | AC | 1 ms | 256 KiB |
| 01-13.txt | AC | 1 ms | 256 KiB |
| 01-14.txt | AC | 1 ms | 256 KiB |
| 01-15.txt | AC | 1 ms | 256 KiB |
| 01-16.txt | AC | 1 ms | 256 KiB |
| 01-17.txt | AC | 1 ms | 256 KiB |
| 01-18.txt | AC | 1 ms | 256 KiB |
| sample-01.txt | AC | 1 ms | 256 KiB |
| sample-02.txt | AC | 1 ms | 256 KiB |
| sample-03.txt | AC | 1 ms | 256 KiB |