Submission #2847752
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define forx(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { int n, c, k,ans=0; cin >> n >> c >> k; vector<int> t(n); rep(i, n) cin >> t[i]; sort(t.begin(), t.end()); int i = 0; while(i<n){ int s = t[i] + k; int psg = 1; for (int j = 1; j < c && j + i < n; j++){ if(s>t[i+j]) psg++; } i += psg; ans++; } cout << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Airport Bus |
User | tabr |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 603 Byte |
Status | WA |
Exec Time | 1038 ms |
Memory | 640 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 1 ms | 256 KB |
in2.txt | AC | 52 ms | 640 KB |
in3.txt | WA | 56 ms | 640 KB |
in4.txt | AC | 46 ms | 640 KB |
in5.txt | AC | 2 ms | 256 KB |
in6.txt | AC | 1038 ms | 640 KB |
in7.txt | AC | 41 ms | 640 KB |
in8.txt | AC | 53 ms | 640 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |