結果
問題 | No.312 置換処理 |
ユーザー |
![]() |
提出日時 | 2016-01-09 10:30:23 |
言語 | Java (openjdk 23) |
結果 |
TLE
|
実行時間 | - |
コード長 | 529 bytes |
コンパイル時間 | 2,188 ms |
コンパイル使用メモリ | 74,648 KB |
実行使用メモリ | 44,332 KB |
最終ジャッジ日時 | 2024-09-19 13:13:25 |
合計ジャッジ時間 | 5,870 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 TLE * 1 -- * 43 |
ソースコード
import java.io.*; import java.util.*; class Main { public static void out (Object o) { System.out.println(o); } public static long solve (long n) { long k = n; while (k % 2 == 0) k /= 2; if (k == 1) return 4; for (int i = 3; i * i <= n; i += 2) { if (n % i == 0) return i; } return n; } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long n = Long.parseLong(br.readLine()); out(solve(n)); } }