結果
| 問題 |
No.637 X: Yet Another FizzBuzz Problem
|
| コンテスト | |
| ユーザー |
mas9612
|
| 提出日時 | 2019-08-03 18:44:54 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 501 bytes |
| コンパイル時間 | 373 ms |
| コンパイル使用メモリ | 56,436 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 03:46:22 |
| 合計ジャッジ時間 | 1,258 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main() {
int result = 0;
for (int i = 0; i < 5; ++i) {
int a;
cin >> a;
if (a % 15 == 0) {
result += 8;
} else if (a % 3 == 0 || a % 5 == 0) {
result += 4;
} else {
result += to_string(a).length();
// while (a > 0) {
// ++result;
// a /= 10;
// }
}
}
cout << result << '\n';
}
mas9612