結果
| 問題 |
No.637 X: Yet Another FizzBuzz Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-29 08:53:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 620 bytes |
| コンパイル時間 | 1,343 ms |
| コンパイル使用メモリ | 167,728 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 16:43:58 |
| 合計ジャッジ時間 | 2,160 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
/**
@file 637.cpp
@title No.637 X: Yet Another FizzBuzz Problem - yukicoder
@url https://yukicoder.me/problems/no/637
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)
int main() {
int ans = 0;
int a;
while (cin >> a) {
if (a % 3 == 0 && a % 5 == 0) {
ans += 8;
} else if (a % 3 == 0 && a % 5 != 0) {
ans += 4;
} else if (a % 3 != 0 && a % 5 == 0) {
ans += 4;
} else {
ans += (int)to_string(a).size();
}
}
cout << ans << endl;
return 0;
}