結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー Lavender
提出日時 2019-09-06 11:06:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 361 bytes
コンパイル時間 1,552 ms
コンパイル使用メモリ 167,388 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-23 16:48:26
合計ジャッジ時間 2,630 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int s = 0, t, d;
    for(int i = 0; i < 5; i++) {
        d = 0;
        cin >> t;
        if(t % 15 == 0) s += 8;
        else if((t % 3 == 0 && t % 5 != 0) || (t % 3 != 0 && t % 5 == 0)) s += 4;
        else while(t > 0) t /= 10, d++; 
        s += d;
    }
    cout << s << endl;
    return 0;
}
0