제출 #156036

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1560362019-10-03 01:50:31souhhcongJOIOJI (JOI14_joioji)C++14
100 / 100
73 ms8584 KiB
#include <iostream>
#include <map>
#include <stdio.h>
#include <string.h>
using namespace std;
const int N = 2e5+5;
const long long mpI = 1000000007, mpO = 100000009, mpJ = -(mpI+mpO);
int n, ans = 0;
string s;
long long pref[N], a[N];
int cnt[30];
map<long long,int> check;
int main()
{
cin >> n >> s;
if (n <= 4000)
{
for (int i = 0; i < n; i++)
{
memset(cnt,0,sizeof cnt);
for (int j = i; j < n; j++)
{
cnt[s[j]-'A']++;
if (cnt['I'-'A'] == cnt['O'-'A'] && cnt['I'-'A'] == cnt['J'-'A'])
ans = max(ans,j-i+1);
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...