AtCoder Beginner Contest 057

Submission #10127601

Source codeソースコード

#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n; i >= 0; i--)
#define inf LLONG_MAX
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;

ll f(ll a, ll b) {
    return max(to_string(a).size(), to_string(b).size());
}

int main()
{
    ll n; cin >> n;
    ll min_num = inf;
    for (size_t i = 1; i < sqrt(n) + 1; i++)
    {
        if (n % i != 0) continue;
        min_num = min(min_num, f(i, n / i));
    }
    cout << min_num << endl;
    
    return 0;
}

Submission

Task問題 C - Digits in Multiplication
User nameユーザ名 cl0wn
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 AC
Score得点 300
Source lengthソースコード長 611 Byte
File nameファイル名
Exec time実行時間 5 ms
Memory usageメモリ使用量 764 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - sample_01.txt,sample_02.txt,sample_03.txt
All 300 / 300 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
sample_01.txt AC 5 ms 764 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 256 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