ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#210929 | #2410. 图案 | _Alexande_ | 0 | 69ms | 3140kb | C++11 | 1.4kb | 2024-08-08 11:16:18 | 2024-08-08 12:39:37 |
answer
#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define fir first
#define sec second
#define mkp make_pair
#define pb push_back
#define lep( i, l, r ) for ( int i = ( l ); i <= ( r ); ++ i )
#define rep( i, r, l ) for ( int i = ( r ); i >= ( l ); -- i )
typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;
char _c; bool _f; template < class type > inline void read ( type &x ) {
_f = 0, x = 0;
while ( _c = getchar (), !isdigit ( _c ) ) if ( _c == '-' ) _f = 1;
while ( isdigit ( _c ) ) x = x * 10 + _c - '0', _c = getchar (); if ( _f ) { x = -x; }
}
template < class type > inline void chkmin ( type &x, type y ) { x = ( x <= y ? x : y ); }
template < class type > inline void chkmax ( type &x, type y ) { x = ( x >= y ? x : y ); }
const int N = 105;
int n, m;
string s;
void Solve () {
cin >> n >> m;
cin >> s;
s = " " + s;
for ( int i = 1; i <= n; i ++ ) {
int len = i / m;
if ( i == 1 ) {
cout << 0;
}
else if ( len % 2 == 0 ) {
cout << 1;
}
else {
len --;
if ( len >= i - len * m ) {
cout << 1;
}
else {
cout << 0;
}
}
}
}
signed main () {
#ifdef judge
freopen ( "Code.in", "r", stdin );
freopen ( "Code.out", "w", stdout );
freopen ( "Code.err", "w", stderr );
#endif
Solve ();
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 1252kb
input:
100 2 xxyxxyyxxyxxyypxxyxxyyxxyxxyypxxyxxyyxxyxxyypwxxyxxyyxxyxxyypxxyxxyyxxyxxyypxxyxxyyxxyxxyypwex...
output:
0001110111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
result:
wrong answer 1st lines differ - expected: '010001000000010000000000000001...000000000000000000000010...
Subtask #2:
score: 0
Wrong Answer
Test #14:
score: 0
Wrong Answer
time: 0ms
memory: 1256kb
input:
100 2 xxyxxyyxxyxxyypxxyxxyyxxyxxyypxxyxxyyxxyxxyypwxxyxxyyxxyxxyypxxyxxyyxxyxxyypxxyxxyyxxyxxyypwex...
output:
0001110111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
result:
wrong answer 1st lines differ - expected: '010001000000010000000000000001...000000000000000000000010...
Subtask #3:
score: 0
Wrong Answer
Test #51:
score: 0
Wrong Answer
time: 69ms
memory: 3140kb
input:
1000000 23 cicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicicic...
output:
0111111111111111111111000000000000000000000001111111111111111111111100000000000000000000000111111111...
result:
wrong answer 1st lines differ - expected: '000000000000000000000000000000...111111111111111111111111...
Subtask #4:
score: 0
Wrong Answer
Test #57:
score: 0
Wrong Answer
time: 0ms
memory: 1252kb
input:
100 2 xxyxxyyxxyxxyypxxyxxyyxxyxxyypxxyxxyyxxyxxyypwxxyxxyyxxyxxyypxxyxxyyxxyxxyypxxyxxyyxxyxxyypwex...
output:
0001110111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
result:
wrong answer 1st lines differ - expected: '010001000000010000000000000001...000000000000000000000010...