Submission #2178652
Source Code Expand
#include<stdio.h> int main() { long long t[100003],n,c,k,i,b,j,d; while(scanf("%lld %lld %lld",&n,&c,&k)!=EOF) { for(i=0;i<n;i++) { scanf("%lld",&t[i]); } for(i=0;i<n-1;i++) { for(j=i+1;j<n;j++) { if(t[i]>t[j]) { b=t[i];t[i]=t[j];t[j]=b; } } } long long x=0,y=1; for(i=0;i<n;i++) { b=t[i]+k; if(t[i+1]<b&&y<c) y++; else { x++;y=1; } } printf("%lld\n",x+1); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Airport Bus |
User | vjudge1 |
Language | C (GCC 5.4.1) |
Score | 0 |
Code Size | 459 Byte |
Status | WA |
Exec Time | 2103 ms |
Memory | 896 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:9:4: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%lld",&t[i]); ^
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 | 2 ms | 128 KB |
in2.txt | TLE | 2103 ms | 896 KB |
in3.txt | TLE | 2103 ms | 896 KB |
in4.txt | TLE | 2103 ms | 896 KB |
in5.txt | WA | 7 ms | 128 KB |
in6.txt | TLE | 2103 ms | 896 KB |
in7.txt | TLE | 2103 ms | 896 KB |
in8.txt | TLE | 2103 ms | 896 KB |
sample1.txt | AC | 1 ms | 128 KB |
sample2.txt | AC | 1 ms | 128 KB |