結果
| 問題 |
No.2269 eN!の整数部分の下1桁
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-04-15 11:32:45 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 946 bytes |
| コンパイル時間 | 12,829 ms |
| コンパイル使用メモリ | 379,400 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-10 23:42:12 |
| 合計ジャッジ時間 | 15,136 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 11 |
ソースコード
fn solve(scanner: &mut Scanner) {
let n: usize = scanner.next();
let ans = [2, 5, 6, 5, 6, 7, 0, 1, 0, 1][(n - 1) % 10];
println!("{}", ans);
}
fn main() {
let mut scanner = Scanner::new();
let t: usize = scanner.next();
for _ in 0..t {
solve(&mut scanner);
}
}
struct Scanner {
buf: Vec<String>,
}
impl Scanner {
fn new() -> Self {
Self { buf: vec![] }
}
fn next<T: std::str::FromStr>(&mut self) -> T {
loop {
if let Some(x) = self.buf.pop() {
return x.parse().ok().expect("");
}
let mut source = String::new();
std::io::stdin().read_line(&mut source).expect("");
self.buf = Self::split(source);
}
}
fn split(source: String) -> Vec<String> {
source
.split_whitespace()
.rev()
.map(String::from)
.collect::<Vec<_>>()
}
}