Submission #49145049
Source Code Expand
// -*- coding:utf-8-unix -*-
use proconio::input;
fn is_palindromic_number(n: usize) -> bool {
let s = n.to_string();
let r = s.chars().rev().collect::<String>();
s == r
}
fn main() {
input! {
a: usize,
b: usize,
}
let count = (a..=b).filter(|&n| is_palindromic_number(n)).count();
println!("{}", count);
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Palindromic Numbers |
| User | homura10059 |
| Language | Rust (rustc 1.70.0) |
| Score | 200 |
| Code Size | 372 Byte |
| Status | AC |
| Exec Time | 5 ms |
| Memory | 1968 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | s1.txt, s2.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, s1.txt, s2.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 5 ms | 1864 KiB |
| 02.txt | AC | 5 ms | 1928 KiB |
| 03.txt | AC | 5 ms | 1880 KiB |
| 04.txt | AC | 3 ms | 1880 KiB |
| 05.txt | AC | 2 ms | 1936 KiB |
| 06.txt | AC | 2 ms | 1872 KiB |
| 07.txt | AC | 5 ms | 1900 KiB |
| 08.txt | AC | 1 ms | 1968 KiB |
| s1.txt | AC | 1 ms | 1916 KiB |
| s2.txt | AC | 3 ms | 1896 KiB |