Submission #49182518
Source Code Expand
// -*- coding:utf-8-unix -*-
use proconio::input;
fn main() {
input! {
n: usize,
}
let lucas_numbers = (2..=n).fold(vec![2_u64, 1_u64], |mut acc, _| {
let len = acc.len();
acc.push(acc[len - 1] + acc[len - 2]);
acc
});
let result = lucas_numbers.last().unwrap();
println!("{}", result);
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Lucas Number |
| User | homura10059 |
| Language | Rust (rustc 1.70.0) |
| Score | 200 |
| Code Size | 367 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 2004 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 1 ms | 2004 KiB |
| 02.txt | AC | 1 ms | 1988 KiB |
| 03.txt | AC | 1 ms | 1916 KiB |
| 04.txt | AC | 1 ms | 2004 KiB |
| 05.txt | AC | 1 ms | 2000 KiB |
| 06.txt | AC | 1 ms | 1996 KiB |
| 07.txt | AC | 1 ms | 1936 KiB |
| 08.txt | AC | 1 ms | 1940 KiB |
| 09.txt | AC | 1 ms | 1936 KiB |
| 10.txt | AC | 1 ms | 1972 KiB |
| 11.txt | AC | 1 ms | 1976 KiB |
| 12.txt | AC | 0 ms | 1972 KiB |
| 13.txt | AC | 1 ms | 1992 KiB |
| 14.txt | AC | 0 ms | 1912 KiB |
| sample_01.txt | AC | 0 ms | 1912 KiB |
| sample_02.txt | AC | 0 ms | 1992 KiB |