結果
問題 |
No.933 おまわりさんこいつです
|
ユーザー |
![]() |
提出日時 | 2019-12-29 15:14:00 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 81 ms / 2,000 ms |
コード長 | 397 bytes |
コンパイル時間 | 2,010 ms |
コンパイル使用メモリ | 195,696 KB |
最終ジャッジ日時 | 2025-01-08 15:14:13 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; vector <ll> p(n); for (int i = 0; i < n; i++) { cin >> p[i]; } ll ans = 1; bool flg = true; for (int i = 0; i < n; i++) { if (p[i] == 0) { flg = false; } ans = (ans * (p[i] % 9)) % 9; } if (flg && ans == 0) { ans = 9; } cout << ans << endl; return 0; }