結果
問題 | No.933 おまわりさんこいつです |
ユーザー |
|
提出日時 | 2019-12-03 21:06:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 536 bytes |
コンパイル時間 | 515 ms |
コンパイル使用メモリ | 69,888 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 18:54:23 |
合計ジャッジ時間 | 2,106 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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=P[0]; char S[100]; string S1; for (i=1;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; }