QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#662326#9248. An Easy Math Problem123BVNCompile Error//C++23904b2024-10-20 22:55:592024-10-20 22:56:00

Judging History

This is the latest submission verdict.

  • [2024-10-31 22:36:43]
  • hack成功,自动添加数据
  • (/hack/1098)
  • [2024-10-31 22:13:58]
  • hack成功,自动添加数据
  • (/hack/1096)
  • [2024-10-31 22:00:43]
  • hack成功,自动添加数据
  • (/hack/1095)
  • [2024-10-20 22:56:00]
  • Judged
  • [2024-10-20 22:55:59]
  • Submitted

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
map<int, int>mp;
void solve() {
	int n, m;
	cin >> n;
	m = n;
	if (mp[n]) {
		cout << mp[n] << endl;
		return;
	}
	vector<int>v;
	for (int i = 2; i <= n / i; i++) {
		int cnt = 0;
		while (n % i == 0) {
			cnt++;
			n /= i;
		}
		v.push_back(cnt);
	}
	if (n > 1)v.push_back(1);
	n = 2;
	for (int i = 1; i < v.size(); i++) {
		n *= 2;
	}
	int ans = 1;
	for (int i = 0; i < min(2048ll.n); i++) {
		int x = i;
		int pos1 = 1, pos2 = 1;
		int cnt = 0;
		for (int j = 0; j < v.size(); j++) {
			if (x % 2)pos1 *= v[j];
			else pos2 *= (v[j] + 1);
			x /= 2;
		}
		ans += pos1 * pos2;
	}
	mp[m] = ans / 2;
	cout << ans / 2 << "\n";
}
signed main() {
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int _ = 1;
	cin >> _;
	while (_--) {
		solve();
	}//ut << _<<endl;
	return 0;
}

Details

answer.code: In function ‘void solve()’:
answer.code:28:33: error: unable to find numeric literal operator ‘operator""ll.n’
   28 |         for (int i = 0; i < min(2048ll.n); i++) {
      |                                 ^~~~~~~~
answer.code:28:33: note: use ‘-fext-numeric-literals’ to enable more built-in suffixes