結果
| 問題 |
No.933 おまわりさんこいつです
|
| コンテスト | |
| ユーザー |
yakki
|
| 提出日時 | 2019-11-29 21:52:38 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,142 bytes |
| コンパイル時間 | 939 ms |
| コンパイル使用メモリ | 90,060 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-20 21:58:05 |
| 合計ジャッジ時間 | 2,042 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 WA * 16 |
ソースコード
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;
#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
//#define MOD 1000000007
#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592
const double EPS = 1e-10;
using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;
int main(){
int N; cin >> N;
vector<ll> P(N);
rep(i,N) cin >> P[i];
ll tmp = 1;
rep(i,N){
string k = to_string(P[i]);
int m = k.size();
int now = 0;
rep(j,m){
now += k[j]-'0';
}
tmp *= now;
}
string t = to_string(tmp);
while(true){
int s = t.size();
int now = 0;
rep(i,s){
now += t[i]-'0';
}
t = to_string(now);
if(t.size() == 1) break;
}
cout << t << endl;
}
yakki