Problem:
Score : 100 points

Problem Statement

Snuke built an online judge to hold a programming contest.

When a program is submitted to the judge, the judge returns a verdict, which is a two-character string that appears in the string S as a contiguous substring.
(The judge can return any two-character substring of S.)

Determine whether the judge can return the string AC as the verdict to a program.

Constraints

2 \leq |S| \leq 5

S consists of uppercase English letters.

Input

Input is given from Standard Input in the following format:

S

Output

If the judge can return the string AC as a verdict to a program, print Yes; if it cannot, print No.

Sample Input 1

BACD

Sample Output 1

Yes

The string AC appears in BACD as a contiguous substring (the second and third characters).

Sample Input 2

ABCD

Sample Output 2

No

Although the string ABCD contains both A and C (the first and third characters), the string AC does not appear in ABCD as a contiguous substring.

Sample Input 3

CABD

Sample Output 3

No

Sample Input 4

ACACA

Sample Output 4

Yes

Sample Input 5

XX

Sample Output 5

No

Solution in C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include<bits/stdc++.h>
#define MX 1000000
using namespace std ;

int W[10004], cost[10004], dp[104][1004], ans[1000] ;

int NS(int i, int w, int cap, int n){
    int p1, p2 ;
    if(i > n) return 0 ;
    if(dp[i][w] != -1) return dp[i][w] ;
    if(w + W[i] <= cap){
        p1 = cost[i] + NS(i+1, w + W[i], cap, n) ;
    }
    else{
        p1 = 0 ;
    }
    p2 = NS(i+1, w, cap, n) ;
    dp[i][w] = max(p1, p2) ;
    if(w+W[i] <= cap) ans[w+W[i]] = dp[i][w] ;
    return dp[i][w] ;
}
void solve(){
    string s ;
    cin>>s ;
    for(int i = 1; i < s.size(); i++){
        if(s[i-1] == 'A' && s[i] == 'C'){
            cout<<"Yes"<<'\n' ;
            return ;
        }
    }
    cout<<"No"<<'\n' ;
}
int main(){
    solve() ;
    return 0 ;
}