QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#623234#9248. An Easy Math ProblemMIS_T__WA 2ms3812kbC++23557b2024-10-09 10:46:592024-10-09 10:47:04

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-09 10:47:04]
  • Judged
  • Verdict: WA
  • Time: 2ms
  • Memory: 3812kb
  • [2024-10-09 10:46:59]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve() {
	i64 ans = 0;
	i64 n;
	cin >> n;
	map<i64,int>mp;
	i64 S = 1;
	for ( i64 i = 2 ; i*i <= n ; i++ ) {
		if ( n%i == 0 ) {
			while ( n%i == 0 ) {
				mp[i]++;
				n /= i;
			}
		}
	}
	if ( n != 1 ) {
		mp[n]++;
	}
	i64 use = 1;
	for ( auto [x,y] : mp ) {
		use *= y*2;
		S *= y+1;
	}
	if ( mp.size() != 1 && mp.size() != 0 ) ans += use/2-1;
	ans += S;
	cout << ans << '\n';
}
int main() {
	int T;
	cin >> T;
	while ( T-- ) {
		solve();
	}
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3812kb

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: 2ms
memory: 3592kb

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:

1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
1535
...

result:

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