Submission #2178525
Source Code Expand
#include<stdio.h> #include<stdlib.h> int cmp(const void *a,const void *b) { return *(int *)a-*(int *)b; } int main() { int n,c,k,t[100005],i,sum=0,ans=1,x; scanf("%d%d%d",&n,&c,&k); for(i=0;i<n;i++) scanf("%d",&t[i]); qsort(t,n,sizeof(t[0]),cmp); x=t[0]+k; for(i=0;i<n;i++) { if(x>=t[i]&&sum<c)sum++; else{ ans++; x=t[i]+k; sum=0; } } printf("%d\n",ans); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Airport Bus |
User | vjudge2 |
Language | Bash (GNU bash v4.3.11) |
Score | 0 |
Code Size | 393 Byte |
Status | RE |
Exec Time | 380 ms |
Memory | 2284 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 | RE | 380 ms | 2284 KB |
in2.txt | RE | 1 ms | 376 KB |
in3.txt | RE | 1 ms | 376 KB |
in4.txt | RE | 1 ms | 376 KB |
in5.txt | RE | 1 ms | 376 KB |
in6.txt | RE | 1 ms | 376 KB |
in7.txt | RE | 1 ms | 376 KB |
in8.txt | RE | 1 ms | 376 KB |
sample1.txt | RE | 1 ms | 376 KB |
sample2.txt | RE | 1 ms | 376 KB |