結果
問題 | No.933 おまわりさんこいつです |
ユーザー |
|
提出日時 | 2020-04-21 19:44:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 462 bytes |
コンパイル時間 | 704 ms |
コンパイル使用メモリ | 66,304 KB |
最終ジャッジ日時 | 2025-01-09 22:06:24 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <iostream> using lint = long long; void solve() { lint ans = 1; int n; std::cin >> n; while (n--) { lint p; std::cin >> p; if (p == 0) { std::cout << 0 << std::endl; return; } (ans *= p % 9) %= 9; } std::cout << (ans == 0 ? 9 : ans) << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }