Language: C++

#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>

#define REP(i,x,y) for(int i=(x);i<(y);i++)
#define RREP(i,x,y) for(int i=(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
// #define int long long

using namespace std;

// conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#else
#define eprintf(...) 42
#define dump(x) 42
#define debug(x) 42
#endif

typedef long long ll;

const int MAX_N = 100;
const ll MOD = 1e9 + 7;







bool isValid(std::string& key) {
    return key.find(“AGC”) != std::string::npos &&
        key.find(“ACG”) != std::string::npos &&
        key.find(“GAC”) != std::string::npos &&
        key.find(“AGGC”) != std::string::npos &&
        key.find(“AGTC”) != std::string::npos &&
        key.find(“AGGC”) != std::string::npos &&
        key.find(“ATGC”) != std::string::npos;
}

ll solve(int N) {
    std::vector<std::unordered_map<std::string, int> > dp(N);
    std::string chars = “AGCT”;
    for (const char& c : chars) {
        dp[0][“TTT” + c] = 1;
    }
    int i = 0;
    while (i < N-1) {
        for (const auto& pair : dp[i]) {
            std::string& key = pair.first;
            std::string& value = pair.second;
            for (const char& c : chars) {
                std::string nextKey(key.substring(key.begin() + 1, key.end()) + c);
                if( isValid(nextKey) ) {
                    dp[i+1][nextKey] += second;
                    dp[i+1][nextKey] %= MOD;
                }
            }
        }
    }

    ll answer = 0;
    for (const auto& pair : dp[N-1]) {
        answer += pair.second;
        answer %= MOD;        
    }

    return answer;
}

signed main() {
    // to shorten execution time for iostream
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    cout << solve(N) << "\n";
    return 0;
}


Compiler output:
a.cc:48:21: error: extended character “ is not valid in an identifier
   48 |     return key.find(“AGC”) != std::string::npos &&
      |                     ^
a.cc:48:21: error: extended character ” is not valid in an identifier
a.cc:49:18: error: extended character “ is not valid in an identifier
   49 |         key.find(“ACG”) != std::string::npos &&
      |                  ^
a.cc:49:18: error: extended character ” is not valid in an identifier
a.cc:50:18: error: extended character “ is not valid in an identifier
   50 |         key.find(“GAC”) != std::string::npos &&
      |                  ^
a.cc:50:18: error: extended character ” is not valid in an identifier
a.cc:51:18: error: extended character “ is not valid in an identifier
   51 |         key.find(“AGGC”) != std::string::npos &&
      |                  ^
a.cc:51:18: error: extended character ” is not valid in an identifier
a.cc:52:18: error: extended character “ is not valid in an identifier
   52 |         key.find(“AGTC”) != std::string::npos &&
      |                  ^
a.cc:52:18: error: extended character ” is not valid in an identifier
a.cc:53:18: error: extended character “ is not valid in an identifier
   53 |         key.find(“AGGC”) != std::string::npos &&
      |                  ^
a.cc:53:18: error: extended character ” is not valid in an identifier
a.cc:54:18: error: extended character “ is not valid in an identifier
   54 |         key.find(“ATGC”) != std::string::npos;
      |                  ^
a.cc:54:18: error: extended character ” is not valid in an identifier
a.cc:59:25: error: extended character “ is not valid in an identifier
   59 |     std::string chars = “AGCT”;
      |                         ^
a.cc:59:25: error: extended character ” is not valid in an identifier
a.cc:61:15: error: extended character “ is not valid in an identifier
   61 |         dp[0][“TTT” + c] = 1;
      |               ^
a.cc:61:15: error: extended character ” is not valid in an identifier
a.cc: In function 'bool isValid(std::string&)':
a.cc:48:21: error: '\U0000201cAGC\U0000201d' was not declared in this scope
   48 |     return key.find(“AGC”) != std::string::npos &&
      |                     ^~~~~
a.cc:49:18: error: '\U0000201cACG\U0000201d' was not declared in this scope
   49 |         key.find(“ACG”) != std::string::npos &&
      |                  ^~~~~
a.cc:50:18: error: '\U0000201cGAC\U0000201d' was not declared in this scope
   50 |         key.find(“GAC”) != std::string::npos &&
      |                  ^~~~~
a.cc:51:18: error: '\U0000201cAGGC\U0000201d' was not declared in this scope
   51 |         key.find(“AGGC”) != std::string::npos &&
      |                  ^~~~~~
a.cc:52:18: error: '\U0000201cAGTC\U0000201d' was not declared in this scope
   52 |         key.find(“AGTC”) != std::string::npos &&
      |                  ^~~~~~
a.cc:54:18: error: '\U0000201cATGC\U0000201d' was not declared in this scope
   54 |         key.find(“ATGC”) != std::string::npos;
      |                  ^~~~~~
a.cc: In function 'll solve(int)':
a.cc:59:25: error: '\U0000201cAGCT\U0000201d' was not declared in this scope
   59 |     std::string chars = “AGCT”;
      |                         ^~~~~~
a.cc:61:15: error: '\U0000201cTTT\U0000201d' was not declared in this scope
   61 |         dp[0][“TTT” + c] = 1;
      |               ^~~~~
a.cc:66:37: error: binding reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to 'const std::__cxx11::basic_string<char>' discards qualifiers
   66 |             std::string& key = pair.first;
      |                                ~~~~~^~~~~
a.cc:67:39: error: invalid initialization of reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} from expression of type 'const int'
   67 |             std::string& value = pair.second;
      |                                  ~~~~~^~~~~~
a.cc:69:41: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'substring'; did you mean 'substr'?
   69 |                 std::string nextKey(key.substring(key.begin() + 1, key.end()) + c);
      |                                         ^~~~~~~~~
      |                                         substr
a.cc:71:41: error: 'second' was not declared in this scope
   71 |                     dp[i+1][nextKey] += second;
      |                                         ^~~~~~