QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#718542 | #8975. Eva and Euro coins | lyinmx | WA | 1ms | 7732kb | C++17 | 860b | 2024-11-06 20:47:25 | 2024-11-06 20:47:26 |
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;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 7660kb
input:
6 2 000000 101101
output:
Yes
result:
ok single line: 'Yes'
Test #2:
score: 0
Accepted
time: 1ms
memory: 7660kb
input:
8 3 10101010 01010101
output:
No
result:
ok single line: 'No'
Test #3:
score: 0
Accepted
time: 1ms
memory: 7684kb
input:
10 3 0100011001 0001000000
output:
Yes
result:
ok single line: 'Yes'
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 7732kb
input:
10 3 0100001010 0000000000
output:
Yes
result:
wrong answer 1st lines differ - expected: 'No', found: 'Yes'