제출 #1184668

#제출 시각아이디문제언어결과실행 시간메모리
1184668petezaRabbit Carrot (LMIO19_triusis)C++20
0 / 100
0 ms328 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int pcnt = 0; ll n, j, x; int main() { cin.tie(0) -> sync_with_stdio(0); cin >> n >> j; deque<ll> deq(1, 0); for(int i=1;i<=n;i++) { cin >> x; if(x > i*j) {pcnt++; continue;} x -= i*j; while(deq.size() > 1 && x > deq.front()) { deq.pop_front(); pcnt++; } if(x <= deq[0]) deq.push_front(x); else pcnt++; } cout << pcnt; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...