Submission #902503

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9025032024-01-10 13:50:3412345678Miners (IOI07_miners)C++17
100 / 100
182 ms101156 KiB
#include <bits/stdc++.h>
using namespace std;
const int nx=1e5+5;
int n, dp[nx][4][4][4][4], v[nx], ans;
string s;
int val(int a, int b, int c)
{
if (a==3&&b==3) return 1;
if (a==3) return 1+(b!=c);
if (a==b&&b==c) return 1;
if (a==b||b==c||a==c) return 2;
return 3;
}
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n>>s;
if (n==1) return 1;
for (int i=0; i<n; i++) v[i+1]=s[i]=='B'?0:(s[i]=='F'?1:2);
for (int i=0; i<=n; i++) for (int j=0; j<4; j++) for (int k=0; k<4; k++) for (int x=0; x<4; x++) for (int y=0; y<4; y++) dp[i][j][k][x][y]=-1e9;
dp[0][3][3][3][3]=0;
for (int i=1; i<=n; i++)
{
for (int l1=0; l1<4; l1++)
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...