QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#642655#5434. Binary Substringsguodong#WA 0ms3536kbC++17405b2024-10-15 15:32:302024-10-15 15:32:30

Judging History

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

  • [2024-10-15 15:32:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3536kb
  • [2024-10-15 15:32:30]
  • 提交

answer

#include <bits/stdc++.h>
#define For(i,a,b) for(int i = a; i <= b; ++i)
using namespace std;
signed main(){
#ifdef NICEGUODONG
	freopen("data.in","r",stdin);
#endif
	int n;
	cin >> n;
	int len = 1;
	string a;
	while(1){
		For(i,1,len){
			a.push_back('0');
		}
		For(i,1,len){
			a.push_back('1');
		}
		++len;
		if(a.size() > n) 
			break;
	}
	For(i,0, n - 1) 
		cout << a[i];
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3508kb

input:

2

output:

01

result:

ok meet maximum 3

Test #2:

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

input:

5

output:

01001

result:

wrong answer not meet maximum 11 < 12