結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー ほっしいーほっしいー
提出日時 2018-02-11 00:59:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 522 bytes
コンパイル時間 4,414 ms
コンパイル使用メモリ 73,324 KB
実行使用メモリ 56,296 KB
最終ジャッジ日時 2023-09-11 04:28:25
合計ジャッジ時間 8,695 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,876 KB
testcase_01 AC 123 ms
55,412 KB
testcase_02 AC 122 ms
55,632 KB
testcase_03 AC 121 ms
55,624 KB
testcase_04 AC 120 ms
55,584 KB
testcase_05 AC 122 ms
55,748 KB
testcase_06 AC 124 ms
55,808 KB
testcase_07 AC 122 ms
55,764 KB
testcase_08 AC 121 ms
55,540 KB
testcase_09 AC 124 ms
55,824 KB
testcase_10 AC 121 ms
55,524 KB
testcase_11 AC 121 ms
55,708 KB
testcase_12 AC 118 ms
55,576 KB
testcase_13 AC 123 ms
55,884 KB
testcase_14 AC 121 ms
55,828 KB
testcase_15 AC 120 ms
56,296 KB
testcase_16 AC 123 ms
55,988 KB
testcase_17 AC 121 ms
56,188 KB
testcase_18 AC 122 ms
55,660 KB
testcase_19 AC 122 ms
55,516 KB
testcase_20 AC 122 ms
55,824 KB
testcase_21 AC 121 ms
55,536 KB
testcase_22 AC 123 ms
55,452 KB
testcase_23 AC 122 ms
55,412 KB
testcase_24 AC 120 ms
55,612 KB
testcase_25 AC 121 ms
55,572 KB
testcase_26 AC 120 ms
55,748 KB
testcase_27 AC 121 ms
55,984 KB
testcase_28 AC 121 ms
55,384 KB
testcase_29 AC 121 ms
55,816 KB
testcase_30 AC 121 ms
55,564 KB
testcase_31 AC 120 ms
53,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No637 {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[]a=new int[5];
		for(int i=0;i<5;i++) 
			a[i]=Integer.parseInt(sc.next());
		System.out.println(getNum(a));

	}
	
	public static int getNum(int[] a) {
		int x=0;
		for(int i=0;i<5;i++) 
			if((a[i]%3==0)&&(a[i]%5==0))
				x=x+8;
			else if(a[i]%3==0) 
				x=x+4;
			else if(a[i]%5==0)
				x=x+4;
			else {
				String b=Integer.toString(a[i]);
				x=x+b.length();
			}
		return x;
		}

}
0