結果

問題 No.2757 Pin Game
ユーザー
提出日時 2024-05-18 23:11:06
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 12,900 ms
コンパイル使用メモリ 382,092 KB
実行使用メモリ 7,424 KB
最終ジャッジ日時 2024-12-20 16:33:38
合計ジャッジ時間 13,975 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::Read;

fn main() {
	let mut s = String::new();
	std::io::stdin().read_to_string(&mut s).ok();
	let n: Vec<i64> =
		s.split_whitespace().skip(1).flat_map(str::parse).collect();
	let k = n[0];
	let mut t = n[1];
	let mut a = 1;
	for &x in n[2..].iter() {
		if x - t >= k {
			a += 1;
			t = x;
		}
	}
	println!("{}", a);
}
0