QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#225384#7521. Find the GapPetroTarnavskyi#Compile Error//C++17664b2023-10-24 16:29:252023-10-24 16:29:25

Judging History

你现在查看的是最新测评结果

  • [2023-10-24 16:29:25]
  • 评测
  • [2023-10-24 16:29:25]
  • 提交

answer

	FOR(i, 0, SZ(s) + 1)
	{
		FOR(j, 0, 3)
			updAdd(dp[i][j], sum[i][j], M);
		int d[3] = {dp[i][0], add(dp[i][1], dp[i][0], M), add(dp[i][2], add(mult(2, dp[i][1], M), dp[i][0], M), M)};
		FOR(j, 0, 3)
		{
			updAdd(sum[i + 1][j], d[j], M);
			updSub(sum[i + f[i]][j], d[j], M);
			updAdd(sum[i + 1][j], sum[i][j], M);
		}
	}
	FOR(i, 0, SZ(s) + 1)
	{
		cerr << "i = " << i << endl;
		cerr << "f[i] " << f[i] << endl;
		cerr << "dp[i] \n";
		FOR(j, 0, 3)
			cerr << dp[i][j] << " ";
		cerr << endl;
	}
	cout << dp[SZ(s)][2] << "\n";
	return 0;
}
i = 0
f[i] 2
dp[i] 
1 0 0 
i = 1
f[i] 2
dp[i] 
1 1 1 
i = 2
f[i] 0
dp[i] 
1 2 4 
4

Details

answer.code:1:12: error: expected constructor, destructor, or type conversion before ‘(’ token
    1 |         FOR(i, 0, SZ(s) + 1)
      |            ^
answer.code:13:12: error: expected constructor, destructor, or type conversion before ‘(’ token
   13 |         FOR(i, 0, SZ(s) + 1)
      |            ^
answer.code:22:9: error: ‘cout’ does not name a type
   22 |         cout << dp[SZ(s)][2] << "\n";
      |         ^~~~
answer.code:23:9: error: expected unqualified-id before ‘return’
   23 |         return 0;
      |         ^~~~~~
answer.code:24:1: error: expected declaration before ‘}’ token
   24 | }
      | ^
answer.code:25:1: error: ‘i’ does not name a type
   25 | i = 0
      | ^