# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
152992 | Pyqe | Ice Hockey World Championship (CEOI15_bobek) | C++14 | 404 ms | 16888 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;
long long n,d,nn[2],a[2][69],z[2][1048576],sz[2],zzz=0;
int main()
{
long long i,it,k,j;
scanf("%lld%lld",&n,&d);
nn[0]=(n-1)/2+1;
nn[1]=n/2;
for(it=0;it<2;it++)
{
sz[it]++;
for(i=0;i<nn[it];i++)
{
scanf("%lld",&a[it][i]);
k=sz[it];
for(j=0;j<k;j++)
{
z[it][sz[it]]=z[it][j]+a[it][i];
sz[it]++;
}
}
}
sort(z[0],z[0]+sz[0]);
for(i=0;i<sz[1];i++)
{
k=d-z[1][i];
if(k>=0)
{
zzz+=upper_bound(z[0],z[0]+sz[0],k)-z[0];
}
}
printf("%lld\n",zzz);
}
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... |