Submission #1417223
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define PI 4*atan(1) #define INF 1e8 int dx[4] = {1,0,-1,0}; int dy[4] = {0,1,0,-1}; typedef long long ll; int main(){ ll N, C, K; cin >> N >> C >> K; vector<ll> T(N); for(int i = 0; i < N; i++){ cin >> T[i]; } sort(T.begin(), T.end()); ll ans = 0, l = 0, c = 0; for(int i = 0; i < N; i++){ if(l < T[i]){ ans++; c++; if(c == C){ l = 0; c = 0; }else{ l = T[i] + K; } }else{ c++; if(c == C){ l = 0; c = 0; } } } cout << ans << endl; }
Submission Info
Submission Time | |
---|---|
Task | A - Airport Bus |
User | yuta0802 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 647 Byte |
Status | WA |
Exec Time | 47 ms |
Memory | 1024 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 | AC | 47 ms | 1024 KB |
in3.txt | WA | 46 ms | 1024 KB |
in4.txt | AC | 46 ms | 1024 KB |
in5.txt | WA | 2 ms | 256 KB |
in6.txt | AC | 46 ms | 1024 KB |
in7.txt | WA | 41 ms | 896 KB |
in8.txt | WA | 47 ms | 1024 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |