結果

問題 No.933 おまわりさんこいつです
ユーザー udonman
提出日時 2019-12-01 00:07:56
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 1,263 ms
コンパイル使用メモリ 160,172 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-21 03:45:57
合計ジャッジ時間 2,223 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    int n;cin >>n;
    vector<ll> p(n);
    ll mult =1;
    for(int i=0;i<n;i++){
        cin >> p[i];
        if(p[i]==0){
            cout << 0 << endl;
            return 0;
        }else{
        mult=(p[i]%9)*(mult%9);
        }
    }
    if(mult%9==0){
        cout << 9 << endl;
    }else{
        cout << mult%9 << endl;
    }
    
    return 0;
}
0