結果

問題 No.1943 消えたAGCT(1)
ユーザー atcoder8
提出日時 2022-09-09 00:16:57
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 26,044 ms
コンパイル使用メモリ 394,928 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-24 21:49:05
合計ジャッジ時間 17,029 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    println!("{}", solve());
}

fn solve() -> usize {
    let n = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().parse::<usize>().unwrap()
    };
    let cc: Vec<char> = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().chars().collect()
    };

    for i in (0..n).rev() {
        if ['A', 'G', 'C', 'T'].contains(&cc[i]) {
            return i + 1;
        }
    }

    0
}
0