Submission #427957

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4279572021-06-15 06:06:21BertedGrowing Vegetable is Fun 3 (JOI19_ho_t3)C++14
15 / 100
257 ms7956 KiB
#include <iostream>
#include <vector>
#define ll long long
using namespace std;
const ll INF = 1e18;
int N; string S;
vector<int> A[3];
ll DP[2][3][401][401];
int main()
{
cin >> N >> S;
for (int i = 1; i <= N; i++)
{
if (S[i - 1] == 'R') {A[0].push_back(i);}
else if (S[i - 1] == 'G') {A[1].push_back(i);}
else {A[2].push_back(i);}
}
for (int s = 0; s < 3; s++)
for (int i = 0; i <= N; i++)
for (int j = 0; j <= N; j++) DP[0][s][i][j] = INF;
for (int s = 0; s < 3; s++) DP[0][s][0][0] = 0;
for (int i = 1; i <= N; i++)
{
for (int s = 0; s < 3; s++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

joi2019_ho_t3.cpp: In function 'int main()':
joi2019_ho_t3.cpp:36:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |    for (int j = 0; j <= i && j <= A[0].size(); j++)
      |                              ~~^~~~~~~~~~~~~~
joi2019_ho_t3.cpp:38:37: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |     for (int k = 0; k + j <= i && k <= A[1].size(); k++)
      |                                   ~~^~~~~~~~~~~~~~
joi2019_ho_t3.cpp:41:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |      if (l > A[2].size()) continue;
      |          ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...