結果
| 問題 | No.933 おまわりさんこいつです | 
| コンテスト | |
| ユーザー |  leaf_1415 | 
| 提出日時 | 2019-11-29 21:46:43 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 20 ms / 2,000 ms | 
| コード長 | 368 bytes | 
| コンパイル時間 | 466 ms | 
| コンパイル使用メモリ | 56,108 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-20 21:48:25 | 
| 合計ジャッジ時間 | 1,433 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 25 | 
ソースコード
#include <iostream>
#include <string>
#define llint long long
using namespace std;
llint n;
int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n;
	llint ans = 1, x;
	for(int i = 1; i <= n; i++){
		cin >> x;
		if(x == 0){
			cout << 0 << endl;
			return 0;
		}
		ans *= x % 9, ans %= 9;
	}
	
	if(ans == 0) ans = 9;
	cout << ans << endl;
	
	return 0;
}
            
            
            
        