QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#231861#5434. Binary SubstringsinvernoCompile Error//C++14320b2023-10-29 17:21:142023-10-29 17:21:14

Judging History

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

  • [2023-10-29 17:21:14]
  • 评测
  • [2023-10-29 17:21:14]
  • 提交

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) put('0');
			  else put('1');
		}
		ch^=1;
	}

    return 0;
}

详细

answer.code: In function ‘int main()’:
answer.code:12:33: error: ‘put’ was not declared in this scope; did you mean ‘putw’?
   12 |                         if (ch) put('0');
      |                                 ^~~
      |                                 putw
answer.code:13:32: error: ‘put’ was not declared in this scope; did you mean ‘putw’?
   13 |                           else put('1');
      |                                ^~~
      |                                putw