結果
| 問題 | No.933 おまわりさんこいつです |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-08 16:44:05 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 9 ms / 2,000 ms |
| + 955µs | |
| コード長 | 470 bytes |
| 記録 | |
| コンパイル時間 | 1,343 ms |
| コンパイル使用メモリ | 214,372 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-10-13 04:42:18 |
| 合計ジャッジ時間 | 3,275 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 26 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
int N; cin >> N;
vector<ll> P(N);
rep(i,N) cin >> P[i];
int ZERO = 0;
rep(i,N) ZERO |= P[i] == 0;
if(ZERO) {
cout << 0 << endl;
} else {
ll ans = 1;
rep(i,N) ans = (ans * (P[i] % 9)) % 9;
cout << (ans == 0 ? 9 : ans) << endl;
}
}