Submission #1167883


Source Code Expand

#include<bits/stdc++.h>
#define DEBUG 0
/*
*/

using namespace std;



int main() {
	long long int N, K;
	cin >> N >> K;
	vector<long long int>A(N);
	for (size_t i = 0; i < N; i++)
	{
		cin >> A[i];
	}
	long long int ans = 0;
	for (size_t i = 0; i < N; i++)
	{
		bool f = true;

		long long int ansxx = LLONG_MAX / 6;
		if (0 >= K - A[i])
		{
			ansxx = min(ansxx, 0LL);
		}
		set<long long int>S;
		S.insert(0);
		for (size_t j = 0; j < N; j++)
		{
			if (j != i)
			{
				set<long long int>SS = S;
				for (auto x : S) {
					if (x + A[j] < K - A[i])
					{
						SS.insert(x + A[j]);
					}
					else {
						ansxx = min(ansxx, x + A[j]);
						if (ansxx<K)
						{
							break;
						}
					}
				}
				if (ansxx<K)
				{
					break;
				}
				S = SS;
			}
		}

		//cout << ansxx << endl;
		if (ansxx >= K)
		{
			ans++;
		}
	}

	cout << ans << endl;


	if (DEBUG)
	{
		int ewataeoprgjpsrteog;
		cin >> ewataeoprgjpsrteog;
	}
}

Submission Info

Submission Time
Task D - No Need
User goryudyuma
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1006 Byte
Status TLE
Exec Time 2103 ms
Memory 768 KB

Judge Result

Set Name Sample Subtask All
Score / Max Score 0 / 0 0 / 300 0 / 300
Status
AC × 3
AC × 24
TLE × 2
AC × 42
TLE × 9
Set Name Test Cases
Sample 0_000.txt, 0_001.txt, 0_002.txt
Subtask 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt
All 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 2_026.txt, 2_027.txt, 2_028.txt, 2_029.txt, 2_030.txt, 2_031.txt, 2_032.txt, 2_033.txt, 2_034.txt, 2_035.txt, 2_036.txt, 2_037.txt, 2_038.txt, 2_039.txt, 2_040.txt, 2_041.txt, 2_042.txt, 2_043.txt, 2_044.txt, 2_045.txt, 2_046.txt, 2_047.txt, 2_048.txt, 2_049.txt, 2_050.txt
Case Name Status Exec Time Memory
0_000.txt AC 1 ms 256 KB
0_001.txt AC 1 ms 256 KB
0_002.txt AC 1 ms 256 KB
1_003.txt AC 1 ms 256 KB
1_004.txt AC 1 ms 256 KB
1_005.txt AC 1 ms 256 KB
1_006.txt AC 2 ms 256 KB
1_007.txt AC 2 ms 256 KB
1_008.txt TLE 2103 ms 256 KB
1_009.txt TLE 2103 ms 256 KB
1_010.txt AC 1 ms 256 KB
1_011.txt AC 1 ms 256 KB
1_012.txt AC 1 ms 256 KB
1_013.txt AC 1 ms 256 KB
1_014.txt AC 1 ms 256 KB
1_015.txt AC 2 ms 256 KB
1_016.txt AC 1 ms 256 KB
1_017.txt AC 1 ms 256 KB
1_018.txt AC 1 ms 256 KB
1_019.txt AC 4 ms 256 KB
1_020.txt AC 1 ms 256 KB
1_021.txt AC 1 ms 256 KB
1_022.txt AC 2 ms 256 KB
1_023.txt AC 1 ms 256 KB
1_024.txt AC 455 ms 256 KB
1_025.txt AC 708 ms 256 KB
2_026.txt AC 1 ms 256 KB
2_027.txt AC 7 ms 384 KB
2_028.txt AC 6 ms 384 KB
2_029.txt TLE 2103 ms 768 KB
2_030.txt TLE 2103 ms 768 KB
2_031.txt AC 4 ms 256 KB
2_032.txt AC 4 ms 256 KB
2_033.txt AC 3 ms 256 KB
2_034.txt AC 3 ms 256 KB
2_035.txt AC 3 ms 256 KB
2_036.txt AC 8 ms 256 KB
2_037.txt AC 6 ms 384 KB
2_038.txt AC 7 ms 512 KB
2_039.txt AC 9 ms 640 KB
2_040.txt AC 1434 ms 512 KB
2_041.txt AC 3 ms 256 KB
2_042.txt AC 9 ms 384 KB
2_043.txt AC 126 ms 256 KB
2_044.txt AC 80 ms 256 KB
2_045.txt AC 41 ms 256 KB
2_046.txt TLE 2103 ms 512 KB
2_047.txt TLE 2103 ms 640 KB
2_048.txt TLE 2103 ms 768 KB
2_049.txt TLE 2103 ms 768 KB
2_050.txt TLE 2103 ms 768 KB