結果

問題 No.376 立方体のN等分 (2)
ユーザー uafr_csuafr_cs
提出日時 2017-11-06 21:04:58
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 622 bytes
コンパイル時間 4,138 ms
コンパイル使用メモリ 87,676 KB
実行使用メモリ 44,228 KB
最終ジャッジ日時 2024-05-03 06:24:49
合計ジャッジ時間 44,933 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 162 ms
42,416 KB
testcase_01 AC 154 ms
42,440 KB
testcase_02 AC 578 ms
42,116 KB
testcase_03 AC 1,081 ms
42,380 KB
testcase_04 AC 768 ms
42,456 KB
testcase_05 AC 147 ms
41,852 KB
testcase_06 AC 161 ms
42,244 KB
testcase_07 AC 152 ms
41,940 KB
testcase_08 AC 179 ms
42,536 KB
testcase_09 AC 210 ms
42,224 KB
testcase_10 AC 909 ms
42,216 KB
testcase_11 AC 304 ms
42,252 KB
testcase_12 AC 507 ms
42,440 KB
testcase_13 AC 297 ms
42,236 KB
testcase_14 AC 330 ms
42,624 KB
testcase_15 AC 260 ms
42,340 KB
testcase_16 AC 4,782 ms
42,068 KB
testcase_17 AC 509 ms
42,312 KB
testcase_18 AC 273 ms
42,344 KB
testcase_19 AC 866 ms
42,256 KB
testcase_20 AC 305 ms
41,992 KB
testcase_21 TLE -
testcase_22 AC 287 ms
42,508 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 283 ms
42,592 KB
testcase_26 TLE -
testcase_27 AC 344 ms
42,484 KB
testcase_28 AC 279 ms
42,340 KB
testcase_29 AC 488 ms
42,624 KB
testcase_30 AC 363 ms
41,852 KB
testcase_31 AC 284 ms
42,568 KB
testcase_32 AC 360 ms
42,508 KB
testcase_33 AC 283 ms
42,268 KB
testcase_34 AC 285 ms
42,340 KB
testcase_35 AC 428 ms
42,508 KB
testcase_36 AC 278 ms
42,400 KB
testcase_37 AC 278 ms
42,384 KB
testcase_38 AC 431 ms
42,056 KB
testcase_39 AC 494 ms
42,508 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