Submission #1304444
Source Code Expand
#include <iostream> #include <stack> #include <cstdio> #include <cstdlib> #include <cmath> #include <string> #include <vector> #include <queue> #include <map> #include <set> #include <tuple> #include <algorithm> #include <functional> #include <cstring> #include <limits.h> #define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i) #define REP(i,n) FOR(i,0,n) #define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i) #define SZ(i) ((int)i.size()) #define pb push_back #define mp make_pair #define mt make_tuple #define ALL(X) (X).begin(),(X).end() #define LLMAX 9223372036854775807 #define LLMIN -9223372036854775808 #define IMAX 2147483647 #define IMIN -2147483648 typedef long long LL; using namespace std; int main(void){ int N;LL C;int K;cin>>N>>C>>K; vector<LL> T; REP(i,N){ int a;cin>>a;T.pb(a);} sort(ALL(T)); int r=1,b=T[0],c=0; REP(i,N){ c++; if(b+K<T[i] || C<c){ c=1; b=T[i]; r++; } } cout<<r<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Airport Bus |
User | a_kawashiro |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1152 Byte |
Status | AC |
Exec Time | 49 ms |
Memory | 1400 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 | 1 ms | 256 KB |
in2.txt | AC | 49 ms | 1400 KB |
in3.txt | AC | 47 ms | 1400 KB |
in4.txt | AC | 47 ms | 1400 KB |
in5.txt | AC | 2 ms | 256 KB |
in6.txt | AC | 47 ms | 1400 KB |
in7.txt | AC | 42 ms | 1400 KB |
in8.txt | AC | 48 ms | 1400 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |