QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#585962 | #7733. Cool, It’s Yesterday Four Times More | mhw | RE | 0ms | 0kb | C++23 | 812b | 2024-09-23 23:29:05 | 2024-09-23 23:29:05 |
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int, int>
#define inf 0x3f3f3f3f
#define db double
#define il inline
#define x first
#define y second
#define endl '\n'
const int N = 2e5 + 5;
const int mod = 998244353;
void solve()
{
int p, m;
cin >> p >> m;
int k = m / p, ans = k;
for (int i = k; i < k + 10; i++)
{
if (((i * p + 1) ^ (p - 1)) <= m) ans++;
}
// if ((1 ^ (p - 1)) <= m) ans++;
cout << ans << endl;
}
signed main()
{
// freopen("D:\\3022244240\\vscode\\txt\\in.txt", "r", stdin);
// freopen("D:\\3022244240\\vscode\\txt\\out.txt", "w", stdout);
// ios::sync_with_stdio(false);
// cin.tie(0); cout.tie(0);
int T = 1; cin >> T;
while (T--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Runtime Error
input:
4 2 5 .OO.. O..O. 1 3 O.O 1 3 .O. 2 3 OOO OOO
output:
3