結果
問題 |
No.637 X: Yet Another FizzBuzz Problem
|
ユーザー |
|
提出日時 | 2021-03-21 22:38:51 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 59 ms / 1,000 ms |
コード長 | 584 bytes |
コンパイル時間 | 3,438 ms |
コンパイル使用メモリ | 74,428 KB |
実行使用メモリ | 50,612 KB |
最終ジャッジ日時 | 2024-11-22 17:40:59 |
合計ジャッジ時間 | 6,117 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No00000637_Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { String[] a = br.readLine().split(" "); int c = 0; for(int i = 0; i < a.length; i++) { int j = Integer.parseInt(a[i]); if(j % 3 == 0 && j % 5 == 0) { c += 8; } else if(!(j % 3 != 0 && j % 5 != 0)) { c += 4; } else { c += String.valueOf(j).length(); } } System.out.println(c); } }