51,733
社区成员
发帖
与我相关
我的任务
分享
#include<bits/stdc++.h>
using namespace std;
int main()
{
char s[] = "WHERETHEREISAWILLTHEREISAWAY";
sort(s, s + 28);
cout << s;
return 0;
}
#include <iostream>
using namespace std;
long long a, b;
int main()
{
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> a >> b;
cout << b - a - (a % (b - a));
return 0;
}
#include<iostream>
using namespace std;
const int N = 1e5 + 5;
int a[N], Left[N];
int pos[(1 << 20) + 10];//空间换时间
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, m, x;
cin >> n >> m >> x;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
Left[i] = pos[a[i] ^ x];
pos[a[i]] = i;
}
while (m--)
{
int l, r;
bool bl = false;
cin >> l >> r;
for (int i = l; i <= r; i++)
{
if (Left[i] >= l )
{
bl = true;
break;
}
}
if (bl)
cout << "yes" << endl;
else
cout << "no" << endl;
}
return 0;
}