# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
529173 | ToroTN | Martian DNA (BOI18_dna) | C++14 | 63 ms | 4568 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 n,m,t,want[200005],num1,num2,a[200005],st,md,ed,hsh[200005],cnt,type,kanttee;
int main()
{
scanf("%d%d%d",&n,&m,&t);
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
a[i]+=1;
}
for(int i=1;i<=t;i++)
{
scanf("%d%d",&num1,&num2);
want[num1+1]=max(want[num1+1],num2);
}
st=1;
ed=n;
while(ed>=st)
{
type=-1;
md=(st+ed)/2;
//printf("%d %d %d\n",st,md,ed);
kanttee=m-t;
memset(hsh,0,sizeof hsh);
for(int i=1;i<=md;i++)
{
++hsh[a[i]];
if(hsh[a[i]]==want[a[i]])
{
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... |