QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#657936#7735. Primitive RootmiluosiWA 0ms3648kbC++14581b2024-10-19 15:48:222024-10-19 15:48:25

Judging History

你现在查看的是最新测评结果

  • [2024-10-19 15:48:25]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3648kb
  • [2024-10-19 15:48:22]
  • 提交

answer

#include<iostream>
#include<unordered_map>
#include<vector>
#include<algorithm>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<string.h>
#include<iomanip>
#include<queue>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
//int mod = 998244353;


int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		ull p, m;
		cin >> p >> m;
		ull k = 0,ans=0;
		for (k = 0;k*p+1<=m ; k++)
		{
			if (((k * p + 1) ^ (p - 1)) <= m)
			{
				ans++;
			}
		}
		cout << ans << endl;
	}
}

詳細信息

Test #1:

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

input:

3
2 0
7 11
1145141 998244353

output:

0
1
872

result:

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