結果
問題 |
No.933 おまわりさんこいつです
|
ユーザー |
![]() |
提出日時 | 2019-12-02 02:31:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 460 bytes |
コンパイル時間 | 1,597 ms |
コンパイル使用メモリ | 165,376 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 04:17:46 |
合計ジャッジ時間 | 3,116 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 3 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int N; cin >> N; ll P[N]; for (int i = 0; i < N; i++) { cin >> P[i]; } ll k = P[0] % 9; for (int i = 1; i < N; i++) { if (k == 0) { cout << "9\n"; return 0; } k *= P[i]; k %= 9; } if (k == 0) { cout << "9\n"; } else { cout << k << "\n"; } return 0; }