結果
| 問題 | No.188 HAPPY DAY | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-04-24 00:27:45 | 
| 言語 | Rust (1.83.0 + proconio) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 1,000 ms | 
| コード長 | 479 bytes | 
| コンパイル時間 | 11,605 ms | 
| コンパイル使用メモリ | 378,668 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-11 23:41:33 | 
| 合計ジャッジ時間 | 12,247 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 1 | 
ソースコード
const CALENDAR: [i32; 13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
fn is_happyday(m: i32, d: i32) -> bool {
    return m == d.to_string().chars().map(|x| x.to_digit(10).unwrap() as i32).sum();
}
fn main(){
    let mut total = 0;
    for (m, d) in CALENDAR.iter().enumerate() {
        if m == 0 { continue; }
        for i in 1..*d {
            if is_happyday(m as i32, i) {
                total += 1;
            }
        }
    }
    println!("{}", total);
}
            
            
            
        