| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 202588 | detaomega | Lampice (COCI19_lampice) | C++14 | 518 ms | 632 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define int long long
#define X first
#define Y second
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define int long long
#define de(x,y) cout<<#x<<" "<<x<<y;
#define pray(a,i,n_thing) for(int x=i;x<=(i+n_thing);x++) cout<<#a<<"["<<x<<"] :"<<a[x]<<endl;
#define mem(aa,x) memset(aa,x,sizeof aa)
#define pb push_back
typedef long long ll;
typedef pair<int,int> ii;
const int maxn=4e5+5;
int arr[maxn];
main() {
IOS
int n;
cin >> n;
string s;
cin >> s;
int ans = 1 , len = s.size();
for(int i=0;i<s.size()-1;i++) {
int tmp = 1;
for(int j=1;j<=s.size();j++) {
if(i-j < 0 || i+j >= len)
break;
if(s[i - j] != s[i + j])
break;
tmp += 2;
}
ans = max(ans , tmp);
if(s[i] == s[i+1]) {
tmp = 2;
for(int j=1;j<=s.size();j++) {
if(i-j < 0 || i+j+1 >= len)
break;
if(s[i - j] != s[i + j+1])
break;
tmp += 2;
}
}
ans = max(ans , tmp);
if(ans == len)
break;
}
cout << ans << "\n";
return 0;
} Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
