結果

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

using ll = long long int;

int main() {
    ll n, ans = 1;
    bool zr = false;
    cin >> n;
    for(int i=0;i<n;i++){
        ll a;
        cin >> a;
        if(a == 0) zr = true;
        ans *= a;
        ans %= 9;
    }
    if(ans == 0 && !zr) ans = 9;
    cout << ans << endl;
    return 0;
}
0