結果

問題 No.24 数当てゲーム
コンテスト
ユーザー ixTL255
提出日時 2023-01-01 15:33:54
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 5,000 ms
+ 897µs
コード長 825 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,358 ms
コンパイル使用メモリ 187,128 KB
実行使用メモリ 9,856 KB
最終ジャッジ日時 2026-09-30 14:00:26
合計ジャッジ時間 4,010 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io;
fn main() {
	let mut s = String::new();
	io::stdin().read_line(&mut s).ok();
	let n: usize = s.trim().parse().unwrap();
	let mut v = [true; 10];
	for _ in 0..n {
		let mut itr = String::new();
		io::stdin().read_line(&mut itr).ok();
		let mut itr = itr.trim().split_whitespace();
		let a: usize = itr.next().unwrap().parse().unwrap();
		let b: usize = itr.next().unwrap().parse().unwrap();
		let c: usize = itr.next().unwrap().parse().unwrap();
		let d: usize = itr.next().unwrap().parse().unwrap();
		let s: &str = itr.next().unwrap();
		
		if s == "NO" {
			v[a] = false;
			v[b] = false;
			v[c] = false;
			v[d] = false;
		} else {
			for i in 0..10 {
				if !(i == a || i == b || i == c || i == d) {
					v[i] = false;
				}
			}
		}
	}
	for i in 0..10 {
		if v[i] {
			println!("{}", i);
			break;
		}
	}
}
0