結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー kokatsu
提出日時 2022-07-24 22:38:21
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 392 bytes
コンパイル時間 2,031 ms
コンパイル使用メモリ 173,608 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-22 15:53:01
合計ジャッジ時間 3,232 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    auto a = readln.chomp.split.to!(int[]);

    int res;
    foreach (x; a) {
        int num;

        if (x % 3 == 0) num += 4;
        if (x % 5 == 0) num += 4;

        if (num == 0) {
            int rem = x;
            while (rem > 0) {
                rem /= 10;
                ++num;
            }
        }

        res += num;
    }

    res.writeln;
}
0