UOJ Logo

NOI.AC

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#212648#3827. Asycwhx0107ms1196kbC++476b2024-10-20 08:34:372024-10-20 12:34:49

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,cnt; 

bool check(ll num1,ll num2)
{
	ll a=num1,b=num2;
	while(a!=0||b!=0)
	{
		if((a%2)==1&&(b%2)==1)
			return false;
		a/=2,b/=2;
	}
	a=num1,b=num2;
	while(a!=0||b!=0)
	{
		if((a%3)+(b%2)>=3)
			return false;
		a/=3,b/=3;
	}
	return true;
}

int main()  
{
	cin>>n;
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
			if(check(i,j))
				cnt++;
	cout<<cnt;
	return 0;
}

Details

小提示:点击横条可展开更详细的信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 1196kb

input:

2

output:

1

result:

wrong answer 1st numbers differ - expected: '0', found: '1'

Subtask #2:

score: 0
Wrong Answer

Test #3:

score: 0
Wrong Answer
time: 0ms
memory: 1196kb

input:

92

output:

506

result:

wrong answer 1st numbers differ - expected: '348', found: '506'

Subtask #3:

score: 0
Wrong Answer

Test #5:

score: 0
Wrong Answer
time: 6ms
memory: 1192kb

input:

939

output:

14541

result:

wrong answer 1st numbers differ - expected: '7730', found: '14541'

Subtask #4:

score: 0
Wrong Answer

Test #7:

score: 0
Wrong Answer
time: 101ms
memory: 1192kb

input:

4375

output:

148742

result:

wrong answer 1st numbers differ - expected: '58626', found: '148742'