結果
問題 |
No.375 立方体のN等分 (1)
|
ユーザー |
|
提出日時 | 2016-06-10 01:11:12 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 459 bytes |
コンパイル時間 | 1,877 ms |
コンパイル使用メモリ | 145,664 KB |
実行使用メモリ | 7,424 KB |
最終ジャッジ日時 | 2024-06-12 03:32:30 |
合計ジャッジ時間 | 8,345 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 4 WA * 3 TLE * 1 -- * 24 |
ソースコード
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); }