Submission #2009800
Source Code Expand
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n, c, k, t[100010]; cin >> n >> c >> k; for (int i = 0; i < n; i++) cin >> t[i]; sort(t, t + n); t[n] = 2000000010; int ans = 0, tt = t[0], cc = 0; for (int i = 0; i < n; i++) { cc++; if (cc == c or t[i + 1] > tt + k) { cc = 0; tt = t[i + 1]; ans++; } cerr << tt << " " << cc << " " << ans << endl; } cout << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Airport Bus |
User | reverd |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 573 Byte |
Status | AC |
Exec Time | 298 ms |
Memory | 640 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt |
All | 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 | AC | 4 ms | 256 KB |
in2.txt | AC | 298 ms | 640 KB |
in3.txt | AC | 296 ms | 640 KB |
in4.txt | AC | 296 ms | 640 KB |
in5.txt | AC | 7 ms | 256 KB |
in6.txt | AC | 298 ms | 640 KB |
in7.txt | AC | 259 ms | 640 KB |
in8.txt | AC | 296 ms | 640 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |