QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#118010 | #6628. Flip it and Stick it | pandapythoner# | 1 | 1ms | 4484kb | C++20 | 1.0kb | 2023-07-02 21:45:55 | 2024-05-31 18:47:37 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define flt double
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
mt19937 rnd(234);
const ll inf = 1e18;
int n, m;
vector<int> s, t;
ll solve() {
if (t[0] == 1) {
for (int i = 0; i < n; i += 1) {
s[i] ^= 1;
}
for (int i = 0; i < m; i += 1) {
t[i] ^= 1;
}
}
if (m == 1) {
for (int i = 0; i < n; i += 1) {
if (s[i] == 0) {
return -1;
}
}
return 0;
}
return -1;
}
int32_t main() {
if (1) {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
string ss, ts;
cin >> ss >> ts;
n = ss.size();
m = ts.size();
s.resize(n);
for (int i = 0; i < n; i += 1) {
s[i] = (ss[i] - '0');
}
t.resize(m);
for (int i = 0; i < m; i += 1) {
t[i] = (ts[i] - '0');
}
cout << solve() << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 1
Accepted
Test #1:
score: 1
Accepted
time: 0ms
memory: 3552kb
input:
1 0
output:
0
result:
ok 1 number(s): "0"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
1 1
output:
-1
result:
ok 1 number(s): "-1"
Test #3:
score: 0
Accepted
time: 1ms
memory: 4436kb
input:
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
-1
result:
ok 1 number(s): "-1"
Test #4:
score: 0
Accepted
time: 1ms
memory: 4484kb
input:
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
0
result:
ok 1 number(s): "0"
Test #5:
score: 0
Accepted
time: 1ms
memory: 4364kb
input:
101001000011101010101001001010010110111111001100110001111101111110110110101011111010001101111001101101010111101100000110001110001100000101111100000110111110001010101101101110001000011010000101000110110010110110100001110001111001010000000010000000101000000100110011101110100111111101111111111110010101...
output:
-1
result:
ok 1 number(s): "-1"
Test #6:
score: 0
Accepted
time: 1ms
memory: 4292kb
input:
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
0
result:
ok 1 number(s): "0"
Test #7:
score: 0
Accepted
time: 1ms
memory: 4284kb
input:
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
-1
result:
ok 1 number(s): "-1"
Subtask #2:
score: 0
Wrong Answer
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 3776kb
input:
0 01
output:
-1
result:
wrong answer 1st numbers differ - expected: '0', found: '-1'
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Test #40:
score: 0
Wrong Answer
time: 0ms
memory: 3808kb
input:
11 011
output:
-1
result:
wrong answer 1st numbers differ - expected: '0', found: '-1'
Subtask #5:
score: 0
Wrong Answer
Test #53:
score: 0
Wrong Answer
time: 0ms
memory: 3556kb
input:
11 011
output:
-1
result:
wrong answer 1st numbers differ - expected: '0', found: '-1'
Subtask #6:
score: 0
Skipped
Dependency #4:
0%