Submission #1156431
Source Code Expand
# -*- coding: utf-8 -*- import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys def s(): return raw_input().strip() def n(): return int(raw_input()) def d(): return float(raw_input()) def ls(): return raw_input().strip().split() def ln(): return map(int, raw_input().strip().split()) def ld(): return map(float, raw_input().strip().split()) def fs(): return [raw_input().strip() for i in xrange(input())] def fn(): return [int(raw_input().strip()) for i in xrange(input())] def fd(): return [float(raw_input().strip()) for i in xrange(input())] N, C, K = ln() T = [] for i in xrange(N): T.append(n()) T.sort() bus = 0 last = T[0] count = 1 for t in T[1:]: if t - last >= K or count == C: bus += 1 last = t count = 1 else: count += 1 bus += 1 print bus
Submission Info
Submission Time | |
---|---|
Task | A - Airport Bus |
User | mugenen |
Language | PyPy2 (5.6.0) |
Score | 0 |
Code Size | 906 Byte |
Status | WA |
Exec Time | 379 ms |
Memory | 37272 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 | 379 ms | 34792 KB |
in2.txt | AC | 123 ms | 37272 KB |
in3.txt | WA | 121 ms | 37144 KB |
in4.txt | AC | 122 ms | 37144 KB |
in5.txt | AC | 73 ms | 33256 KB |
in6.txt | AC | 121 ms | 37144 KB |
in7.txt | AC | 116 ms | 37144 KB |
in8.txt | AC | 121 ms | 37144 KB |
sample1.txt | AC | 56 ms | 33256 KB |
sample2.txt | AC | 56 ms | 33256 KB |