#include<bits/stdc++.h>
using namespace std;
const int N = 10;
char a[N][N];
int main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
for (int i = 1; i <= 6; i++) for (int j = 1; j <= 7; j++) {
cin >> a[i][j];
}
if (a[1][4] == '.') cout << 'o';
else if (a[6][4] == '|') cout << 'p';
else cout << 'm';
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int T; cin >> T;
while (T--) {
int n; cin >> n;
cout << (n % 4 != 0 ? "Bing\n" : "Bong\n");
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n, m, k; cin >> n >> m >> k;
int dx = n / 2 + 1, dy = m / 2 + 1, cnt = 0;
while (k --) {
int x, y; cin >> x >> y;
int dir = abs(x - dx) + abs(y - dy);
if (dir <= max(dx - 1, dy - 1)) cnt ++;
}
cout << cnt << '\n';
return 0;
}
如果当前是0 则以0后导 不过不能作为前导 则{
ans = ans + cnt + 1;
cnt *= 2;
}
如果是奇数 它可以接在任意数的前后 不过不是满足的答案 {
cnt *= 2;
}
如果是偶数 它可以放在任意数字的后面 {
ans = ans + cnt + 1;
cnt *= 2;
}
#include<bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n; cin >> n; string s; cin >> s;
int cnt = 0, ans = 0;
for (int i = 0; i < n; i++) {
int x = s[i] - '0';
if (!x) {
ans += cnt + 1;
cnt = cnt * 2;
}
else if (x & 1) {
cnt = cnt * 2 + 1;
}
else {
ans += cnt + 1;
cnt = cnt * 2 + 1;
}
cnt %= mod; ans %= mod;
}
cout << ans << '\n';
return 0;
}