Submission #1972698


Source Code Expand

#include <algorithm>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <list>
#define INF 10000000000ll
#define MOD 1000000007ll
#define EPS 1e-10
#define REP(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define DUMP(a) for(long long dump=0; dump<(ll)a.size(); dump++) { cout<<a[dump]; if(dump!=(ll)a.size()-1) cout<<" "; else cout<<endl; }
#define ALL(v) v.begin(),v.end()
#define pb push_back
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef long double ld;
using namespace std;

int main(){
	int n, c;
	cin >> n >> c;
	int l[n];
	REP(i, n) cin >> l[i];
	sort(l, l+n);
	int end = n-1;
	int pair = 0;
	REP(i, n){
		while(l[i] + l[end] + 1 > c){if(end > 0){end--;}}
		if(i < end){pair++; end--;}
	}
	cout << n - pair << endl;
	return 0;
}

Submission Info

Submission Time
Task C - 収納
User EctoPlasma
Language C++14 (GCC 5.4.1)
Score 0
Code Size 961 Byte
Status TLE
Exec Time 2103 ms
Memory 640 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 1
TLE × 2
AC × 9
TLE × 7
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01.txt AC 59 ms 640 KB
02.txt AC 60 ms 640 KB
03.txt TLE 2103 ms 640 KB
04.txt AC 55 ms 640 KB
05.txt TLE 2103 ms 640 KB
06.txt TLE 2103 ms 640 KB
07.txt AC 32 ms 640 KB
08.txt AC 42 ms 640 KB
09.txt TLE 2103 ms 640 KB
10.txt TLE 2103 ms 640 KB
11.txt AC 60 ms 640 KB
12.txt AC 60 ms 640 KB
13.txt AC 33 ms 640 KB
sample_01.txt TLE 2103 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt TLE 2103 ms 256 KB