結果
問題 | No.305 鍵(2) |
ユーザー |
![]() |
提出日時 | 2022-11-08 03:32:10 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 42 ms / 2,000 ms |
コード長 | 1,043 bytes |
コンパイル時間 | 12,330 ms |
コンパイル使用メモリ | 401,780 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 86.69 |
最終ジャッジ日時 | 2024-07-17 03:13:51 |
合計ジャッジ時間 | 13,906 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
warning: unused variable: `y` --> src/main.rs:24:21 | 24 | let (x, y): (i32, String) = { | ^ help: if this is intentional, prefix it with an underscore: `_y` | = note: `#[warn(unused_variables)]` on by default
ソースコード
fn main() {let mut ans=vec![0;10];let mut flag=0;for i in 0..10{let mut maxj=-1;let mut indj=-1;for j in 0..10{ans[i]=j;println!("{}",ans.iter().map(std::string::ToString::to_string).collect::<Vec<_>>().join(""));let (x, y): (i32, String) = {let mut line: String = String::new();std::io::stdin().read_line(&mut line).unwrap();let mut iter = line.split_whitespace();(iter.next().unwrap().parse().unwrap(),iter.next().unwrap().parse().unwrap(),)};if x==10{flag=1;break;}if x>maxj{maxj=x;indj=j;}}if flag==1{break;}ans[i]=indj;}}