# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
580958 | AGE | Nivelle (COCI20_nivelle) | C++14 | 1082 ms | 596 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>
#define F first
#define S second
#define int long long
#define pb push_back
using namespace std;
const int N=1e6,M=2e3,mod=1e9+7;
main()
{
int n;
cin>>n;
set<int>st;
string s;
cin>>s;
double ans=1e18;
int L,R;
for(int i=0;i<n;i++){
st.clear();
for(int j=i;j<n;j++){
st.insert(s[j]);
double num=st.size();
double len=(double)j-i+1;
if(num/len<ans){
ans=num/len;
L=i,R=j;
}
}
}
cout<<L+1<<" "<<R+1<<endl;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |