結果
問題 | No.933 おまわりさんこいつです |
ユーザー |
|
提出日時 | 2019-12-03 21:13:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 534 bytes |
コンパイル時間 | 541 ms |
コンパイル使用メモリ | 71,164 KB |
実行使用メモリ | 6,816 KB |
最終ジャッジ日時 | 2024-11-27 19:08:41 |
合計ジャッジ時間 | 1,673 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 1 |
ソースコード
#include <iostream>#include <vector>#include <string.h>using namespace std;typedef long long LL;int main(int argc, char* argv[]){int N,i;cin>>N;vector<LL> P(N);for (i=0;i<N;i++){cin>>P[i];}LL X=1;char S[100];string S1;for (i=0;i<N;i++){X*=P[i];sprintf(S,"%lld",X);S1=S;int Y=0;for (int j=0;j<S1.length();j++){Y+=S1[j]-'0';}X=Y;}while (X>9){sprintf(S,"%lld",X);S1=S;int Y=0;for (int j=0;j<S1.length();j++){Y+=S1[j]-'0';}X=Y;}cout<<X<<endl;return 0;}