QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#357881 | #4832. Telepathy | iliaaaaa | 0 | 0ms | 0kb | C++20 | 921b | 2024-03-19 14:15:18 | 2024-03-19 14:15:18 |
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef long double ld;
#define F first
#define S second
#define All(x) (x).begin(), (x).end()
#define len(x) (int) (x).size()
#define pb push_back
int bit(int x, int y) {
return (x >> y) & 1;
}
void out(int x) {
for (int i = 1; i >= 0; i--)
cout << ((x >> i) & 1);
}
int get(int x, int k) {
if (!x)
return k - 1;
return __builtin_ctz(x);
}
int32_t main() {
ios:: sync_with_stdio(0), cin.tie(0), cout.tie(0);
string s, a;
vector<int> ans;
int n, k;
cin >> s >> a >> n >> k;
for (int i = 0; i < k; i++) {
int frst = -1;
for (int j = 10 * i; j < 10 * (i + 1); j++)
if (a[j] == '1') {
frst = j;
break;
}
if (frst == -1)
frst = 10 * (i + 1) - 1;
ans.pb(frst + 1);
}
for (int x: ans)
cout << x << ' ';
cout << '\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Stage 1: Program answer Runtime Error
input:
Flim 1000000 100000 1101111111100010011110111001110011110110100000111110011111111111110111110100000001001000000110111000000101110000001100111110100100000100010111001011111010001000101100101100001111011100110010010000100100100101110100100110101001001000001011111101111111001100101000010110001011011000...