結果
| 問題 | No.637 X: Yet Another FizzBuzz Problem | 
| コンテスト | |
| ユーザー |  41Toame | 
| 提出日時 | 2018-02-22 19:30:01 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 735 bytes | 
| コンパイル時間 | 1,072 ms | 
| コンパイル使用メモリ | 158,156 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-28 18:58:52 | 
| 合計ジャッジ時間 | 1,856 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 30 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
int mojicnt(int a) {
    int cnt = 0;
    while(a > 0) {
        a /= 10;
        cnt++;
    }
    return cnt;
}
int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a[5];
    rep(i, 5) cin >> a[i];
    int ans = 0;
    rep(i, 5) {
        if (a[i] % 3 == 0 || a[i] % 5 == 0) {
            if (a[i] % 15 == 0) ans += 8;
            else ans += 4;
        }
        else ans += mojicnt(a[i]); 
        //dump(ans);
    }
    cout << ans << endl;
    return 0;
}
            
            
            
        