Submission #33728143


Source Code Expand

use proconio::input;

fn main() {
    input! {
        x: usize,
    };
    if x == 1 {
        println!("1");
        return;
    }

    let mut max = 0_usize;
    for b in 2_usize..=x {
        let mut ok = false;
        for p in 2.. {
            match b.checked_pow(p as u32) {
                Some(a) => {
                    if a > x {
                        break;
                    } else {
                        ok = true;
                        max = max.max(a);
                    }
                }
                None => break,
            }
        }
        if !ok {
            break;
        }
    }
    let ans = max;
    println!("{}", ans);
}

Submission Info

Submission Time
Task B - Exponential
User bouzuya
Language Rust (1.42.0)
Score 200
Code Size 673 Byte
Status AC
Exec Time 5 ms
Memory 2100 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 9
Set Name Test Cases
Sample 0_000.txt, 0_001.txt, 0_002.txt
All 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt
Case Name Status Exec Time Memory
0_000.txt AC 5 ms 1980 KiB
0_001.txt AC 2 ms 1976 KiB
0_002.txt AC 1 ms 2100 KiB
1_003.txt AC 1 ms 2056 KiB
1_004.txt AC 2 ms 1976 KiB
1_005.txt AC 2 ms 1948 KiB
1_006.txt AC 2 ms 1976 KiB
1_007.txt AC 2 ms 1984 KiB
1_008.txt AC 1 ms 2072 KiB