結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー ilplrr
提出日時 2018-02-18 15:58:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 422 bytes
コンパイル時間 432 ms
コンパイル使用メモリ 56,792 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 18:58:25
合計ジャッジ時間 1,373 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
    int a[5];
    for (auto& x : a) cin >> x;

    int ans = 0;
    for (auto& x : a) {
        if (!(x % 3)) ans += 4;
        if (!(x % 5)) ans += 4;
        if (x % 3 and x % 5) {
            while (x) {
                ans++;
                x /= 10;
            }
        }
    }

    cout << ans << endl;

    return 0;
}
0