Language: C++

import itertools

N = int(input().strip())

i2s = [''.join(s) for s in itertools.product('ACGT', 'ACGT', 'ACGT')]

dp = [{s:0 for s in i2s} for _ in range(N)]

def update(i, prev_str, next_char):
  dp[i][prev_str[1:]+next_char] += dp[i-1][prev_str]

# init
for k in i2s:
  if k in ['AGC', 'GAC', 'ACG']: continue
  dp[2][k] = 1
  
for i in range(3, N):
  for k in i2s:
    if (k[0] == 'A' and k[2] == 'G') or k[1:] == 'GA' or k[1:] == 'AC' or k[:2] == 'AG' or k[1:] == 'AG':
      for n in 'ATG':
        update(i, k, n)
    elif k[:2] == 'AG':
      for n in 'ATC':
        update(i, k, n)
    else:
      for n in 'ATGC':
        update(i, k, n)


Compiler output:
a.cc:5:8: error: empty character constant
    5 | i2s = [''.join(s) for s in itertools.product('ACGT', 'ACGT', 'ACGT')]
      |        ^~
a.cc:5:46: warning: multi-character character constant [-Wmultichar]
    5 | i2s = [''.join(s) for s in itertools.product('ACGT', 'ACGT', 'ACGT')]
      |                                              ^~~~~~
a.cc:5:54: warning: multi-character character constant [-Wmultichar]
    5 | i2s = [''.join(s) for s in itertools.product('ACGT', 'ACGT', 'ACGT')]
      |                                                      ^~~~~~
a.cc:5:62: warning: multi-character character constant [-Wmultichar]
    5 | i2s = [''.join(s) for s in itertools.product('ACGT', 'ACGT', 'ACGT')]
      |                                                              ^~~~~~
a.cc:12:3: error: invalid preprocessing directive #init
   12 | # init
      |   ^~~~
a.cc:14:12: warning: multi-character character constant [-Wmultichar]
   14 |   if k in ['AGC', 'GAC', 'ACG']: continue
      |            ^~~~~
a.cc:14:19: warning: multi-character character constant [-Wmultichar]
   14 |   if k in ['AGC', 'GAC', 'ACG']: continue
      |                   ^~~~~
a.cc:14:26: warning: multi-character character constant [-Wmultichar]
   14 |   if k in ['AGC', 'GAC', 'ACG']: continue
      |                          ^~~~~
a.cc:19:50: warning: multi-character character constant [-Wmultichar]
   19 |     if (k[0] == 'A' and k[2] == 'G') or k[1:] == 'GA' or k[1:] == 'AC' or k[:2] == 'AG' or k[1:] == 'AG':
      |                                                  ^~~~
a.cc:19:67: warning: multi-character character constant [-Wmultichar]
   19 |     if (k[0] == 'A' and k[2] == 'G') or k[1:] == 'GA' or k[1:] == 'AC' or k[:2] == 'AG' or k[1:] == 'AG':
      |                                                                   ^~~~
a.cc:19:84: warning: multi-character character constant [-Wmultichar]
   19 |     if (k[0] == 'A' and k[2] == 'G') or k[1:] == 'GA' or k[1:] == 'AC' or k[:2] == 'AG' or k[1:] == 'AG':
      |                                                                                    ^~~~
a.cc:19:101: warning: multi-character character constant [-Wmultichar]
   19 |     if (k[0] == 'A' and k[2] == 'G') or k[1:] == 'GA' or k[1:] == 'AC' or k[:2] == 'AG' or k[1:] == 'AG':
      |                                                                                                     ^~~~
a.cc:20:16: warning: multi-character character constant [-Wmultichar]
   20 |       for n in 'ATG':
      |                ^~~~~
a.cc:22:19: warning: multi-character character constant [-Wmultichar]
   22 |     elif k[:2] == 'AG':
      |                   ^~~~
a.cc:23:16: warning: multi-character character constant [-Wmultichar]
   23 |       for n in 'ATC':
      |                ^~~~~
a.cc:26:16: warning: multi-character character constant [-Wmultichar]
   26 |       for n in 'ATGC':
      |                ^~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import itertools
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:26: error: expected unqualified-id before 'for'
    7 | dp = [{s:0 for s in i2s} for _ in range(N)]
      |                          ^~~