Submission #1535421
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define rep(i,n) REP(i,0,n) #define REP(i,s,e) for(int i=(s); i<(int)(e); i++) #define repr(i, n) REPR(i, n, 0) #define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--) #define pb push_back #define all(r) r.begin(),r.end() #define rall(r) r.rbegin(),r.rend() #define fi first #define se second typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll MOD = 1e9 + 7; double EPS = 1e-8; int main(){ int n, c, k; cin >> n >> c >> k; vi t(n); rep(i, n) cin >> t[i]; int cnt = 0, ans = 1; int time = t[0]+k; REP(i, 1, n) { if(cnt == c || t[i] > time) { cnt = 0; time = t[i] + k; ans++; } else { cnt++; } } cout << ans+1 << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Airport Bus |
User | T1610 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 867 Byte |
Status | WA |
Exec Time | 41 ms |
Memory | 640 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 | WA | 1 ms | 256 KB |
in2.txt | WA | 40 ms | 640 KB |
in3.txt | WA | 40 ms | 640 KB |
in4.txt | WA | 41 ms | 640 KB |
in5.txt | AC | 2 ms | 256 KB |
in6.txt | WA | 41 ms | 640 KB |
in7.txt | WA | 35 ms | 640 KB |
in8.txt | WA | 40 ms | 640 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |