Submission #51424768
Source Code Expand
use proconio::input; fn f(ans: &mut Vec<char>, n: usize) { if n == 0 { return; } if n > 1 && n % 2 == 0 { ans.push('B'); f(ans, n / 2); } else { ans.push('A'); f(ans, n - 1); } } fn main() { input! { n: usize, } let mut ans = vec![]; f(&mut ans, n); println!("{}", ans.into_iter().rev().collect::<String>()); }
Submission Info
Submission Time | |
---|---|
Task | E - Many Balls |
User | bouzuya |
Language | Rust (rustc 1.70.0) |
Score | 300 |
Code Size | 401 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 2036 KiB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, example0.txt, example1.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 1 ms | 1884 KiB |
001.txt | AC | 0 ms | 1828 KiB |
002.txt | AC | 0 ms | 1820 KiB |
003.txt | AC | 0 ms | 1892 KiB |
004.txt | AC | 1 ms | 1892 KiB |
005.txt | AC | 1 ms | 2036 KiB |
006.txt | AC | 1 ms | 1876 KiB |
007.txt | AC | 1 ms | 1872 KiB |
008.txt | AC | 0 ms | 1936 KiB |
009.txt | AC | 1 ms | 1928 KiB |
010.txt | AC | 1 ms | 1760 KiB |
011.txt | AC | 1 ms | 1828 KiB |
012.txt | AC | 1 ms | 1892 KiB |
013.txt | AC | 1 ms | 1764 KiB |
014.txt | AC | 1 ms | 1824 KiB |
015.txt | AC | 1 ms | 1824 KiB |
016.txt | AC | 0 ms | 1876 KiB |
017.txt | AC | 1 ms | 1884 KiB |
example0.txt | AC | 1 ms | 1892 KiB |
example1.txt | AC | 1 ms | 1888 KiB |