QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#585962#7733. Cool, It’s Yesterday Four Times MoremhwRE 0ms0kbC++23812b2024-09-23 23:29:052024-09-23 23:29:05

Judging History

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

  • [2024-09-23 23:29:05]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [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

result: