結果

問題 No.312 置換処理
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-10 01:21:45
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 3,929 ms
コンパイル使用メモリ 74,816 KB
実行使用メモリ 52,120 KB
最終ジャッジ日時 2024-04-17 15:15:40
合計ジャッジ時間 5,896 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
50,148 KB
testcase_01 AC 53 ms
50,452 KB
testcase_02 AC 58 ms
50,956 KB
testcase_03 AC 57 ms
50,956 KB
testcase_04 AC 48 ms
50,264 KB
testcase_05 AC 45 ms
50,380 KB
testcase_06 AC 48 ms
50,016 KB
testcase_07 AC 49 ms
50,376 KB
testcase_08 AC 44 ms
50,008 KB
testcase_09 AC 44 ms
49,812 KB
testcase_10 AC 44 ms
50,040 KB
testcase_11 AC 48 ms
50,264 KB
testcase_12 AC 45 ms
50,232 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 44 ms
50,376 KB
testcase_23 AC 45 ms
50,272 KB
testcase_24 AC 44 ms
49,904 KB
testcase_25 AC 44 ms
50,188 KB
testcase_26 AC 44 ms
49,920 KB
testcase_27 WA -
testcase_28 AC 46 ms
49,924 KB
testcase_29 AC 46 ms
50,260 KB
testcase_30 AC 46 ms
50,256 KB
testcase_31 WA -
testcase_32 AC 45 ms
50,252 KB
testcase_33 AC 48 ms
50,040 KB
testcase_34 AC 48 ms
50,304 KB
testcase_35 AC 43 ms
49,972 KB
testcase_36 AC 43 ms
50,236 KB
testcase_37 AC 44 ms
50,392 KB
testcase_38 WA -
testcase_39 AC 43 ms
50,316 KB
testcase_40 AC 43 ms
50,012 KB
testcase_41 AC 44 ms
50,240 KB
testcase_42 AC 43 ms
50,040 KB
testcase_43 AC 43 ms
50,016 KB
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

public class Exercise75{
  public static void main (String[] args) throws IOException{

    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String nStr = new String(in.readLine());

    long nd = Long.parseLong(nStr);
    long n = nd;

    while(n % 2 == 0){
      n /= 2;
    }

    if(n == 1){
      System.out.println(nd);
      return;
    }

    for (long i = 3; i * i <= n; i += 2){
      if(n % i == 0){
        System.out.println(i);
        return;
      }
    }

    System.out.println(n);
  }
}
0