結果

問題 No.933 おまわりさんこいつです
ユーザー face4
提出日時 2019-11-30 10:50:44
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 657 ms
コンパイル使用メモリ 62,976 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 01:05:02
合計ジャッジ時間 1,581 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
typedef long long ll;

int main(){
    int n;
    cin >> n;
    ll p = 1;
    for(int i = 0; i < n; i++){
        ll x;   cin >> x;
        if(x == 0){
            cout << 0 << endl;
            return 0;
        }
        p = p*x%9;
    }
    cout << (p%9==0 ? 9 : p) << endl;
    return 0;
}
0