結果
| 問題 |
No.1229 ラグビーの得点パターン
|
| コンテスト | |
| ユーザー |
Strorkis
|
| 提出日時 | 2020-09-18 21:33:47 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 576 bytes |
| コンパイル時間 | 12,725 ms |
| コンパイル使用メモリ | 377,444 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-22 09:04:50 |
| 合計ジャッジ時間 | 13,782 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 25 |
ソースコード
macro_rules! read_line_to_tuple {
( $( $t:ty ),* ) => {{
let mut input = String::new();
std::io::stdin().read_line(&mut input).unwrap();
let mut iter = input.split_whitespace();
( $( iter.next().unwrap().parse::<$t>().unwrap() ),* )
}};
}
use std::cmp;
fn main() {
let n = read_line_to_tuple!(usize);
let mut ans = 0;
for a in 0..=(n / 5) {
for b in 0..=cmp::min(a, (n - a * 5) / 2) {
if (n - a * 5 - b * 2) % 3 == 0 {
ans += 1;
}
}
}
println!("{}", ans);
}
Strorkis