제출 #901667

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9016672024-01-09 22:01:09alexander707070Misspelling (JOI22_misspelling)C++14
28 / 100
62 ms11112 KiB
#include<bits/stdc++.h>
#define MAXN 2007
using namespace std;
const int mod=1e9+7;
int n,m,a,b,ans;
int dp[MAXN][30];
int maxs[MAXN][MAXN],maxs2[MAXN][MAXN],es[MAXN],es2[MAXN];
bool bad[MAXN],bad2[MAXN];
void calc_dp(){
for(int pos=n;pos>=1;pos--){
for(int f=pos+1;f<=es[pos];f++)bad[f]=true;
for(int f=pos+1;f<=es2[pos];f++)bad2[f]=true;
for(int letter=0;letter<26;letter++){
dp[pos][letter]=1;
for(int nxtletter=0;nxtletter<26;nxtletter++){
if(nxtletter==letter)continue;
for(int f=pos+1;f<=n;f++){
if(nxtletter<letter and !bad[f]){
dp[pos][letter]+=dp[f][nxtletter];
dp[pos][letter]%=mod;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...