結果

問題 No.933 おまわりさんこいつです
ユーザー TS_KAs
提出日時 2019-11-29 22:56:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 2,140 ms
コンパイル使用メモリ 193,512 KB
最終ジャッジ日時 2025-01-08 06:11:01
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
  ll P, K = 1;
  cin >> N;
  REP(i, N){
    cin >> P;
    K *= P;
  }
  while(K > 9){
    int s = (int)log10(K) + 1;
    ll tmp = 0;
    REP(i, s){
      tmp += K % 10;
      K /= 10;
    }
    K = tmp;
  }
  cout << K << endl;
}
0