Submission #1444629


Source Code Expand

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
 
using namespace std;
 
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
 
long gcd(long a, long b){
	if (a%b==0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}
}
 
long lcm(long a, long b){
	return (a*b) / gcd(a,b);
}
 
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a > b) { a = b; return 1; } return 0; }
 
typedef long long ll;

const ll INF = 1ll<<60;
const ll MOD = 1000000007;
const double EPS = 1e-10;

ll f(ll a, ll b){
	return max((ll)log10(a)+1, (ll)log10(b)+1);
}

int main(){
	ll n;
	
	cin >> n;
	
	double root = pow(n, 0.5);
	
	ll r = (ll)root;
	r++;
	
	ll a = 1;
	
	FOR(i,2,r+1){
		if (n%i == 0) a = i;
	}
	
	cout << f(a, n/a) << endl;
	
	return 0;
}

Submission Info

Submission Time
Task C - Digits in Multiplication
User Lemonmaru
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1032 Byte
Status AC
Exec Time 10 ms
Memory 640 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 15
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_2.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt
Case Name Status Exec Time Memory
sample_01.txt AC 10 ms 640 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 2 ms 256 KB
subtask_1_1.txt AC 1 ms 256 KB
subtask_1_10.txt AC 2 ms 384 KB
subtask_1_11.txt AC 1 ms 256 KB
subtask_1_12.txt AC 1 ms 256 KB
subtask_1_2.txt AC 1 ms 256 KB
subtask_1_3.txt AC 2 ms 256 KB
subtask_1_4.txt AC 2 ms 256 KB
subtask_1_5.txt AC 2 ms 256 KB
subtask_1_6.txt AC 2 ms 256 KB
subtask_1_7.txt AC 2 ms 256 KB
subtask_1_8.txt AC 2 ms 256 KB
subtask_1_9.txt AC 2 ms 256 KB