結果
| 問題 | No.1943 消えたAGCT(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-27 10:47:44 |
| 言語 | Rust (1.97.1 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 4 ms / 2,000 ms |
| + 460µs | |
| コード長 | 485 bytes |
| 記録 | |
| コンパイル時間 | 4,098 ms |
| コンパイル使用メモリ | 193,004 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-09-26 01:17:30 |
| 合計ジャッジ時間 | 4,369 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
コンパイルメッセージ
warning: unused `Result` that must be used --> src/main.rs:5:5 | 5 | io::stdin().read_line(&mut nn); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default help: use `let _ = ...` to ignore the resulting value | 5 | let _ = io::stdin().read_line(&mut nn); | +++++++ warning: unused `Result` that must be used --> src/main.rs:11:5 | 11 | io::stdin().read_line(&mut ss); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled help: use `let _ = ...` to ignore the resulting value | 11 | let _ = io::stdin().read_line(&mut ss); | +++++++
ソースコード
use std::io;
fn main() {
let mut nn = String::new();
io::stdin().read_line(&mut nn);
let n = match nn.trim().parse() {
Ok(num) => num,
Err(_) => 0
};
let mut ss = String::new();
io::stdin().read_line(&mut ss);
let s: Vec<char> = ss.chars().collect();
let mut ans = 0;
for i in 0..n {
let c = s[i];
if c == 'A' || c == 'G' || c == 'C' || c == 'T' {
ans = i + 1;
}
}
println!("{}", ans);
}