Submission #747715

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7477152023-05-24 14:36:42Sami_MassahDango Maker (JOI18_dango_maker)C++17
100 / 100
671 ms19468 KiB
#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3000 + 12 ;
long long n, m, ans, dp[maxn][4][4];
string s[maxn];
vector <int> nums;
bool val(int a, int b){
if(a < 0 || a >= n)
return 0;
if(b < 0 || b >= m)
return 0;
return 1;
}
int get_max(){
// for(int i: nums)
// cout << i << ' ';
//cout << endl;
for(int i = 0; i <= nums.size(); i++)
for(int j = 0; j < 4; j++)
for(int c = 0; c < 4; c++)
dp[i][j][c] = 0;
for(int i = 3; i < nums.size(); i++){
for(int j = 0; j < 4; j++)
for(int c = 0; c < 4; c++){
if(j & 1)
dp[i][c][j] = max(dp[i][c][j], dp[i - 2][nums[i - 2] & 1][nums[i - 3] & 1] + 1 + (c > 0));
if(j & 2)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

dango_maker.cpp: In function 'int get_max()':
dango_maker.cpp:20:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     for(int i = 0; i <= nums.size(); i++)
      |                    ~~^~~~~~~~~~~~~~
dango_maker.cpp:24:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |     for(int i = 3; i < nums.size(); i++){
      |                    ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...