結果
| 問題 | No.312 置換処理 |
| コンテスト | |
| ユーザー |
kokatsu
|
| 提出日時 | 2021-12-21 20:52:14 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 372 bytes |
| 記録 | |
| コンパイル時間 | 1,815 ms |
| コンパイル使用メモリ | 187,680 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2026-03-06 19:08:19 |
| 合計ジャッジ時間 | 3,107 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 45 |
コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/core/checkedint.d(814): Warning: cannot inline function `core.checkedint.mulu!().mulu`
ulong mulu()(ulong x, uint y, ref bool overflow)
^
ソースコード
import std;
void main() {
long N;
readf("%d\n", N);
long S = N.to!real.sqrt.floor.to!long;
long res = N;
foreach (i; 2 .. S+1) {
if (N % i == 0) {
if (i > 2) {
res = min(res, i);
}
if (N / i > 2) {
res = min(res, N/i);
}
}
}
res.writeln;
}
kokatsu