Language: C++


void E_Flatten(void) {

	int N;
	cin >> N;

	vector<int> A(N);
	for (int& it : A) cin >> it;

	vector<map<int, int>> dA(N);

	map<int, int> dAB;
	for (int loop1 = 0; loop1 < N; loop1++) {

		int num = A[loop1];

		for (int loop = 2; loop <= A[loop1]; loop++) {
			if (num == 1) break;
			if (num % loop == 0) {
				num /= loop;
				dA[loop1][loop]++;
				loop--;
			}
		}

		for (auto loop = dA[loop1].begin(); loop != dA[loop1].end(); loop++) {

			if (dAB[loop->first] < loop->second)	dAB[loop->first] = loop->second;
		}
	}

	int sum = 0;
	for (auto it : dA) {

		long long B = 1;
		for (auto loop = dAB.begin(); loop != dAB.end(); loop++) {

			if (loop->second > it[loop->first]) {
				B = (B * (int)pow(loop->first, loop->second - it[loop->first])) % 1000000007;
			}
		}
		sum = (sum + B) % 1000000007;
	}
	cout << sum << flush;
	return;
}


Compiler output:
a.cc: In function 'void E_Flatten()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> N;
      |         ^~~
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int> A(N);
      |         ^~~~~~
a.cc:7:16: error: expected primary-expression before 'int'
    7 |         vector<int> A(N);
      |                ^~~
a.cc:8:24: error: 'A' was not declared in this scope
    8 |         for (int& it : A) cin >> it;
      |                        ^
a.cc:10:16: error: 'map' was not declared in this scope
   10 |         vector<map<int, int>> dA(N);
      |                ^~~
a.cc:10:20: error: expected primary-expression before 'int'
   10 |         vector<map<int, int>> dA(N);
      |                    ^~~
a.cc:12:13: error: expected primary-expression before 'int'
   12 |         map<int, int> dAB;
      |             ^~~
a.cc:15:27: error: 'A' was not declared in this scope
   15 |                 int num = A[loop1];
      |                           ^
a.cc:21:33: error: 'dA' was not declared in this scope
   21 |                                 dA[loop1][loop]++;
      |                                 ^~
a.cc:26:34: error: 'dA' was not declared in this scope
   26 |                 for (auto loop = dA[loop1].begin(); loop != dA[loop1].end(); loop++) {
      |                                  ^~
a.cc:28:29: error: 'dAB' was not declared in this scope
   28 |                         if (dAB[loop->first] < loop->second)    dAB[loop->first] = loop->second;
      |                             ^~~
a.cc:33:24: error: 'dA' was not declared in this scope
   33 |         for (auto it : dA) {
      |                        ^~
a.cc:36:34: error: 'dAB' was not declared in this scope
   36 |                 for (auto loop = dAB.begin(); loop != dAB.end(); loop++) {
      |                                  ^~~
a.cc:39:47: error: 'pow' was not declared in this scope
   39 |                                 B = (B * (int)pow(loop->first, loop->second - it[loop->first])) % 1000000007;
      |                                               ^~~
a.cc:44:9: error: 'cout' was not declared in this scope
   44 |         cout << sum << flush;
      |         ^~~~
a.cc:44:24: error: 'flush' was not declared in this scope
   44 |         cout << sum << flush;
      |                        ^~~~~