QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#231861 | #5434. Binary Substrings | inverno | Compile Error | / | / | C++14 | 320b | 2023-10-29 17:21:14 | 2023-10-29 17:21: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) put('0');
else put('1');
}
ch^=1;
}
return 0;
}
Details
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