제출 #733714

#제출 시각아이디문제언어결과실행 시간메모리
733714vjudge1Nivelle (COCI20_nivelle)C++17
0 / 110
3 ms468 KiB
//Test case unutma ve reset //Sinirlari kontrol et #include <bits/stdc++.h> using namespace std; #define int long long #define mod 1e9+7 #define OYY 1e12 #define ordu ios_base::sync_with_stdio(false);cin.tie(NULL); #define mid (start+end)/2 int vis[100005]; map <char,int> mp; vector <pair<int,int>> v; int32_t main(){ ordu int n;cin>>n; string s;cin>>s; for(int i=0;i<n;i++)mp[s[i]]++; int maxi=0; map<char,int> ::iterator it=mp.begin(); while(it!=mp.end()){ maxi=max(maxi,it->second); it++; } int l,r; for(int i=0;i<n;i++){ if(maxi==mp[s[i]]){ l=i+1; break; } } for(int i=n-1;i>=0;i--){ if(mp[s[i]]==maxi){ r=i+1; break; } } cout<<l<<' '<<r<<'\n'; return 0; }
#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...