結果

問題 No.3101 砂嵐
ユーザー PechiPechi
提出日時 2023-03-31 22:19:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,975 bytes
コンパイル時間 2,591 ms
コンパイル使用メモリ 181,544 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-24 08:24:06
合計ジャッジ時間 4,569 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 2 ms
4,372 KB
testcase_02 AC 2 ms
4,372 KB
testcase_03 AC 2 ms
4,372 KB
testcase_04 AC 2 ms
4,372 KB
testcase_05 AC 2 ms
4,372 KB
testcase_06 AC 2 ms
4,372 KB
testcase_07 AC 2 ms
4,372 KB
testcase_08 AC 2 ms
4,372 KB
testcase_09 AC 2 ms
4,372 KB
testcase_10 AC 2 ms
4,372 KB
testcase_11 AC 2 ms
4,372 KB
testcase_12 AC 2 ms
4,372 KB
testcase_13 AC 2 ms
4,372 KB
testcase_14 AC 2 ms
4,372 KB
testcase_15 AC 2 ms
4,372 KB
testcase_16 AC 2 ms
4,372 KB
testcase_17 AC 2 ms
4,372 KB
testcase_18 AC 2 ms
4,372 KB
testcase_19 AC 2 ms
4,372 KB
testcase_20 AC 2 ms
4,372 KB
testcase_21 AC 2 ms
4,372 KB
testcase_22 AC 2 ms
4,372 KB
testcase_23 AC 2 ms
4,372 KB
testcase_24 AC 1 ms
4,372 KB
testcase_25 AC 2 ms
4,372 KB
testcase_26 AC 2 ms
4,372 KB
testcase_27 AC 2 ms
4,372 KB
testcase_28 AC 2 ms
4,372 KB
testcase_29 AC 2 ms
4,372 KB
testcase_30 AC 2 ms
4,372 KB
testcase_31 AC 2 ms
4,372 KB
testcase_32 AC 2 ms
4,372 KB
testcase_33 AC 2 ms
4,372 KB
testcase_34 AC 2 ms
4,372 KB
testcase_35 AC 2 ms
4,372 KB
testcase_36 AC 2 ms
4,372 KB
testcase_37 AC 2 ms
4,372 KB
testcase_38 AC 2 ms
4,372 KB
testcase_39 AC 2 ms
4,372 KB
testcase_40 AC 2 ms
4,372 KB
testcase_41 AC 1 ms
4,372 KB
testcase_42 AC 2 ms
4,372 KB
testcase_43 AC 2 ms
4,372 KB
testcase_44 AC 2 ms
4,372 KB
testcase_45 AC 2 ms
4,372 KB
testcase_46 AC 2 ms
4,372 KB
testcase_47 AC 2 ms
4,372 KB
testcase_48 AC 2 ms
4,372 KB
testcase_49 AC 2 ms
4,372 KB
testcase_50 AC 2 ms
4,372 KB
testcase_51 AC 2 ms
4,372 KB
testcase_52 AC 2 ms
4,372 KB
testcase_53 AC 2 ms
4,372 KB
testcase_54 AC 2 ms
4,372 KB
testcase_55 AC 2 ms
4,372 KB
testcase_56 AC 2 ms
4,372 KB
testcase_57 AC 2 ms
4,372 KB
testcase_58 AC 2 ms
4,372 KB
testcase_59 AC 2 ms
4,372 KB
testcase_60 AC 2 ms
4,372 KB
testcase_61 AC 2 ms
4,372 KB
testcase_62 AC 2 ms
4,372 KB
testcase_63 AC 2 ms
4,372 KB
testcase_64 AC 2 ms
4,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#include<unordered_map>
#include<random>
#include <array>
#include <complex>
using namespace std;
#define LP(I,S,G) for (long long int I = (S); I < (G); ++I)
#define IN(X) 	for (int in = 0; in < X.size(); in++)cin >> X[in]
#define OUT(X) 	for (int in = 0; in < X.size(); in++)cout << X[in]<<" "
#define SORT(X) sort((X).begin(), (X).end())
#define CSORT(X,Y) sort(X.begin(), X.end(),Y)
#define COPY(X,Y) copy(X.begin(), X.end(), Y.begin())
#define ALL(X,Y) for (auto X = (Y).begin(); X != (Y).end(); X++)
#define FULL(a)  (a).begin(),(a).end()
#define BFS(Q,S) for(Q.push(S);Q.size()!=0;Q.pop())
typedef long long int ll;
typedef unsigned long long int ull;
long long int M = 998244353;


int dx[] = { -1,0,1,0 }, dy[] = { 0,1,0,-1 };

ll MAX(ll A, ll B) { return ((A) > (B) ? (A) : (B)); }
ll MIN(ll A, ll B) { return ((A) < (B) ? (A) : (B)); }
long long int xor128() {
	static long long int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	long long int t = (x ^ (x << 11));
	x = y; y = z; z = w;
	return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

struct HashPair {
	//注意 constがいる
	template<class T1, class T2>
	size_t operator()(const pair<T1, T2> &p) const {
		//first分をハッシュ化する
		auto hash1 = hash<T1>{}(p.first);
		//second分をハッシュ化する
		auto hash2 = hash<T2>{}(p.second);
		//重複しないようにハッシュ処理
		size_t seed = 0;
		seed ^= hash1 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
		seed ^= hash2 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
		return seed;
	}
};

template<class I1, class I2>
istream& operator>>(istream& s, pair<I1, I2>& in) {
	s >> in.first >> in.second;
	return s;
}

ll f(ll x) {
	if (x < 10)return 0;
	ll v = 1;
	string s = to_string(x);
	ALL(i, s)v *= *i - '0';
	return f(v) + 1;
}

int main() {
	ll n;
	cin >> n;
	cout << f(n) << "\n";

	return 0;
}
0