結果

問題 No.312 置換処理
ユーザー _k_a_n_i_
提出日時 2015-12-06 20:07:04
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 326 bytes
コンパイル時間 2,033 ms
コンパイル使用メモリ 73,996 KB
実行使用メモリ 54,492 KB
最終ジャッジ日時 2024-09-14 16:01:36
合計ジャッジ時間 9,295 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main
{
  public static void main(String... args)
  {
    System.out.println(calc(new Scanner(System.in).nextLong()));
  }
  
  private static long calc(long n)
  {
    for(int i=3; i<(int) Math.sqrt(n); ++i)
    {
      if(n%i == 0)
      {
        return i;
      }
    }
    return n;
  }
}
0