結果
| 問題 | No.637 X: Yet Another FizzBuzz Problem |
| コンテスト | |
| ユーザー |
tenten
|
| 提出日時 | 2020-11-12 09:18:14 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 76 ms / 1,000 ms |
| コード長 | 718 bytes |
| 記録 | |
| コンパイル時間 | 1,516 ms |
| コンパイル使用メモリ | 81,980 KB |
| 実行使用メモリ | 42,104 KB |
| 最終ジャッジ日時 | 2026-04-03 10:30:56 |
| 合計ジャッジ時間 | 4,495 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int count = 0;
for (int i = 0; i < 5; i++) {
int x = sc.nextInt();
if (x % 3 == 0 && x % 5 == 0) {
count += 8;
} else if (x % 3 == 0) {
count += 4;
} else if (x % 5 == 0) {
count += 4;
} else {
count += getCount(x);
}
}
System.out.println(count);
}
static int getCount(int x) {
int count = 0;
while (x > 0) {
count++;
x /= 10;
}
return count;
}
}
tenten