結果
問題 |
No.637 X: Yet Another FizzBuzz Problem
|
ユーザー |
|
提出日時 | 2018-02-12 12:17:42 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 128 ms / 1,000 ms |
コード長 | 737 bytes |
コンパイル時間 | 3,031 ms |
コンパイル使用メモリ | 75,348 KB |
実行使用メモリ | 41,564 KB |
最終ジャッジ日時 | 2024-06-28 18:57:09 |
合計ジャッジ時間 | 7,549 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
import java.io.*; import java.util.*; public class Main_yukicoder637 { private static Scanner sc; private static Printer pr; private static void solve() { int ans = 0; for (int i = 0; i < 5; i++) { int a = sc.nextInt(); if (a % 3 == 0 && a % 5 == 0) { ans += 8; } else if (a % 3 == 0 || a % 5 == 0) { ans += 4; } else { ans += Integer.toString(a).length(); } } pr.println(ans); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }