結果

問題 No.933 おまわりさんこいつです
ユーザー Hydrogen1008Hydrogen1008
提出日時 2020-09-23 12:16:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 1,499 ms
コンパイル使用メモリ 167,100 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-10 04:12:26
合計ジャッジ時間 3,021 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,384 KB
testcase_14 AC 3 ms
4,380 KB
testcase_15 AC 4 ms
4,380 KB
testcase_16 AC 10 ms
4,376 KB
testcase_17 AC 23 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 28 ms
4,380 KB
testcase_20 AC 16 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 65 ms
4,380 KB
testcase_24 AC 66 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


int main() {
int N;

cin >> N;
vector<long long int>P(N);
int flag=0;
int Age=1;

for(int i=0; i<N; i++){
    cin >> P.at(i);
    if(P.at(i)==0){
        flag++;
    }
    P.at(i)=P.at(i)%9;
}

if(flag==0){
    for(int i=0; i<N; i++){
        Age=(Age*P.at(i))%9;
    }
    if(Age==0){
        Age=9;
    }
}
else{
    Age=0;
}

cout << Age << endl;

}
0