| Task: | Kertoma | 
| Sender: | snowflake | 
| Submission time: | 2022-11-04 23:09:05 +0200 | 
| Language: | C++ (C++11) | 
| Status: | COMPILE ERROR | 
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:46:9: error: 'second' was not declared in this scope
   46 |         second = 0.0;
      |         ^~~~~~
input/code.cpp:47:29: error: 'count' was not declared in this scope
   47 |         for (int i = 0; i < count; ++i)
      |                             ^~~~~
input/code.cpp:52:13: error: expected '(' before 'i'
   52 |         for i in range(1, e + 1):
      |             ^
      |             (
input/code.cpp:52:13: error: 'i' was not declared in this scope
input/code.cpp:56:9: error: expected primary-expression before 'if'
   56 |         if (second != numsum)
      |         ^~
input/code.cpp:54:34: error: expected ';' before 'if'
   54 |         second = int(second + 1);
      |                                  ^
      |                                  ;
   55 | 
   56 |         if (second != numsum)
      |         ~~                        
input/code.cpp:56:9: error: expected primary-expression before 'if'
   56 |...Code
#include <math.h>
#include<iostream>
using namespace std;
int master[16777216];
void fac(int num)
{
    std::fill_n(master, 0, 0);
    master[0] = 1;
    int inn = 1;
    for (int i = 2; i <= num; i++)
    {
        int nextround = 0;
        for (int i2 = 0; i2 < inn; i2++)
        {
            int product = master[i2] * i + nextround;
            master[i2] = product % 10;
            nextround = product * 0.1;
        }
        while (nextround > 0)
        {
            master[inn] = nextround % 10;
            nextround = nextround * 0.1;
            inn++;
        }
    }
}
int main()
{
    int nil, one, two, three, four, five, six, seven, eight, nine;
    cin >> nil >> one >> two >> three >> four >> five >> six >> seven >> eight >> nine;
    int numz[] = { nil, one, two, three, four, five, six, seven, eight, nine };
    int numsum = 0;
    for (int i = 0; i <= 10; ++i)
        numsum += numz[i];
    int wa = 0;
    int kick = (int)(0.84 * pow(numsum, 0.89543) + 1);
    for (int e = kick; e <= 16777216; ++e)
    {
        second = 0.0;
        for (int i = 0; i < count; ++i)
        {
            
        }
        for i in range(1, e + 1):
            second += log10(i)
        second = int(second + 1);
        if (second != numsum)
            continue
        fac(e);
        int counters[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
        for (int z = 0; z < 30000; ++z)
        {
            counters[master[z]]++;
        }
        int z0 = counters[0];
        counters[0] = 30000 - z0 - 1;
        bool spill = false;
        for (int k = 0; k < 10; ++k)
        {
            spill = counters[k] != numz[k];
            if (spill)
                break;
        }
        if (!spill)
        {
            wa = e;
            break;
        }
    }
    cout << wa;
    return 0;
}