結果

問題 No.933 おまわりさんこいつです
ユーザー rieaaddlreiuu
提出日時 2022-11-09 22:40:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 427 bytes
コンパイル時間 1,637 ms
コンパイル使用メモリ 167,028 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-23 03:38:06
合計ジャッジ時間 2,583 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    int N;
    scanf("%d",&N);
    long temp;
    bool zero_flag = true;
    int ans = 1;
    for(int i=0;i<N;i++){
        scanf("%ld",&temp);
        if(temp == 0){
            zero_flag = false;
        }
        ans *= temp % 9;
        ans = ans % 9;
    }
    if(ans == 0){
        ans = 9;
    }
    if(zero_flag){
        ans = 0;
    }
    printf("%d",ans);
}
0