QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#556800#9248. An Easy Math Problemucup-team3712#WA 522ms3652kbC++14661b2024-09-10 21:04:382024-09-10 21:04:39

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-09-10 21:04:39]
  • Judged
  • Verdict: WA
  • Time: 522ms
  • Memory: 3652kb
  • [2024-09-10 21:04:38]
  • Submitted

answer

#include<iostream>
#include<cmath>
using namespace std;
long long zhanzhuan(long long a, long long b)
{
	long long c = 0;
	while (a % b)
	{
		c = a % b;
		a = b;
		b = c;
	}
	return b;
}
int main(void)
{
	int t = 0;
	long long n = 0,i=0,temp=0,number=0;
	cin >> t;
	while (t--)
	{
		cin >> n;
		for (i = 1; i <= sqrt(n); i++)
		{
			if (n % i == 0)
			{
				number += 2;
				temp = zhanzhuan(i, n / i);
				if (temp < i)
				{
					number++;
				}	
				else if (n % (n / i / temp))
				{
					number++;
				}
			}
		}
		temp = sqrt(n);
		if (temp * temp == n)
			number--;
		cout << number << '\n';
		number = 0;
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 522ms
memory: 3512kb

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'