結果
| 問題 | No.933 おまわりさんこいつです | 
| コンテスト | |
| ユーザー |  Nachia | 
| 提出日時 | 2020-10-17 20:25:09 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 69 ms / 2,000 ms | 
| コード長 | 342 bytes | 
| コンパイル時間 | 1,614 ms | 
| コンパイル使用メモリ | 165,460 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-21 03:03:34 | 
| 合計ジャッジ時間 | 2,716 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 25 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)
int main() {
	int N; cin >> N;
	LL K = 1;
	rep(i, N) {
		LL A; cin >> A;
		if (A == 0) { cout << 0 << endl; return 0; }
		K = K * (A % 9) % 9;
	}
	if (K == 0) K = 9;
	cout << K << endl;
	return 0;
}
            
            
            
        