結果

問題 No.933 おまわりさんこいつです
ユーザー auaua
提出日時 2019-11-29 21:50:50
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 655 bytes
コンパイル時間 1,486 ms
コンパイル使用メモリ 159,068 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-20 21:56:49
合計ジャッジ時間 2,425 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define double long double
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll inf=1e9+7;
const ll mod=998244353;
int main(){
    ll n;cin>>n;
    ll sum=1;
    ll p;
    rep(i,n){
        cin>>p;
        sum*=p;
    }
    ll ans=sum;
    while(ans>=10){
        ll t=0;
        while(ans){
            t+=ans%10;
            ans/=10;
        }
        ans=t;
    }
    cout<<ans<<endl;
}
0