QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#231864#5434. Binary SubstringsinvernoTL 0ms3816kbC++14345b2023-10-29 17:22:132023-10-29 17:22:14

Judging History

你现在查看的是最新测评结果

  • [2023-10-29 17:22:14]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:3816kb
  • [2023-10-29 17:22:13]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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

output:


result: