結果
問題 | No.637 X: Yet Another FizzBuzz Problem |
ユーザー |
|
提出日時 | 2021-05-08 20:29:56 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 18 ms / 1,000 ms |
コード長 | 876 bytes |
コンパイル時間 | 1,260 ms |
コンパイル使用メモリ | 124,624 KB |
最終ジャッジ日時 | 2025-01-21 09:25:23 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
#include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <bitset> #include <cstdio> #include <limits> #include <vector> #include <cstdlib> #include <numeric> #include <sstream> #include <iostream> #include <algorithm> #include <functional> #include <iomanip> #include <unordered_map> #include <memory.h> #include <unordered_set> #include <fstream> #include <random> using namespace std; int main(void) { cin.tie(0); ios::sync_with_stdio(false); int a[5]; cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4]; int res = 0; for (int i = 0; i < 5; i++) { if (a[i] % 15 == 0) { res += 8; } else if (a[i] % 3 == 0 || a[i] % 5 == 0) { res += 4; } else { int val = a[i]; while (val > 0) { res++; val /= 10; } } } cout << res << '\n'; return 0; }