QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#231864 | #5434. Binary Substrings | inverno | TL | 0ms | 3816kb | C++14 | 345b | 2023-10-29 17:22:13 | 2023-10-29 17:22:14 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0); cin.tie(0);
int n ;cin >> n;
int w = log2(n);
bool ch = 1;
for (int i = 1;i <= n;i += w){
for (int j = 1;j <= min(n-i+1,w);++ j) {
if (ch) putchar('0');
else putchar('1');
}
ch^=1;
}
putchar('\n');
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3816kb
input:
2
output:
01
result:
ok meet maximum 3
Test #2:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
5
output:
00110
result:
ok meet maximum 12
Test #3:
score: -100
Time Limit Exceeded
input:
1