Submission #2559273


Source Code Expand

import java.util.*;

class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int ans = 1;
        int j;
        double num;

        if(x >= 4){
            for(int i=1; i*i <= x; i++)
            {
                j=2;
                do{
                    num = Math.pow(i, j);
                    if(num > ans){
                        ans = (int)num;
                    }
                    j++;
                }while(num <= x);
            }
        }
        System.out.println(ans);
    }
}

Submission Info

Submission Time
Task B - Exponential
User tonq
Language Java8 (OpenJDK 1.8.0)
Score 0
Code Size 619 Byte
Status TLE
Exec Time 2108 ms
Memory 21844 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 1
TLE × 2
AC × 1
TLE × 8
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 TLE 2108 ms 19284 KB
0_001.txt AC 93 ms 19284 KB
0_002.txt TLE 2108 ms 21076 KB
1_003.txt TLE 2108 ms 20692 KB
1_004.txt TLE 2108 ms 20948 KB
1_005.txt TLE 2105 ms 19540 KB
1_006.txt TLE 2108 ms 21076 KB
1_007.txt TLE 2108 ms 18900 KB
1_008.txt TLE 2108 ms 21844 KB