結果

問題 No.933 おまわりさんこいつです
ユーザー kya_skikya_ski
提出日時 2019-11-29 22:09:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 486 bytes
コンパイル時間 6,296 ms
コンパイル使用メモリ 380,460 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-05-01 00:29:07
合計ジャッジ時間 13,254 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,756 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 5 ms
6,940 KB
testcase_12 AC 13 ms
6,940 KB
testcase_13 AC 246 ms
6,944 KB
testcase_14 AC 521 ms
6,940 KB
testcase_15 TLE -
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
namespace mp = boost::multiprecision;

int main(){
    int N;
    cin >> N;
    vector<mp::cpp_int> P(N);
    mp::cpp_int A = 1;
    for (int i = 0; i < N; i++) {
        cin >> P[i];
        A *= P[i];
    }

    while (A >= 10) {
        mp::cpp_int B = 0;
        while (A > 0) {
            B += A%10;
            A /= 10;
        }
        A = B;
    }
    cout << A << endl;
    return 0;
}
0