結果
| 問題 |
No.637 X: Yet Another FizzBuzz Problem
|
| コンテスト | |
| ユーザー |
YamaKasa
|
| 提出日時 | 2018-05-08 22:02:23 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 135 ms / 1,000 ms |
| コード長 | 418 bytes |
| コンパイル時間 | 2,121 ms |
| コンパイル使用メモリ | 74,092 KB |
| 実行使用メモリ | 41,464 KB |
| 最終ジャッジ日時 | 2024-06-28 19:04:40 |
| 合計ジャッジ時間 | 6,989 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int cnt = 0;
for(int i = 0; i < 5; i++) {
int t = scan.nextInt();
if(t % 15 == 0) {
cnt += 8;
}else if(t % 3 == 0 || t % 5 == 0) {
cnt += 4;
}else {
String s = Integer.toString(t);
cnt += s.length();
}
}
scan.close();
System.out.println(cnt);
}
}
YamaKasa