QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#231865#5434. Binary SubstringsinvernoWA 0ms3744kbC++14362b2023-10-29 17:22:592023-10-29 17:23:00

Judging History

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

  • [2023-10-29 17:23:00]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3744kb
  • [2023-10-29 17:22:59]
  • 提交

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);
	if (!w) w = 1;
	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: 3616kb

input:

2

output:

01

result:

ok meet maximum 3

Test #2:

score: 0
Accepted
time: 0ms
memory: 3672kb

input:

5

output:

00110

result:

ok meet maximum 12

Test #3:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

1

output:

0

result:

ok meet maximum 1

Test #4:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

3

output:

010

result:

ok meet maximum 5

Test #5:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

4

output:

0011

result:

ok meet maximum 8

Test #6:

score: 0
Accepted
time: 0ms
memory: 3680kb

input:

6

output:

001100

result:

ok meet maximum 16

Test #7:

score: -100
Wrong Answer
time: 0ms
memory: 3580kb

input:

7

output:

0011001

result:

wrong answer not meet maximum 20 < 21