Submission #152992

# Submission time Handle Problem Language Result Execution time Memory
152992 2019-09-11T05:38:37 Z Pyqe Ice Hockey World Championship (CEOI15_bobek) C++14
100 / 100
404 ms 16888 KB
#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

bobek.cpp: In function 'int main()':
bobek.cpp:11:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld%lld",&n,&d);
  ~~~~~^~~~~~~~~~~~~~~~~~
bobek.cpp:19:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%lld",&a[it][i]);
    ~~~~~^~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 328 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 400 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 368 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 368 KB Output is correct
6 Correct 2 ms 372 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 1912 KB Output is correct
2 Correct 106 ms 4496 KB Output is correct
3 Correct 399 ms 16772 KB Output is correct
4 Correct 83 ms 4472 KB Output is correct
5 Correct 9 ms 1400 KB Output is correct
6 Correct 6 ms 888 KB Output is correct
7 Correct 8 ms 1400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 37 ms 2424 KB Output is correct
2 Correct 26 ms 1912 KB Output is correct
3 Correct 162 ms 8584 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 5 ms 888 KB Output is correct
6 Correct 10 ms 1400 KB Output is correct
7 Correct 8 ms 1400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 53 ms 3456 KB Output is correct
2 Correct 120 ms 6492 KB Output is correct
3 Correct 112 ms 6520 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 35 ms 6520 KB Output is correct
6 Correct 141 ms 16760 KB Output is correct
7 Correct 54 ms 6520 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 248 ms 12784 KB Output is correct
2 Correct 22 ms 1912 KB Output is correct
3 Correct 9 ms 888 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 5 ms 908 KB Output is correct
6 Correct 133 ms 12680 KB Output is correct
7 Correct 8 ms 1400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 2040 KB Output is correct
2 Correct 81 ms 4480 KB Output is correct
3 Correct 7 ms 888 KB Output is correct
4 Correct 8 ms 888 KB Output is correct
5 Correct 47 ms 6568 KB Output is correct
6 Correct 16 ms 1912 KB Output is correct
7 Correct 109 ms 16760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 323 ms 16776 KB Output is correct
2 Correct 27 ms 2040 KB Output is correct
3 Correct 9 ms 888 KB Output is correct
4 Correct 404 ms 16888 KB Output is correct
5 Correct 55 ms 8568 KB Output is correct
6 Correct 11 ms 1400 KB Output is correct
7 Correct 14 ms 2424 KB Output is correct