結果
問題 |
No.933 おまわりさんこいつです
|
ユーザー |
![]() |
提出日時 | 2025-03-21 16:25:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 361 bytes |
コンパイル時間 | 1,647 ms |
コンパイル使用メモリ | 163,276 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-21 16:25:39 |
合計ジャッジ時間 | 3,180 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 3 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for(int i = 0; i < n; i++) int main() { int N; cin >> N; vector<ll> a(N); rep(i, N) cin >> a[i]; if(N == 1 && a[0] == 9) { cout << 9 << endl; return 0; } ll ans = 1; rep(i, N) { if(a[i]) ans = ans * a[i] % 9; } if(ans == 0) ans = 9; cout << ans << endl; }