結果

問題 No.1119 Division 3
ユーザー yukiyuki
提出日時 2020-08-18 09:06:31
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 828 bytes
コンパイル時間 2,266 ms
コンパイル使用メモリ 74,924 KB
実行使用メモリ 41,516 KB
最終ジャッジ日時 2024-10-11 22:41:13
合計ジャッジ時間 5,305 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        final int input = 3;
        Scanner in = new Scanner(System.in);
        int result = 0;
        List<Integer> list = new ArrayList<>();

        for(int i=0; i<input; i++){
            int N = in.nextInt();
            final int S = 10*10*10*10*10*10*10*10*10;
            if(1 > N || N > S){
                System.out.println("No");
                return;
            }    
            
            list.add(N);
        }

        result = list.get(0)*list.get(1)*list.get(2);
        System.out.println( isPrime(result) );
        
    }
    
    public static String isPrime(int result){
        if(result % 3 == 0){
            return "Yes";
        }else{
            return "No";
        }
    }

    
}



0