結果

問題 No.376 立方体のN等分 (2)
ユーザー uafr_csuafr_cs
提出日時 2017-11-06 21:04:58
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 622 bytes
コンパイル時間 2,446 ms
コンパイル使用メモリ 76,804 KB
実行使用メモリ 57,684 KB
最終ジャッジ日時 2023-08-15 19:39:49
合計ジャッジ時間 43,719 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 152 ms
56,892 KB
testcase_01 AC 153 ms
56,740 KB
testcase_02 AC 553 ms
56,964 KB
testcase_03 AC 998 ms
56,860 KB
testcase_04 AC 723 ms
56,912 KB
testcase_05 AC 149 ms
56,904 KB
testcase_06 AC 149 ms
56,828 KB
testcase_07 AC 150 ms
56,936 KB
testcase_08 AC 166 ms
56,732 KB
testcase_09 AC 195 ms
56,864 KB
testcase_10 AC 855 ms
56,816 KB
testcase_11 AC 295 ms
56,492 KB
testcase_12 AC 493 ms
56,904 KB
testcase_13 AC 285 ms
56,732 KB
testcase_14 AC 323 ms
56,736 KB
testcase_15 AC 250 ms
56,880 KB
testcase_16 AC 4,573 ms
56,920 KB
testcase_17 AC 488 ms
56,732 KB
testcase_18 AC 267 ms
56,864 KB
testcase_19 AC 825 ms
56,912 KB
testcase_20 AC 300 ms
56,484 KB
testcase_21 TLE -
testcase_22 AC 278 ms
56,828 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 275 ms
56,668 KB
testcase_26 TLE -
testcase_27 AC 356 ms
56,912 KB
testcase_28 AC 273 ms
56,716 KB
testcase_29 AC 475 ms
56,684 KB
testcase_30 AC 365 ms
56,740 KB
testcase_31 AC 272 ms
56,804 KB
testcase_32 AC 360 ms
56,752 KB
testcase_33 AC 272 ms
56,652 KB
testcase_34 AC 274 ms
56,788 KB
testcase_35 AC 416 ms
57,020 KB
testcase_36 AC 273 ms
57,080 KB
testcase_37 AC 271 ms
56,848 KB
testcase_38 AC 432 ms
56,488 KB
testcase_39 AC 471 ms
57,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static long MOD = 1000000007;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final long N = sc.nextLong();
		
		long max = N - 1, min = N - 1;
		for(long i = 1; i * i * i <= N; i++){
			if(N % i != 0){ continue; }
			
			final long new_N = (N / i);
			for(long j = i; j * j <= new_N; j++){
				if(new_N % j != 0){ continue; }
				final long k = new_N / j;
				
				min = Math.min(min, (i - 1) + (j - 1) + (k - 1));
			}
		}
		
		System.out.println(min + " " + max);
	}
}
0