結果

問題 No.375 立方体のN等分 (1)
ユーザー TosukeTosuke
提出日時 2016-06-10 01:11:12
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 459 bytes
コンパイル時間 1,621 ms
コンパイル使用メモリ 145,816 KB
実行使用メモリ 8,740 KB
最終ジャッジ日時 2023-09-02 21:14:27
合計ジャッジ時間 8,867 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,740 KB
testcase_01 AC 1 ms
4,372 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,368 KB
testcase_04 AC 1 ms
4,368 KB
testcase_05 AC 1 ms
4,372 KB
testcase_06 AC 26 ms
4,368 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm;
import std.stdio;
import std.conv;
import std.string;

void main(){
	auto n = readln.strip.to!ulong;
	auto max = n - 1;
	
	auto r = (a){
		import std.container;
		SList!ulong v;
		auto i = 2;
		while(a != 1){
			while(a % i == 0){
				v.insertFront(i);
				a /= i;
			}
			i++;
		}
		return v;
	}(n);
	ulong[] v = [1, 1, 1];
	foreach(a; r[]){
		v[v.minCount[1] - 1] *= a;
	}
	auto min = v.map!("a-1").sum;
	
	writef("%d %d", min, max);
}
0