結果

問題 No.312 置換処理
ユーザー tentententen
提出日時 2022-07-30 09:57:55
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,083 bytes
コンパイル時間 1,801 ms
コンパイル使用メモリ 72,448 KB
実行使用メモリ 51,128 KB
最終ジャッジ日時 2023-09-27 11:28:43
合計ジャッジ時間 5,483 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
49,316 KB
testcase_01 WA -
testcase_02 AC 62 ms
50,956 KB
testcase_03 WA -
testcase_04 AC 40 ms
49,204 KB
testcase_05 AC 41 ms
49,376 KB
testcase_06 AC 42 ms
49,364 KB
testcase_07 AC 47 ms
50,760 KB
testcase_08 AC 39 ms
49,484 KB
testcase_09 AC 40 ms
49,160 KB
testcase_10 AC 40 ms
47,852 KB
testcase_11 AC 43 ms
47,780 KB
testcase_12 AC 40 ms
49,192 KB
testcase_13 AC 40 ms
49,196 KB
testcase_14 AC 42 ms
49,448 KB
testcase_15 AC 40 ms
49,320 KB
testcase_16 AC 41 ms
49,372 KB
testcase_17 AC 40 ms
49,356 KB
testcase_18 AC 41 ms
49,436 KB
testcase_19 AC 39 ms
49,340 KB
testcase_20 AC 40 ms
49,268 KB
testcase_21 AC 40 ms
49,552 KB
testcase_22 AC 39 ms
49,380 KB
testcase_23 AC 42 ms
49,260 KB
testcase_24 AC 43 ms
49,556 KB
testcase_25 WA -
testcase_26 AC 41 ms
49,592 KB
testcase_27 WA -
testcase_28 AC 39 ms
49,544 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 40 ms
49,328 KB
testcase_32 AC 44 ms
49,276 KB
testcase_33 AC 51 ms
50,808 KB
testcase_34 AC 50 ms
51,080 KB
testcase_35 AC 40 ms
49,268 KB
testcase_36 AC 40 ms
49,348 KB
testcase_37 AC 40 ms
49,204 KB
testcase_38 AC 40 ms
49,340 KB
testcase_39 AC 41 ms
49,344 KB
testcase_40 AC 41 ms
49,448 KB
testcase_41 AC 40 ms
49,272 KB
testcase_42 AC 40 ms
49,272 KB
testcase_43 AC 39 ms
49,264 KB
testcase_44 AC 41 ms
49,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        long n = sc.nextLong();
        for (int i = 3; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                System.out.println(i);
                return;
            }
        }
        System.out.println(n);
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0