# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
340309 | ammar2000 | Grudanje (COCI19_grudanje) | C++17 | 2098 ms | 8300 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;
int ans,q,st[100000],e[100000],b;
map <int ,int > mp;
vector <int> v;
string s;
int main()
{
cin>>s>>q;
for (int i=0;i<q;++i)
cin>>st[i]>>e[i];
for (int i=0;i<s.length();i++)
{
int t;
cin>>t;
mp[t]=i+1;
}
for (int i=0;i<q;++i)
{
for (int y=st[i]-1;y<e[i];y++)
if (s[y]=='a')
v.push_back(mp[y+1]);
sort (v.begin(),v.end());
v.pop_back();
ans=max(ans,v.back());
v.clear();
}
cout <<ans;
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... |
# | 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... |