結果
| 問題 |
No.933 おまわりさんこいつです
|
| コンテスト | |
| ユーザー |
TS_KAs
|
| 提出日時 | 2019-11-29 22:30:07 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 418 bytes |
| コンパイル時間 | 1,975 ms |
| コンパイル使用メモリ | 192,820 KB |
| 最終ジャッジ日時 | 2025-01-08 06:05:39 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 WA * 17 |
ソースコード
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int N, P;
ll K = 1;
cin >> N;
REP(i, N){
cin >> P;
K *= P;
}
while(K > 9){
int s = to_string(K).size();
ll ans = 0;
REP(i, s){
ans += K % 10;
K /= 10;
}
K = ans;
}
cout << K << endl;
}
TS_KAs