Submission #98254

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
982542019-02-21 17:14:47scanhexGrowing Vegetable is Fun 3 (JOI19_ho_t3)C++17
100 / 100
275 ms164048 KiB
#include <bits/stdc++.h>
using namespace std;
using nagai = long long;
#define sz(x) int((x).size())
vector<int>occ[3];
const int N=404;
int dp[N][N][N][3];
#define chmi(x,y) x=min(x,y)
const int oo=0x3f3f3f3f;
int prec[3][3][N][N];
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin>>n;
string s;
cin>>s;
for(int i=0;i<n;++i){
if(s[i]=='R')occ[0].push_back(i);
if(s[i]=='G')occ[1].push_back(i);
if(s[i]=='Y')occ[2].push_back(i);
}
// memset(dp,0x3f,sizeof dp);
int arr[3];
for(arr[0]=0;arr[0]<=occ[0].size();++arr[0])
for(arr[1]=0;arr[1]<=occ[1].size();++arr[1])
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

joi2019_ho_t3.cpp: In function 'int main()':
joi2019_ho_t3.cpp:29:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(arr[0]=0;arr[0]<=occ[0].size();++arr[0])
               ~~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:30:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(arr[1]=0;arr[1]<=occ[1].size();++arr[1])
                ~~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:31:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(arr[2]=0;arr[2]<=occ[2].size();++arr[2])
                 ~~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:37:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int k=0;k<occ[i].size();++k)
                ~^~~~~~~~~~~~~~
joi2019_ho_t3.cpp:38:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int l=0;l<occ[j].size();++l){
                 ~^~~~~~~~~~~~~~
joi2019_ho_t3.cpp:39:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      for(int kek=l;kek<occ[j].size();++kek)
                    ~~~^~~~~~~~~~~~~~
joi2019_ho_t3.cpp:43:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(arr[0]=0;arr[0]<=occ[0].size();++arr[0])
               ~~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:44:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(arr[1]=0;arr[1]<=occ[1].size();++arr[1])
                ~~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:45:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(arr[2]=0;arr[2]<=occ[2].size();++arr[2])
                 ~~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:50:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      if(arr[0]==occ[0].size()&&arr[1]==occ[1].size()&&arr[2]==occ[2].size())
         ~~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:50:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      if(arr[0]==occ[0].size()&&arr[1]==occ[1].size()&&arr[2]==occ[2].size())
                                ~~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:50:61: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      if(arr[0]==occ[0].size()&&arr[1]==occ[1].size()&&arr[2]==occ[2].size())
                                                       ~~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:54:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if(arr[nw]==occ[nw].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...