Submission #1156589


Source Code Expand

Copy
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>

#define in std::cin
#define out std::cout

int32_t N,C,TIMEUP;
int32_t T[100000];

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);

	in >> N>>C>>TIMEUP;
	for (int32_t i = 0; i < N; ++i)
	{
		in >> T[i];
	}
	std::sort(T, T + N);

	int total = 1;
	auto s_time = T[0];
	auto count = 1;
	for (int32_t i = 1; i < N; ++i)
	{
		++count;
		if ((s_time + TIMEUP < T[i]) || (count > C)) {
			s_time = T[i];
			count = 1;
			++total;
		}
	}
	out << total << endl;

	return 0;
}
#endif

Submission Info

Submission Time
Task A - Airport Bus
User eiya
Language C++14 (GCC 5.4.1)
Score 300
Code Size 921 Byte
Status
Exec Time 18 ms
Memory 640 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample1.txt, sample2.txt
All 300 / 300 sample1.txt, sample2.txt, in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, sample1.txt, sample2.txt
Case Name Status Exec Time Memory
in1.txt 1 ms 256 KB
in2.txt 17 ms 640 KB
in3.txt 17 ms 640 KB
in4.txt 17 ms 640 KB
in5.txt 1 ms 256 KB
in6.txt 18 ms 640 KB
in7.txt 15 ms 640 KB
in8.txt 18 ms 640 KB
sample1.txt 1 ms 256 KB
sample2.txt 1 ms 256 KB