2023-12-22 bouzuya/firestore-path 0.5.0 をつくった / ABC332 C
bouzuya/firestore-path 0.5.0 をつくった。
- DatabaseNameの format を- projects/{project_id}/databases/{database_id}/documentsから- projects/{project_id}/databases/{database_id}に変更 (破壊的変更)
- RootDocumentNameを追加 (format は- projects/{project_id}/databases/{database_id}/documents)
ABC332 : AtCoder Beginner Contest 332
- C - T-shirts
https://atcoder.jp/contests/abc332/tasks/abc332_c- 提出: https://atcoder.jp/contests/abc332/submissions/48714321
- 素直にシミュレートする
- 使えるときは無地の T シャツを使う、そうでないときはロゴ入りの T シャツを使う
- 使った T シャツの最大枚数が答えになる
 
use proconio::{input, marker::Chars};
fn main() {
    input! {
        _n: usize,
        m: usize,
        s: Chars,
    };
    let mut ans = 0_usize;
    let mut used_m = 0_usize;
    let mut used_t = 0_usize;
    for s_i in s {
        match s_i {
            '0' => {
                used_m = 0;
                used_t = 0;
            }
            '1' => {
                if used_m < m {
                    used_m += 1;
                } else {
                    used_t += 1;
                }
            }
            '2' => {
                used_t += 1;
            }
            _ => unreachable!(),
        }
        ans = ans.max(used_t);
    }
    println!("{}", ans);
}
今日のコミット。
- rust-atcoder 1 commit
- firestore-path 16 commits- 0.5.0
- Add CollectionName::root_document_name
- Add DocumentName::root_document_name
- Add example for BeginTransactionRequest
- Add tests for 0.5.0
- Update anyhow
- Refactor RootDocumentName methods
- Fix RootDocumentName doc
- Add RootDocumentName support to DocumentName::new
- Add RootDocumentName support to CollectionName::new
- BREAKING CHANGE: Change DocumentName format
- Use RootDocumentName in DocumentName
- Use RootDocumentName in CollectionName
- Add RootDocumentName
- Add example for DeleteDocumentRequest
- Add example for CreateDocumentRequest