# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
908102 | ibm2006 | Segway (COI19_segway) | C++17 | 2 ms | 12632 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;
typedef long long int ll;
ll n,i,j,k,l,r,x,y,z,w,s,t,a[1100000],b[1100000],c[1100000],d[1100000],chk[1100000],tt[1100000],q,m,ans[1100000];
int main()
{
scanf("%lld",&n);
for(i=1;i<=n;i++)
{
scanf("%lld %lld %lld",&x,&y,&z);
a[i]=x;
b[i]=y;
c[i]=z;
}
scanf("%lld",&m);
scanf("%lld",&x);
for(i=1;i<=n;i++)
{
if(x<=100)
{
d[i]=x*a[i];
continue;
}
if(x<=200)
{
d[i]=100*a[i]+(x-100)*b[i];
continue;
}
d[i]=100*a[i]+100*b[i]+(x-200)*c[i];
}
for(i=1;i<=n;i++)
{
chk[d[i]]++;
}
for(i=30001;i>=0;i--)
{
tt[i]=s%20;
s+=chk[i];
}
for(i=1;i<=n;i++)
{
for(j=0;j<300;j++)
{
if(q>0)
{
ans[i]++;
q--;
continue;
}
if(j==x)
{
q=tt[d[i]];
q--;
ans[i]++;
continue;
}
if(j<100)
ans[i]+=a[i];
else if(j<200)
ans[i]+=b[i];
else
ans[i]+=c[i];
}
}
for(i=1;i<=n;i++)
printf("%lld\n",ans[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... |