結果
問題 |
No.188 HAPPY DAY
|
ユーザー |
|
提出日時 | 2025-01-16 02:16:00 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 868 bytes |
コンパイル時間 | 21,240 ms |
コンパイル使用メモリ | 386,936 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-01-16 02:16:54 |
合計ジャッジ時間 | 13,159 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 1 |
ソースコード
#![allow(unused_imports)] #![allow(non_snake_case)] use proconio::input; use proconio::marker::*; use std::cmp::*; use std::collections::*; fn main() { let month = 12; let day1 = 9; let day2 = 3; let ans = solve(month, day1, day2); println!("{}", ans) } fn solve(M: usize, D1: usize, D2: usize) -> usize { let mut count = 0; for i in 1..=M { for j in 0..=D2 { if i == 2 && j > 2 { continue; } for k in 0..=D1 { if k > 0 { if j == 3 { if i == 4 && i == 6 && i == 9 && i == 11 { continue; } else { if k == 1 { continue; } } } else if j == 2 { if i == 2 { if k > 8 { continue; } } } } if j + k == i { count += 1; } } } } count }