Submission #1304017
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,C,K;cin>>N>>C>>K; vector<int> T; REP(i,N){ int a;cin>>a;T.pb(a);} sort(ALL(T)); int r=1,b=T[0]; REP(i,N){ if(b+C<T[i]){ 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 | 0 |
Code Size | 1103 Byte |
Status | WA |
Exec Time | 47 ms |
Memory | 892 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 | WA | 47 ms | 892 KB |
in3.txt | WA | 47 ms | 892 KB |
in4.txt | WA | 47 ms | 892 KB |
in5.txt | WA | 2 ms | 256 KB |
in6.txt | WA | 47 ms | 892 KB |
in7.txt | WA | 41 ms | 892 KB |
in8.txt | WA | 47 ms | 892 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |