結果

問題 No.933 おまわりさんこいつです
ユーザー w1steri4sec
提出日時 2020-03-05 09:13:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 741 bytes
コンパイル時間 1,478 ms
コンパイル使用メモリ 168,792 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-14 00:46:49
合計ジャッジ時間 2,773 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
using namespace std;
using ll = long long;
using Int = long long;

const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;

ll sumketa(ll x){
    ll k=x;
    ll wa=0;
    while(k>0){
        wa+=k%10;
        k/=10;
    }

    if(wa<10){
        return wa;
    }else{
        return sumketa(wa);
    }

}

int main(){
    cin.tie( 0 ); ios::sync_with_stdio( false );
    int n;
    cin >> n;
    vector<ll> p(n);
    rep(i,n) cin >> p[i];

    ll hoge=1;
    rep(i,n){
        hoge*=p[i];
        //cout <<hoge<<endl;
    }
    ll tosi=sumketa(hoge);

    cout <<tosi << endl;

}
0