QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#646760#9248. An Easy Math Problemicpc_zhzx034#WA 476ms3720kbC++141.1kb2024-10-17 08:01:192024-10-17 08:01:19

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-17 08:01:19]
  • Judged
  • Verdict: WA
  • Time: 476ms
  • Memory: 3720kb
  • [2024-10-17 08:01:19]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <ll,ll> P;
#define _for(x,y,z) for (int x(y),_(z); x<=_; ++x)
#define _rep(x,y,z) for (int x(y),_(z); x>=_; --x)
inline ll read(){ ll x; cin>>x; return x; }
inline void _init(){
	#ifdef LOCAL
		assert(freopen("test.in", "r", stdin));
		assert(freopen("test.out", "w", stdout));
	#endif
	ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
}

ll n, ans;

vector <ll> vec;

void init() {}

void procedure() {
	cin >> n;
	vec.clear();
	ll t = n;
	for (ll i = 2; i * i <= n; ++i) {
		if (n % i == 0) {
			ll cnt = 0;
			while (t % i == 0) {
				++cnt;
				t /= i;
			}
			if (cnt) {
				vec.emplace_back(cnt);
			}
			cnt = 0;
			while (t % (n / i) == 0) {
				++cnt;
				t /= (n / i);
			}
			if (cnt) {
				vec.emplace_back(cnt);
			}
		}
	}
	if (t > 1) {
		vec.emplace_back(1);
	}
	ans = 1;
	for (auto u: vec) {
		ans *= (u << 1 | 1);
	}
	ans = (ans + 1) >> 1;
	cout << ans << "\n";
}

int main() {
	_init(), init();
	int T=read();
	while(T--) procedure();
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3708kb

input:

10
1
2
3
4
5
6
7
8
9
10

output:

1
2
2
3
2
5
2
4
3
5

result:

ok 10 lines

Test #2:

score: -100
Wrong Answer
time: 476ms
memory: 3720kb

input:

2000
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
646969323...

output:

5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
...

result:

wrong answer 1st lines differ - expected: '29525', found: '5'