Language: C++

#include <stdio.h>
#include <string.h>
int main(){
	int N,K;//N日分のシミュレーション
	scanf("%d %d",&N,&K);
	long long int dp[N][3];
	long long int delete[3];
	int i,j,k;
	memset(dp,0,sizeof(dp));//初期化
	memset(delete,0,sizeof(delete));
	int a,b;
	for(i=0;i<K;i++){
		scanf("%d %d",&a,&b);
		dp[a-1][b-1]=1;
	}
	if(dp[0][0]==0&&dp[0][1]==0&&dp[0][2]==0){//予約がなければ全てあり得る
		dp[0][0]++;
		dp[0][1]++;
		dp[0][2]++;
	}
	int flag;
	long long int temp=0;
	for(i=1;i<N;i++){
		flag=0;
		temp=dp[i-1][0]+dp[i-1][1]+dp[i-1][2];
		for(j=0;j<3;j++){
			if(dp[i][j]==1){
				dp[i][j]=temp-delete[j];
				for(k=0;k<3;k++){
					if(k==j){
						delete[j]=dp[i-1][j]-delete[j];//2日連チャンで食べている通り
					}
					else{
						delete[k]=0;
					}
				}
				flag=1;
				break;
			}
		}
		if(flag==0){
			for(j=0;j<3;j++){
				dp[i][j]=temp-delete[j];
				delete[j]=dp[i-1][j]-delete[j];
			}
		}
		if(delete[0]>10000&&delete[1]>10000&&delete[2]>10000){
			delete[0]%=10000;
			delete[1]%=10000;
			delete[2]%=10000;
			dp[i][0]=(dp[i][0]%10000)+10000;
			dp[i][1]=(dp[i][1]%10000)+10000;
			dp[i][2]=(dp[i][2]%10000)+10000;
			
		}
	}
	printf("%lld\n",(dp[N-1][0]+dp[N-1][1]+dp[N-1][2])%10000);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: expected unqualified-id before 'delete'
    7 |         long long int delete[3];
      |                       ^~~~~~
a.cc:10:22: error: expected primary-expression before ',' token
   10 |         memset(delete,0,sizeof(delete));
      |                      ^
a.cc:10:38: error: expected primary-expression before ')' token
   10 |         memset(delete,0,sizeof(delete));
      |                                      ^
a.cc:28:54: error: expected ']' before 'j'
   28 |                                 dp[i][j]=temp-delete[j];
      |                                                      ^
      |                                                      ]
a.cc:28:54: error: type 'int' argument given to 'delete', expected pointer
a.cc:31:56: error: expected ']' before 'j'
   31 |                                                 delete[j]=dp[i-1][j]-delete[j];//2日連チャンで食べている通り
      |                                                        ^
      |                                                        ]
a.cc:31:56: error: type 'int' argument given to 'delete', expected pointer
a.cc:34:56: error: expected ']' before 'k'
   34 |                                                 delete[k]=0;
      |                                                        ^
      |                                                        ]
a.cc:34:56: error: type 'int' argument given to 'delete', expected pointer
a.cc:43:54: error: expected ']' before 'j'
   43 |                                 dp[i][j]=temp-delete[j];
      |                                                      ^
      |                                                      ]
a.cc:43:54: error: type 'int' argument given to 'delete', expected pointer
a.cc:44:40: error: expected ']' before 'j'
   44 |                                 delete[j]=dp[i-1][j]-delete[j];
      |                                        ^
      |                                        ]
a.cc:44:40: error: type 'int' argument given to 'delete', expected pointer
a.cc:47:27: error: expected ']' before numeric constant
   47 |                 if(delete[0]>10000&&delete[1]>10000&&delete[2]>10000){
      |                           ^
      |                           ]
a.cc:47:27: error: type 'int' argument given to 'delete', expected pointer
a.cc:47:28: error: expected ')' before ']' token
   47 |                 if(delete[0]>10000&&delete[1]>10000&&delete[2]>10000){
      |                   ~        ^
      |                            )
a.cc:47:28: error: expected primary-expression before ']' token