QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#400543 | #5434. Binary Substrings | comeintocalm# | WA | 1ms | 3688kb | C++17 | 352b | 2024-04-27 13:36:33 | 2024-04-27 13:36:35 |
Judging History
answer
#include <bits/stdc++.h>
#define LL long long
#define db double
using namespace std;
const int MAXN = 5e3 + 5;
int n;
int main() {
int i,j,k;
int cnt = 1;
cin >> n;
while (n) {
if (n & 1) {
for (i = 0; i < (cnt >> 1); ++i) putchar ('0');
for (; i < cnt; ++i) putchar ('1');
}
cnt <<= 1;
n >>= 1;
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3648kb
input:
2
output:
01
result:
ok meet maximum 3
Test #2:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
5
output:
10011
result:
ok meet maximum 12
Test #3:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
1
output:
1
result:
ok meet maximum 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
3
output:
101
result:
ok meet maximum 5
Test #5:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
4
output:
0011
result:
ok meet maximum 8
Test #6:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
6
output:
010011
result:
ok meet maximum 16
Test #7:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
7
output:
1010011
result:
ok meet maximum 21
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3560kb
input:
8
output:
00001111
result:
wrong answer not meet maximum 24 < 27