結果
問題 |
No.933 おまわりさんこいつです
|
ユーザー |
![]() |
提出日時 | 2019-12-07 15:08:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 422 bytes |
コンパイル時間 | 1,816 ms |
コンパイル使用メモリ | 165,448 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-25 20:04:07 |
合計ジャッジ時間 | 3,284 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int p[n]; int total = 1; for(int i = 0; i < n; i++) { cin >> p[i]; total *= p[i]; } auto f = [&] (int c) { int digit = 0; while(c > 0) { digit += c % 10; c = c / 10; } return digit; }; while(total > 9) { total = f(total); } cout << total << endl; }