QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#718538 | #8975. Eva and Euro coins | lyinmx | WA | 1ms | 7764kb | C++17 | 860b | 2024-11-06 20:46:47 | 2024-11-06 20:46:51 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std; typedef long long ll; typedef unsigned long long ull; typedef double db;
const int N = 1e6 + 10;
mt19937 mt( (ull)( &N ) );
int Rand ( int l, int r ) { return uniform_int_distribution<int>(l,r)(mt); }
int n, k;
int F[N], G[N];
char A[N], B[N];
void Solve ()
{
cin >> n >> k;
cin >> A + 1 >> B + 1;
for( int i = 1; i <= n; ++i ) F[i] = A[i] - '0';
for( int i = 1; i <= n; ++i ) G[i] = B[i] - '0';
for( int i = n; i >= 2; --i ) F[i] ^= F[i-1], G[i] ^= G[i-1];
for( int i = 1; i + k - 1 <= n; ++i ) if( F[i] != G[i] )
G[i] ^= 1, G[i+k] ^= 1;
for( int i = 1; i <= n; ++i ) if( F[i] != G[i] ) return cout << "NO\n", void();
cout << "YES\n";
}
signed main()
{
ios::sync_with_stdio( false ), cin.tie(0), cout.tie(0); Solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 7764kb
input:
6 2 000000 101101
output:
YES
result:
wrong answer 1st lines differ - expected: 'Yes', found: 'YES'