結果
問題 | No.2757 Pin Game |
ユーザー |
![]() |
提出日時 | 2024-05-17 21:26:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 148 ms / 2,000 ms |
コード長 | 344 bytes |
コンパイル時間 | 589 ms |
コンパイル使用メモリ | 74,520 KB |
最終ジャッジ日時 | 2025-02-21 14:30:43 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 10 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>using namespace std;int main(){int n, k;cin >> n >> k;vector<int> x(n);for (int i = 0; i < n; ++i) cin >> x[i];int now = x[0], ans = 1;for (int i = 1; i < n; ++i){if (x[i] - now >= k){now = x[i];++ans;}}cout << ans << endl;}