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