submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s979495687 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int n,mn=0,sum=0;
int main() {
cin>>n;
if(n%2==0)
{
cout<<n<<endl;
return 0;
}
for(int i=1;i<=n;++i){
int x=i;
while( x%2==0)
{
sum++;
x/=2;
}
mn=max(sum,mn);
}
cout<<mn<<endl;
return 0;
}#include <bits/stdc++.h>
using namespace std;
int n,mn=0,sum=0;
int main() {
cin>>n;
if(n%2==0)
{
cout<<n<<endl;
return 0;
}
for(int i=1;i<=n;++i){
int x=i;
while( x%2==0)
{
sum++;
x/=2;
}
mn=max(sum,mn);
}
cout<<mn<<endl;
return 0;
} | a.cc:23:2: error: stray '#' in program
23 | }#include <bits/stdc++.h>
| ^
a.cc:23:3: error: 'include' does not name a type
23 | }#include <bits/stdc++.h>
| ^~~~~~~
a.cc:25:5: error: redefinition of 'int n'
25 | int n,mn=0,sum=0;
| ^
a.cc:3:5: note: 'int n' previously declared here
3 | int n,mn=0,sum=0;
| ^
a.cc:25:7: error: redefinition of 'int mn'
25 | int n,mn=0,sum=0;
| ^~
a.cc:3:7: note: 'int mn' previously defined here
3 | int n,mn=0,sum=0;
| ^~
a.cc:25:12: error: redefinition of 'int sum'
25 | int n,mn=0,sum=0;
| ^~~
a.cc:3:12: note: 'int sum' previously defined here
3 | int n,mn=0,sum=0;
| ^~~
a.cc:26:5: error: redefinition of 'int main()'
26 | int main() {
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | int main() {
| ^~~~
|
s119096525 | p03644 | C++ | #include <iostream>
using namespace std;
int N;
int main(){
cin >> N;
int shou = 0;
for(int i = N;N > 0; N--)
{
int res = 0;
int n = N;
while(n){
if(n % 2 != 0) break;
n /= 2;
++res;
}
if(shou < res) shou = res;
}
int seikai = 1;
for(int i = 0;i < shou; i++){
seikai = seikai * 2;
}
cout << seikai << endl;
}
#include <iostream>
using namespace std;
int N;
int main(){
cin >> N;
int shou = 0;
for(int i = N;N > 0; N--)
{
int res = 0;
int n = N;
while(n){
if(n % 2 != 0) break;
n /= 2;
++res;
}
if(shou < res) shou = res;
}
int seikai = 1;
for(int i = 0;i < shou; i++){
seikai = seikai * 2;
}
cout << seikai << endl;
}
| a.cc:32:5: error: redefinition of 'int N'
32 | int N;
| ^
a.cc:4:5: note: 'int N' previously declared here
4 | int N;
| ^
a.cc:34:5: error: redefinition of 'int main()'
34 | int main(){
| ^~~~
a.cc:6:5: note: 'int main()' previously defined here
6 | int main(){
| ^~~~
|
s953961129 | p03644 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i*=2);
cout<<i/2<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:15: error: 'i' was not declared in this scope
9 | cout<<i/2<<endl;
| ^
|
s137639982 | p03644 | C++ | #include <iostream>
using namespace std;
float N;
int res = 0;
int main() {
cin >> N;
for (int i = 0; N < 1; ++i){
N = N / 2
res++;
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:10:15: error: expected ';' before 'res'
10 | N = N / 2
| ^
| ;
11 |
12 | res++;
| ~~~
|
s443247111 | p03644 | C | #include <stdio.h>
#include <stdlib.h>
int main(){
int n;
scanf_s("%d",&n);
if(n!=0){
int m_num=0;
int m_time=0;
for(int i=n;i>0;i--){
if(i%2==0){
int cnt=0;
int mem=i;
int flag=-1;
while(mem%2==0){
mem/=2;
cnt++;
}
if(mem!=1) flag=0;
else{
flag=1;
}
if(cnt>m_time){
m_time=cnt;
m_num=i;
}
else if(cnt==m_time){
if(flag==1){
m_time=cnt;
m_num=i;
}
}
}
}
printf("%d\n",m_num);
}
return 0;
} | main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
5 | scanf_s("%d",&n);
| ^~~~~~~
| scanf
|
s943174685 | p03644 | C | #include <stdio.h>
#include <stdlib.h>
int main(){
int n;
scanf_s("%d",&n);
if(n!=0){
int m_num=0;
int m_time=0;
for(int i=n;i>0;i--){
if(i%2==0){
int cnt=0;
int mem=i;
while(mem%2==0){
mem/=2;
cnt++;
}
if(cnt>m_time){
m_time=cnt;
m_num=i;
}
}
}
printf("%d\n",m_num);
}
return 0;
} | main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
5 | scanf_s("%d",&n);
| ^~~~~~~
| scanf
|
s458894571 | p03644 | C | #include<stdio.h>
int main(){
if(n>=64)printf("64");
if(n>=32&&n<64)printf("32");
if(n>=16&&n<32)printf("16");
if(n>=8&&n<16)printf("8");
if(n>=4&&n<8)printf("4");
if(n>=2&&n<4)printf("2");
return 0;
} | main.c: In function 'main':
main.c:3:8: error: 'n' undeclared (first use in this function)
3 | if(n>=64)printf("64");
| ^
main.c:3:8: note: each undeclared identifier is reported only once for each function it appears in
|
s901047003 | p03644 | C | #include<stdio.h>
int main(){
if(n>=64)printf("64");
if(n>=32&&n<64)printf("32");
if(n>=16&&n<32)printf("16");
if(n>=8&&n<16)printf("8");
if(n>=4&&n<8)printf("4");
if(n>=2&&n<4)printf("2");
if(n==1)printf("0");
return 0;
} | main.c: In function 'main':
main.c:3:8: error: 'n' undeclared (first use in this function)
3 | if(n>=64)printf("64");
| ^
main.c:3:8: note: each undeclared identifier is reported only once for each function it appears in
|
s213439984 | p03644 | C | #include<stdio.h>
int main(){
if(n>=64)printf("64");
if(n>=32&&n<64)printf("32");
if(n>=16&&n<32)printf("16");
if(n>=8&&n<16)printf("8");
if(n>=4&&n<8)printf("4");
if(n>=2&&n<4)printf("2");
if(n==1)printf("0");
return 0;
} | main.c: In function 'main':
main.c:3:8: error: 'n' undeclared (first use in this function)
3 | if(n>=64)printf("64");
| ^
main.c:3:8: note: each undeclared identifier is reported only once for each function it appears in
|
s491083997 | p03644 | C | #include <stdio.h>
#include <stdlib.h>
int main(){
int n;
scanf_s("%d",&n);
int m_num=0;
int m_time=0;
for(int i=n;i>0;i--){
if(i%2==0){
int cnt=0;
int mem=i;
while(mem%2==0){
mem/=2;
cnt++;
}
if(mem==1){
if(cnt>m_time){
m_time=cnt;
m_num=i;
}
}
}
}
printf("%d\n",m_num);
return 0;
} | main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
5 | scanf_s("%d",&n);
| ^~~~~~~
| scanf
|
s793855763 | p03644 | C | #include<stdio.h>
int n;
void pai(int a[],int &l)
{
int o=a[0];
for(int p=0;p<n;p++)
{
if(a[p]>o)
{
o=a[p];
l=p;}
}
}
int main()
{
scanf("%d",&n);
int a[100],k=0,b[100];
for(int i=1;i<n;i++)
{
int j=i; int m=0;
while(j%2==0)
{
j=j/2;m++;}
a[k]=m;
b[k]=i;k++;
}
int l;
pai(a,l);
printf("%d",b[l]);
return 0;
}
| main.c:3:22: error: expected ';', ',' or ')' before '&' token
3 | void pai(int a[],int &l)
| ^
main.c: In function 'main':
main.c:30:9: error: implicit declaration of function 'pai' [-Wimplicit-function-declaration]
30 | pai(a,l);
| ^~~
|
s309982674 | p03644 | C | #include<stdio.h>
int n;
int pai(int a[],int &l)
{
int o=a[0];
for(int p=0;p<n;p++)
{
if(a[p]>o)
{
o=a[p];
l=p;}
}
return l;}
int main()
{
scanf("%d",&n);
int a[100],k=0,b[100];
for(int i=1;i<n;i++)
{
int j=i; int m=0;
while(j%2==0)
{
j=j/2;m++;}
a[k]=m;
b[k]=i;k++;
}
int l;
pai(a,l);
printf("%d",b[l]);
return 0;
}
| main.c:3:21: error: expected ';', ',' or ')' before '&' token
3 | int pai(int a[],int &l)
| ^
main.c: In function 'main':
main.c:30:9: error: implicit declaration of function 'pai' [-Wimplicit-function-declaration]
30 | pai(a,l);
| ^~~
|
s148811220 | p03644 | C | #include<iostream>
using namespace std;
int main()
{
int a;
cin>>a;
if(a==1)cout<<"1"<<endl;
else if(2<=a&&a<4)cout<<"2"<<endl;
else if(4<=a&&a<8)cout<<"4"<<endl;
else if(8<=a&&a<16)cout<<"8"<<endl;
else if(16<=a&&a<32)cout<<"16"<<endl;
else if(32<=a&&a<64)cout<<"32"<<endl;
else if(64<=a)cout<<"64"<<endl;
return 0;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s163916343 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
if (a < 2){
cout <<"1" <<endl;
}
else if(a<4){
cout << "2" << endl;
}
else if(a<8)[
cout <<"4" <<endl;
}
else if(a<16){
cout <<"8" <<endl;
}
else if(a<32){
cout <<"16"<<endl;
}
else if(a<64){
cout <<"32"<<endl;
}
else{
cout <<"64" <<endl;
}
}
| a.cc: In function 'int main()':
a.cc:18:5: warning: capture of variable 'std::cout' with non-automatic storage duration
18 | cout <<"4" <<endl;
| ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::ostream std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:18:9: error: expected ',' before '<<' token
18 | cout <<"4" <<endl;
| ^~~
| ,
a.cc:18:10: error: expected identifier before '<<' token
18 | cout <<"4" <<endl;
| ^~
a.cc:18:22: error: expected ']' before ';' token
18 | cout <<"4" <<endl;
| ^
| ]
a.cc: In lambda function:
a.cc:18:22: error: expected '{' before ';' token
a.cc: At global scope:
a.cc:20:5: error: expected unqualified-id before 'else'
20 | else if(a<16){
| ^~~~
a.cc:23:5: error: expected unqualified-id before 'else'
23 | else if(a<32){
| ^~~~
a.cc:26:5: error: expected unqualified-id before 'else'
26 | else if(a<64){
| ^~~~
a.cc:29:1: error: expected unqualified-id before 'else'
29 | else{
| ^~~~
a.cc:32:5: error: expected declaration before '}' token
32 | }
| ^
|
s816667912 | p03644 | C++ | #include<bit/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
int ans=1;
while(ans<=n){
ans<<=1;
}
ans>>=1;
cout<<ans<<endl;
} | a.cc:1:9: fatal error: bit/stdc++.h: No such file or directory
1 | #include<bit/stdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s777857736 | p03644 | C++ | #include<iostream>
using namespace std;
int main()
{
int N;
cin >>N;
cout <<(N%2==0?N:(N-1)<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:25: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
10 | cout <<(N%2==0?N:(N-1)<<endl;
| ~~~~~^~~~~~
a.cc:10:31: error: expected ')' before ';' token
10 | cout <<(N%2==0?N:(N-1)<<endl;
| ~ ^
| )
|
s028475301 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int m=1;
while(m<=n){
m*=2;
}
m/=2;
cout<<m<<endl;
}
return 0;
} | a.cc:14:1: error: expected unqualified-id before 'return'
14 | return 0;
| ^~~~~~
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
s863775906 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long i,n;
cin>>n;
long long sum=1;
for(int i=2;i<=n;i++)
{
while(sum<=n)
{
sum=sum*2;
if(sum>n)
{
cout<<sun/2<<endl;
}
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:39: error: 'sun' was not declared in this scope; did you mean 'sum'?
14 | cout<<sun/2<<endl;
| ^~~
| sum
|
s480235383 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int ans=0;
for(int i=1; i<=n; i++){
int count=0;
int a=i;
while(a%2==0){
int a/=2;
count++;
}
if(count>ans){
ans=i;
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:12:12: error: expected initializer before '/=' token
12 | int a/=2;
| ^~
|
s398034876 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int ans=0;
for(int i=1; i<=n; i++){
int count=0;
int a=i
while(a%2==0){
int a/=2;
count++;
}
if(count>ans){
ans=i;
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'while'
11 | while(a%2==0){
| ^~~~~
|
s314425260 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N; cin >> N;
int ans = 0;
int M = 0;
for (int i = 1; i <= N; i++) {
int n = i;
int c = 0;
while (n % 2 == 0) {
n /= 2;
c++;
}
if (count > M) {
M = c;
ans = i;
}
}
count << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:15:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
15 | if (count > M) {
| ~~~~~~^~~
a.cc:20:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
20 | count << ans << endl;
| ~~~~~~^~~~~~
|
s967889602 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N; cin >> N;
int ans = 0;
int M = 0;
for (int i = 1; i <= N; i++) {
int n = i
int c = 0;
while (n % 2 == 0) {
n /= 2;
c++;
}
if (count > M) {
M = c;
ans = i;
}
}
count << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'int'
10 | int c = 0;
| ^~~
a.cc:13:7: error: 'c' was not declared in this scope
13 | c++;
| ^
a.cc:15:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
15 | if (count > M) {
| ~~~~~~^~~
a.cc:16:11: error: 'c' was not declared in this scope
16 | M = c;
| ^
a.cc:20:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
20 | count << ans << endl;
| ~~~~~~^~~~~~
|
s602462373 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N; cin >> N;
int ans = 0;
int max_count = 0;
for (int i = 1; i <= N; i++) {
int number = i
int count = 0;
while (number % 2 == 0) {
number /= 2;
count++;
}
if (count > max_count) {
max_count = count;
ans = i;
}
}
count << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'int'
10 | int count = 0;
| ^~~
a.cc:13:12: error: no post-increment operator for type
13 | count++;
| ^~
a.cc:15:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
15 | if (count > max_count) {
| ~~~~~~^~~~~~~~~~~
a.cc:16:19: error: cannot resolve overloaded function 'count' based on conversion to type 'int'
16 | max_count = count;
| ^~~~~
a.cc:20:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
20 | count << ans << endl;
| ~~~~~~^~~~~~
|
s992662388 | p03644 | C++ | #include<iostream>
using namespace std;
int main(){
int N;cin>>N;int res=0;int tmp = 1;
while(true){tmp*=2;if(tmp>N)break;res++;}
cout<<2**res<<endl;
}
| a.cc: In function 'int main()':
a.cc:6:11: error: invalid type argument of unary '*' (have 'int')
6 | cout<<2**res<<endl;
| ^~~~
|
s601382189 | p03644 | C++ | #include<iostream>
using namespace std;
int main(){
int N;cin>>N;int res=0;int tmp = 1;
while(true){tmp*=2;if(tmp>N)break;else res++}
cout<<res<<endl;
} | a.cc: In function 'int main()':
a.cc:5:47: error: expected ';' before '}' token
5 | while(true){tmp*=2;if(tmp>N)break;else res++}
| ^
| ;
|
s607606418 | p03644 | C++ | #include<iostream>
using namespace std;
int main(){
int N;cin>>N;res=0;
while(true){if(N%2==1)break;else{N/=2;res++;}}
cout<<res<<endl;
} | a.cc: In function 'int main()':
a.cc:4:16: error: 'res' was not declared in this scope
4 | int N;cin>>N;res=0;
| ^~~
|
s872468083 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
int main() {
int n;
cin >> n;
if(n>=64){
cout<<64<<endl;
}
else if(n>=32){
cout<<32<<endl;
}
else if(n>=16){
cout<<16<<endl;
}
else if(n>=8){
cout<<8<<endl;
}
else if(n>=4){
cout<<4<<endl;
}
else if(n>=2){
cout<<2<<endl;
}
} | a.cc:9:3: error: extended character is not valid in an identifier
9 | if(n>=64){
| ^
a.cc: In function 'int main()':
a.cc:9:3: error: '\U00003000if' was not declared in this scope
9 | if(n>=64){
| ^~~~
a.cc:12:3: error: 'else' without a previous 'if'
12 | else if(n>=32){
| ^~~~
|
s076965118 | p03644 | C++ | #include <iostream>
using namespace std;
int main(){
int N;cin>>N;
if (N>=64) A=64;
else if (N>=32) A=32;
else if (N>=16) A=16;
else if (N>=8) A=8;
else if (N>=4) A=4;
else if (N>=2) A=2;
else A=0;
cout<<A<<endl;
} | a.cc: In function 'int main()':
a.cc:7:14: error: 'A' was not declared in this scope
7 | if (N>=64) A=64;
| ^
a.cc:8:19: error: 'A' was not declared in this scope
8 | else if (N>=32) A=32;
| ^
a.cc:9:19: error: 'A' was not declared in this scope
9 | else if (N>=16) A=16;
| ^
a.cc:10:18: error: 'A' was not declared in this scope
10 | else if (N>=8) A=8;
| ^
a.cc:11:18: error: 'A' was not declared in this scope
11 | else if (N>=4) A=4;
| ^
a.cc:12:18: error: 'A' was not declared in this scope
12 | else if (N>=2) A=2;
| ^
a.cc:13:8: error: 'A' was not declared in this scope
13 | else A=0;
| ^
a.cc:15:9: error: 'A' was not declared in this scope
15 | cout<<A<<endl;
| ^
|
s793673204 | p03644 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int max = sc.nextInt();
boolean isEven = true;
count = 10000;
newCount = 0;
while(isEven) {
isEven = true;
newCount = 0;
for (int i = 1; i <= max; i++) {
if (i % 2 == 0) {
i = i / 2;
} else {
isEven = false;
}
}
if(count > newCount) {
count = newCount;
}
}
System.out.println(count);
}
} | Main.java:8: error: cannot find symbol
count = 10000;
^
symbol: variable count
location: class Main
Main.java:9: error: cannot find symbol
newCount = 0;
^
symbol: variable newCount
location: class Main
Main.java:13: error: cannot find symbol
newCount = 0;
^
symbol: variable newCount
location: class Main
Main.java:21: error: cannot find symbol
if(count > newCount) {
^
symbol: variable count
location: class Main
Main.java:21: error: cannot find symbol
if(count > newCount) {
^
symbol: variable newCount
location: class Main
Main.java:22: error: cannot find symbol
count = newCount;
^
symbol: variable count
location: class Main
Main.java:22: error: cannot find symbol
count = newCount;
^
symbol: variable newCount
location: class Main
Main.java:25: error: cannot find symbol
System.out.println(count);
^
symbol: variable count
location: class Main
8 errors
|
s436273662 | p03644 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tuple>
#include <map>
#include <queue>
#include <set>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define mod 1000000007
#define fst first
#define pb push_back
int calc(int x){
int cnt = 0;
while(x % 2 == 0){
x /= 2;
cnt++;
}
return cnt;
}
int main()
{
int N;
cin >> N;
vector<int> W(N);
int ans = 0;
for(int i = 1; i <= N; i++){
W[i] = calc(i);
}
sort(w.begin,w.end(), greater<int>());
cout << W[0] << endl;
} | a.cc: In function 'int main()':
a.cc:34:10: error: 'w' was not declared in this scope
34 | sort(w.begin,w.end(), greater<int>());
| ^
|
s427902505 | p03644 | C++ | N = int(input())
a = 1
if N == 1:
print(1)
else:
while N >= a:
a *= 2
print(a//2) | a.cc:1:1: error: 'N' does not name a type
1 | N = int(input())
| ^
|
s017621899 | p03644 | C++ | stream>
using namespace std ;
int main(){
int N,Max,i,j ;
cin >> N ;
int counter[N],A[N],m_A[N] ;
for(i=0;i<=N-1;i++){
A[i] = i+1 ;
m_A[i] = A[i] ;
counter[i]=0 ;
}
for(i=0;i<=N-1;i++){
while(A[i]%2==0){
counter[i]++ ;
A[i] = A[i]/2 ;
}
}
for(i=0;i<=N-1;i++){
if(counter[0] <= counter[i]){
counter[0] = counter[i] ;
m_A[0] = m_A[i] ;
Max = m_A[i] ;
}else{
Max = m_A[0] ;
}
}
cout << Max << endl ;
} | a.cc:1:1: error: 'stream' does not name a type
1 | stream>
| ^~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
7 | cin >> N ;
| ^~~
a.cc:33:3: error: 'cout' was not declared in this scope
33 | cout << Max << endl ;
| ^~~~
a.cc:33:18: error: 'endl' was not declared in this scope
33 | cout << Max << endl ;
| ^~~~
|
s695610858 | p03644 | C++ | stream>
using namespace std ;
int main(){
int N,Max,i,j ;
cin >> N ;
int counter[N],A[N],m_A[N] ;
for(i=0;i<=N-1;i++){
A[i] = i+1 ;
m_A[i] = A[i] ;
counter[i]=0 ;
}
for(i=0;i<=N-1;i++){
while(A[i]%2==0){
counter[i]++ ;
A[i] = A[i]/2 ;
}
}
for(i=0;i<=N-1;i++){
if(counter[0] <= counter[i]){
counter[0] = counter[i] ;
m_A[0] = m_A[i] ;
Max = m_A[i] ;
}else{
Max = m_A[0] ;
}
}
cout << Max << endl ;
} | a.cc:1:1: error: 'stream' does not name a type
1 | stream>
| ^~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
7 | cin >> N ;
| ^~~
a.cc:33:3: error: 'cout' was not declared in this scope
33 | cout << Max << endl ;
| ^~~~
a.cc:33:18: error: 'endl' was not declared in this scope
33 | cout << Max << endl ;
| ^~~~
|
s400832642 | p03644 | C | stream>
using namespace std ;
int main(){
int N,Max,i,j ;
cin >> N ;
int counter[N],A[N],m_A[N] ;
for(i=0;i<=N-1;i++){
A[i] = i+1 ;
m_A[i] = A[i] ;
counter[i]=0 ;
}
for(i=0;i<=N-1;i++){
while(A[i]%2==0){
counter[i]++ ;
A[i] = A[i]/2 ;
}
}
for(i=0;i<=N-1;i++){
if(counter[0] <= counter[i]){
counter[0] = counter[i] ;
m_A[0] = m_A[i] ;
Max = m_A[i] ;
}else{
Max = m_A[0] ;
}
}
cout << Max << endl ;
} | main.c:1:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>' token
1 | stream>
| ^
main.c: In function 'main':
main.c:7:3: error: 'cin' undeclared (first use in this function)
7 | cin >> N ;
| ^~~
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:3: error: 'cout' undeclared (first use in this function); did you mean 'counter'?
33 | cout << Max << endl ;
| ^~~~
| counter
main.c:33:18: error: 'endl' undeclared (first use in this function)
33 | cout << Max << endl ;
| ^~~~
|
s592023741 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
if (n < 2)
{
cout << 0;
return;
}
int v = 1;
while (true)
{
if (v * 2 > n)
{
break;
}
v *= 2;
}
cout << v;
} | a.cc: In function 'int main()':
a.cc:11:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
11 | return;
| ^~~~~~
|
s304093111 | p03644 | C++ | #include <iostream>
// #include <string>
// #include <vector>
// #include <algorithm> // to use min_element
using namespace std;
int main(){
int i=0, n;
cin >>n;
while ((int)pow(2.0, i)<n){
i++;
}
cout << (int) pow(2.0, i-1);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:21: error: 'pow' was not declared in this scope
12 | while ((int)pow(2.0, i)<n){
| ^~~
a.cc:15:23: error: 'pow' was not declared in this scope
15 | cout << (int) pow(2.0, i-1);
| ^~~
|
s081980246 | p03644 | C++ | #include <iostream>
// #include <string>
#include <math>
// #include <vector>
// #include <algorithm> // to use min_element
using namespace std;
int main(){
int i=0, n;
cin >>n;
while (pow(2, i)<n){
i++;
}
cout << pow(2, i-1);
return 0;
} | a.cc:3:10: fatal error: math: No such file or directory
3 | #include <math>
| ^~~~~~
compilation terminated.
|
s673229917 | p03644 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm> // to use min_element
using namespace std;
int main(){
int i=0, n;
cin >>n;
while (pow(2, i)<n){
i++;
}
cout << pow(2, i-1);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:16: error: 'pow' was not declared in this scope
12 | while (pow(2, i)<n){
| ^~~
a.cc:15:17: error: 'pow' was not declared in this scope
15 | cout << pow(2, i-1);
| ^~~
|
s374921689 | p03644 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> countList;
for(int i = 0; i < n; i++){
int data = i + 1;
int count = 0;
while(data % 2 == 0){
data /= 2;
count++;
}
countList.push_back(count);
}
auto iter = max_element(x.begin(), x.end());
size_t index = distance(x.begin(), iter);
cout << index << endl;
}
| a.cc: In function 'int main()':
a.cc:20:27: error: 'x' was not declared in this scope
20 | auto iter = max_element(x.begin(), x.end());
| ^
|
s102101200 | p03644 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n
cin >> n;
vector<int> countList;
for(int i = 0; i < n; i++){
int data = i + 1;
int count = 0;
while(data % 2 == 0){
data /= 2;
count++;
}
countList.push_back(count);
}
auto iter = max_element(x.begin(), x.end());
size_t index = distance(x.begin(), iter);
cout << index << endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'cin'
8 | cin >> n;
| ^~~
a.cc:10:22: error: 'n' was not declared in this scope
10 | for(int i = 0; i < n; i++){
| ^
a.cc:20:27: error: 'x' was not declared in this scope
20 | auto iter = max_element(x.begin(), x.end());
| ^
|
s433983176 | p03644 | C++ | #include <iostream>
#include <string>
using namespace std;
// int main(){
// int N;
// int large;
// int counter, high_count;
// int target;
// cin >> N;
// high_count = 0;
// target = 1;
// for(int i=1;i<N+1;i++){
// int aNumber = i;
// counter = 0;
// while(aNumber%2 == 0) aNumber /=2, counter++;
// if(counter> high_count){
// target=i;
// high_count = counter;
// }
// }
// cout << target << endl;
// }
int main(){
int N;
int target;
cin >> N;
for(int i=6; i>0;i--){
if(N >= 2^i){
cout >> 2^i >> endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:33:12: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
33 | cout >> 2^i >> endl;
| ~~~~ ^~ ~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:33:12: note: candidate: 'operator>>(int, int)' (built-in)
33 | cout >> 2^i >> endl;
| ~~~~~^~~~
a.cc:33:12: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:33:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
33 | cout >> 2^i >> endl;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:33:7: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
33 | cout >> 2^i >> endl;
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:33:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
33 | cout >> 2^i >> endl;
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:33:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
33 | cout >> 2^i >> endl;
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:33:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
33 | cout >> 2^i >> endl;
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:33:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
33 | cout >> 2^i >> endl;
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:33:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
33 | cout >> 2^i >> endl;
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:33:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
33 | cout >> 2^i >> endl;
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int]':
a.cc:33:15: required from here
33 | cout >> 2^i >> endl;
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
a.cc:33:19: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>>'
33 | cout >> 2^i >> endl;
| ~~^~~~~~~
|
s888583616 | p03644 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int N;
int large;
int counter, high_count;
int target;
cin >> N;
high_count = 0;
for(int i=1;i<N+1;i++){
counter = 0;
for(int j=1; j<N+1;j++){
if(j%2 == 0){
counter++;
j /= 2;
}else{
break
}
}
if(counter> high_count){
target=j;
high_count = counter;
}
}
cout >> target >> endl;
}
| a.cc: In function 'int main()':
a.cc:20:14: error: expected ';' before '}' token
20 | break
| ^
| ;
21 | }
| ~
a.cc:24:14: error: 'j' was not declared in this scope
24 | target=j;
| ^
a.cc:28:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
28 | cout >> target >> endl;
| ~~~~ ^~ ~~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:28:8: note: candidate: 'operator>>(int, int)' (built-in)
28 | cout >> target >> endl;
| ~~~~~^~~~~~~~~
a.cc:28:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:28:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
28 | cout >> target >> endl;
| ^~~~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:28:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
28 | cout >> target >> endl;
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:28:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
28 | cout >> target >> endl;
| ^~~~~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:28:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
28 | cout >> target >> endl;
| ^~~~~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:28:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
28 | cout >> target >> endl;
| ^~~~~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:28:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
28 | cout >> target >> endl;
| ^~~~~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:28:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
28 | cout >> target >> endl;
| ^~~~~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:28:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
28 | cout >> target >> endl;
| ^~~~~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]':
a.cc:28:11: required from here
28 | cout >> target >> endl;
| ^~~~~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
|
s169286405 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int ni(int x){
int cnt=0;
while(x%2==0){
x/=2;
cnt++;
}
return cnt;
}
int main(){
int n;
cin>>n;
int cnt=0; int ans;
for(int i=1;i<=n;i++){
if(cnt<=ni(i)){
cnt=ni(i);
ans=i;
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
30 | }
| ^
a.cc:20:11: note: to match this '{'
20 | int main(){
| ^
|
s942382438 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int ni(int x){
int cnt=0;
while(x%2==0){
x/=2;
cnt++;
}
return cnt;
}
int main(){
int n;
cin>>n;
int ans=0;
for(int i=1;i<=n;i++)if(ans<ni(i))ans=n(i);
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:24:42: error: 'n' cannot be used as a function
24 | for(int i=1;i<=n;i++)if(ans<ni(i))ans=n(i);
| ~^~~
|
s366798282 | p03644 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
if(a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
void print(const std::vector<int> &v) {
std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
std::cout << std::endl;
}
int main() {
int N;
cin >> N;
for(int i = 1; i < count; i *= 2) {
if(i > N) {
cout << i / 2 << endl;
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:36:22: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
36 | for(int i = 1; i < count; i *= 2) {
| ~~^~~~~~~
|
s040076041 | p03644 | C++ |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
int max_count = 0;
for (int i = 1; i < N+1; ++i) {
int i1 = i;
int count = 0;
while (true) {
bool flg = false;
if (i1 == 0 || i1 == 1) break;
if (i1 % 2 != 0) {
flg = true;
}
if (flg) break;
i1= i1 / 2;
count += 1;
if (max_count < count) {
max_count = count;
}
}
}
cout << pow(2 , max_count) << endl;
} | a.cc: In function 'int main()':
a.cc:38:17: error: 'pow' was not declared in this scope
38 | cout << pow(2 , max_count) << endl;
| ^~~
|
s305311289 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
for(int i=0;i<n;i++) {
if(power(2,i)>n) {
cout << power(2,i-1) << endl;
break;
}
}
} | a.cc: In function 'int main()':
a.cc:7:8: error: 'power' was not declared in this scope
7 | if(power(2,i)>n) {
| ^~~~~
|
s075823184 | p03644 | C++ | using System;
class BreakNumber
{
static void Main(){
var a=int.Parse(Console.ReadLine());
int b,c=0;
for(b=0;b<=6;b++)if(a>=(int)Math.Pow((double)2,(double)b))c=(int)Math.Pow((double)2,(double)b);
Console.Write("{0}",c);
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:10:2: error: expected ';' after class definition
10 | }
| ^
| ;
a.cc: In static member function 'static void BreakNumber::Main()':
a.cc:5:9: error: 'var' was not declared in this scope
5 | var a=int.Parse(Console.ReadLine());
| ^~~
a.cc:7:25: error: 'a' was not declared in this scope
7 | for(b=0;b<=6;b++)if(a>=(int)Math.Pow((double)2,(double)b))c=(int)Math.Pow((double)2,(double)b);
| ^
a.cc:7:33: error: 'Math' was not declared in this scope
7 | for(b=0;b<=6;b++)if(a>=(int)Math.Pow((double)2,(double)b))c=(int)Math.Pow((double)2,(double)b);
| ^~~~
a.cc:8:5: error: 'Console' was not declared in this scope
8 | Console.Write("{0}",c);
| ^~~~~~~
|
s048569780 | p03644 | C++ | using System;
class BreakNumber
{
static void Main(){
var a=int.Parse(Console.ReadLine());
int b,c=0;
for(b=0;b<=6;b++)if(a>=(int)Math.Pow(2,b))c=(int)Math.Pow(2,b);
Console.Write("{0}",c);
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:10:2: error: expected ';' after class definition
10 | }
| ^
| ;
a.cc: In static member function 'static void BreakNumber::Main()':
a.cc:5:9: error: 'var' was not declared in this scope
5 | var a=int.Parse(Console.ReadLine());
| ^~~
a.cc:7:25: error: 'a' was not declared in this scope
7 | for(b=0;b<=6;b++)if(a>=(int)Math.Pow(2,b))c=(int)Math.Pow(2,b);
| ^
a.cc:7:33: error: 'Math' was not declared in this scope
7 | for(b=0;b<=6;b++)if(a>=(int)Math.Pow(2,b))c=(int)Math.Pow(2,b);
| ^~~~
a.cc:8:5: error: 'Console' was not declared in this scope
8 | Console.Write("{0}",c);
| ^~~~~~~
|
s915725085 | p03644 | C++ | int main() {
int N,cnt;
cin >> N;
int maxnum=0,maxcnt=0;
for (int i=N;i>0;i--) {
cnt = 0;
int num = i;
while (true) {
cnt++;
if (num%2) break;
num /= 2;
}
if (cnt > maxcnt) {
maxcnt = cnt;
maxnum = i;
}
}
cout << maxnum << endl;
} | a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> N;
| ^~~
a.cc:18:5: error: 'cout' was not declared in this scope
18 | cout << maxnum << endl;
| ^~~~
a.cc:18:23: error: 'endl' was not declared in this scope
18 | cout << maxnum << endl;
| ^~~~
|
s415037681 | p03644 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int main(){
int n;
cin >> n;
for(int i=6;i>=0;i--)
{
if(pow(2,i)<=n)
{
cout<<pow(2,i)<<endl;
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:11:12: error: 'pow' was not declared in this scope
11 | if(pow(2,i)<=n)
| ^~~
|
s446470567 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b=1,c=1;
cin>>a;
for(int i=0;i<8;i++){
b*=2
if(a>b)
c=b;
}
cout<<c<<endl;
} | a.cc: In function 'int main()':
a.cc:8:9: error: expected ';' before 'if'
8 | b*=2
| ^
| ;
9 | if(a>b)
| ~~
|
s415563562 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m=0,c=0;
cin>>n;
for(int i=1;i=<n;i++){
for(int j=i;;j>>=1){
if(j%2!=0) break;
c++;
}
m=max(m,c);
c=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:19: error: expected primary-expression before '<' token
7 | for(int i=1;i=<n;i++){
| ^
|
s184232544 | p03644 | C++ | // template
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<long long, long long> LP;
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define REP_AB(i, a, b) for (int i = int(a); i <= int(b); ++i)
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)), v.end());
#define SIZE(x) ((ll)(x).size())
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a / gcd(a, b)) * b;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
#define out cout
#define in cin
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
// template end
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
in >> n;
ll ans = 1;
REP(i, 8){
if (pow(2, i) < n){
ans = pow(2, i)
}
}
out << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:34:28: error: expected ';' before '}' token
34 | ans = pow(2, i)
| ^
| ;
35 | }
| ~
|
s163024786 | p03644 | C++ | #include<stdio.h>
int main(void)
{
int n,j,i,s;
scanf("%d",&n);
s=0;
for(i=1;i<=n;i++){
while(i%2==0){
i=i/2;
j=j+1;
}
if(j>s){
i=s;
}
}
printf("%d\n",s);
return 0;
| a.cc: In function 'int main()':
a.cc:17:18: error: expected '}' at end of input
17 | return 0;
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s131598697 | p03644 | C | #include <iostream>
using namespace std;
int main(){
int N,count=0;cin >> N;
while(N%2==0){
count++;
}
cout << count <<endl;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s032960436 | p03644 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main() {
int n,c=0;
cin >> n;
while (true) {
if (n < pow(2, c)) {
break;
}
c++;
}
cout << pow(2, c - 1) << endl;
}
| a.cc: In function 'int main()':
a.cc:12:25: error: 'pow' was not declared in this scope
12 | if (n < pow(2, c)) {
| ^~~
a.cc:18:17: error: 'pow' was not declared in this scope
18 | cout << pow(2, c - 1) << endl;
| ^~~
|
s341288781 | p03644 | C++ | #include"stdafx.h"
#include <iostream>
# include<string>
using namespace std;
int waru(int N, int kaisuu);
int main() {
int N;
int max=0;
int kekka=0;
cin >> N;
for (int i = 1; i <= N; i++) {
int kaisuu = 0;
kaisuu = waru(i, kaisuu);
if (max < kaisuu) {
max = kaisuu;
kekka = i;
}
}
cout << kekka << endl;
}
int waru(int N, int kaisuu) {
if (N % 2 != 0) {
return kaisuu;
}
kaisuu = waru(N/2, kaisuu);
kaisuu++;
return kaisuu;
} | a.cc:1:9: fatal error: stdafx.h: No such file or directory
1 | #include"stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s238391576 | p03644 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define debug(x) cout << #x << " = " << (x) << endl;
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
int main() {
int N; cin << N;
int ans = 1;
rep(i,5) {
if (N < ans) {
cout << ans/2 < endl;
break;
}
ans *= 2;
}
} | a.cc: In function 'int main()':
a.cc:21:14: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
21 | int N; cin << N;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:21:14: note: candidate: 'operator<<(int, int)' (built-in)
21 | int N; cin << N;
| ~~~~^~~~
a.cc:21:14: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:21:10: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
21 | int N; cin << N;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived |
s518968241 | p03644 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define debug(x) cout << #x << " = " << (x) << endl;
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
int main() {
int N; cin << N;
ans = 1;
rep(i,5) {
if (N < ans) {
cout << ans/2 < endl;
break;
}
ans *= 2;
}
} | a.cc: In function 'int main()':
a.cc:21:14: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
21 | int N; cin << N;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:21:14: note: candidate: 'operator<<(int, int)' (built-in)
21 | int N; cin << N;
| ~~~~^~~~
a.cc:21:14: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:21:10: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
21 | int N; cin << N;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
21 | int N; cin << N;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:21:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived |
s194307848 | p03644 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(x) sort(x.begin(),x.end())
#define REVE(x) reverse(x.begin(),x.end())
#define all(x) (x).begin(),(x).end()
#define fst first
#define mp make_pair
#define pb push_back
using LL = long long;
using ULL = unsigned long long;
#define FOR(i, m, n) for(int i = m;i < n;i++)
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int N, A, B, C, D;
cin >> N;
for(int i;i<=N;A*=2){
A=i;
}
cout << A;
}
} | a.cc:33:1: error: expected declaration before '}' token
33 | }
| ^
|
s982788061 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
if(n<2)cout<<n<<endl;
else if(n<4)cout<<2<<endl;
else if(n<8)cout<<4<<endl;
else if(n<16)cout<<8<<endl;
else if(n<32)cout<<16<<endl;
else if(n<64)cout<<32<<<endl;
else cout<<64<<endl;
} | a.cc: In function 'int main()':
a.cc:11:26: error: expected primary-expression before '<' token
11 | else if(n<64)cout<<32<<<endl;
| ^
|
s393723663 | p03644 | C++ | include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(){
int n;
cin >> n;
int ans = 0;
for (int i=1;i<=n;++i){
int count = 0;
while (i % 2 == 0 && i != 0){
++count;
i = i / 2;
}
if (ans < count) ans = count;
}
cout << ans << endl;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <stdio.h>
| ^~~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared
173 | void operator delete[](void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function
179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
179 | _GLIBCXX_ |
s000484575 | p03644 | C++ | #include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(){
int n;
cin >> n;
int ans = 0;
for (int i=1;i<=n;++i){
int count = 0;
while (i % 2 == 0 && i != 0){
++count;
i = i / 2;
}
if (ans < count) ans = count;
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
19 | }
| ^
a.cc:7:11: note: to match this '{'
7 | int main(){
| ^
|
s067717843 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,i,two;
cin >> n;
two = 1;
while (true) {
if (n > two) {
two = two * 2;
}
else if (n == two) {
cout << two << endl;
break;
}
else if (n < two) {
two = two/2;
cour << two << endl;
break;
}
}
}
| a.cc: In function 'int main()':
a.cc:21:7: error: 'cour' was not declared in this scope
21 | cour << two << endl;
| ^~~~
|
s468105014 | p03644 | C++ | u si n g namespace s t d ;
i n t main ( ) {
i n t n ;
ci n >> n ;
f o r ( i n t i = 0 ; i < 2 0; i++) {
i f ( n < (1<<( i +1))) {
c ou t << (1<< i ) << e n dl ;
break ;
}
}
r e t u r n 0 ;
} | a.cc:1:1: error: 'u' does not name a type
1 | u si n g namespace s t d ;
| ^
a.cc:2:1: error: 'i' does not name a type
2 | i n t main ( ) {
| ^
|
s670212433 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
cout << min({n - max(1,2,4,8,16,32,64)} << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:23: error: no matching function for call to 'max(int, int, int, int, int, int, int)'
7 | cout << min({n - max(1,2,4,8,16,32,64)} << endl;
| ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 7 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 7 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 7 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate expects 2 arguments, 7 provided
a.cc:7:42: error: expected ')' before '<<' token
7 | cout << min({n - max(1,2,4,8,16,32,64)} << endl;
| ~ ^~~
| )
|
s753179975 | p03644 | Java | import java.util.Scanner;
public class ABC068_B {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int i = 0;
for(i = 1; i <= n; i = i * 2) {
}
i = i / 2;
System.out.println(i);
}
} | Main.java:3: error: class ABC068_B is public, should be declared in a file named ABC068_B.java
public class ABC068_B {
^
1 error
|
s005071228 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
if(N!=1){
for(int i=0;i<N;i++){
if(pow(2,i)>N){
cout<<pow(2,i-1)<<endl;
}
}
else{
cout<<1<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:15:5: error: expected '}' before 'else'
15 | else{
| ^~~~
a.cc:7:11: note: to match this '{'
7 | if(N!=1){
| ^
|
s856991255 | p03644 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
ll n;
ci(n);
FOR(i,0,10){
if(pow(2,i)>n) {
co(pow(2,i-1)
break;
}
}
} | a.cc:84:11: error: unterminated argument list invoking macro "co"
84 | }
| ^
a.cc: In function 'int main()':
a.cc:80:7: error: 'co' was not declared in this scope
80 | co(pow(2,i-1)
| ^~
a.cc:80:9: error: expected '}' at end of input
80 | co(pow(2,i-1)
| ^
a.cc:79:20: note: to match this '{'
79 | if(pow(2,i)>n) {
| ^
a.cc:80:9: error: expected '}' at end of input
80 | co(pow(2,i-1)
| ^
a.cc:78:14: note: to match this '{'
78 | FOR(i,0,10){
| ^
a.cc:80:9: error: expected '}' at end of input
80 | co(pow(2,i-1)
| ^
a.cc:75:15: note: to match this '{'
75 | signed main() {
| ^
|
s534356853 | p03644 | C++ | #include<iostream>
using namespace std;
int main() {
int N; cin >> N;
int maxCount = 0, int res = 1;
for (int i = 1; i <= N; i++) {
int count = 0;
int j = i;
while (j % 2 == 0) {
j /= 2;
count += 1;
}
if (maxCount > count) {
maxCount = count;
res = i;
}
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:6:21: error: expected unqualified-id before 'int'
6 | int maxCount = 0, int res = 1;
| ^~~
a.cc:16:7: error: 'res' was not declared in this scope
16 | res = i;
| ^~~
a.cc:19:11: error: 'res' was not declared in this scope
19 | cout << res << endl;
| ^~~
|
s598713494 | p03644 | C++ | #include<iostream>
using namespace std;
int main() {
int N; cin >> N;
int maxCount = 0, int res = 1;
for (int i = 1; i <= N; i++) {
int count = 0;
int j = i;
while (j % 2 == 0) {
j /= 0;
count += 1;
}
if (maxCount > count) {
maxCount = count;
res = i;
}
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:6:21: error: expected unqualified-id before 'int'
6 | int maxCount = 0, int res = 1;
| ^~~
a.cc:11:9: warning: division by zero [-Wdiv-by-zero]
11 | j /= 0;
| ~~^~~~
a.cc:16:7: error: 'res' was not declared in this scope
16 | res = i;
| ^~~
a.cc:19:11: error: 'res' was not declared in this scope
19 | cout << res << endl;
| ^~~
|
s842458006 | p03644 | C++ | #include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
int answer = 0;
for (int i = 0; i < N; i++) {
if (N >= pow(i, 2)) {
answer = i;
}
else break;
}
cout << pow(answer, 2) << endl;
} | a.cc: In function 'int main()':
a.cc:11:14: error: 'pow' was not declared in this scope
11 | if (N >= pow(i, 2)) {
| ^~~
a.cc:17:11: error: 'pow' was not declared in this scope
17 | cout << pow(answer, 2) << endl;
| ^~~
|
s021336236 | p03644 | C++ | #include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
int answer = 0;
for (int i = 0; i < N; i++) {
if (N >= 2**i) {
answer = i;
}
else break;
}
cout << 2**answer << endl;
} | a.cc: In function 'int main()':
a.cc:11:16: error: invalid type argument of unary '*' (have 'int')
11 | if (N >= 2**i) {
| ^~
a.cc:17:13: error: invalid type argument of unary '*' (have 'int')
17 | cout << 2**answer << endl;
| ^~~~~~~
|
s645870124 | p03644 | C++ | #include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
int answer = 0;
while (true) {
for (int i = 0; i < N; ++i) {
if (N >= 2**i) {
answer = i;
}
else break;
}
}
cout << 2**answer << endl;
} | a.cc: In function 'int main()':
a.cc:12:18: error: invalid type argument of unary '*' (have 'int')
12 | if (N >= 2**i) {
| ^~
a.cc:19:13: error: invalid type argument of unary '*' (have 'int')
19 | cout << 2**answer << endl;
| ^~~~~~~
|
s997684451 | p03644 | C++ | #include <iostream>
using namespace std;
int main () {
int N;
cin>>N;
int a =-1;
for (int i=1;i<N+1;i*=2) {
a = i
}
cout << a<<endl;
} | a.cc: In function 'int main()':
a.cc:9:10: error: expected ';' before '}' token
9 | a = i
| ^
| ;
10 | }
| ~
|
s663914814 | p03644 | C++ | #include<cstdio>
#include<iostream>
using namespace std;
int main(void)
{
int N;
int log = 0;
cin >> N;
log = log2(N);
cout << pow(2, log);
} | a.cc: In function 'int main()':
a.cc:12:15: error: 'log2' was not declared in this scope; did you mean 'log'?
12 | log = log2(N);
| ^~~~
| log
a.cc:14:17: error: 'pow' was not declared in this scope
14 | cout << pow(2, log);
| ^~~
|
s920080662 | p03644 | C++ | #include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(void)
{
int N;
cin >> N;
int log = log2(N);
cout << pow(2, log);
} | a.cc: In function 'int main()':
a.cc:14:19: error: 'log2' was not declared in this scope; did you mean 'log'?
14 | int log = log2(N);
| ^~~~
| log
a.cc:16:17: error: 'pow' was not declared in this scope
16 | cout << pow(2, log);
| ^~~
|
s943501801 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N = 0;
cin>>N;
if (N == 1){
cout<<1<<endl;
}
else if (2<=N && N<=3){
cout<<2<<endl;
}
else if (4<=N && N<=7){
cout<<4<<endl;
}
else if (8<=N && N<=15){
cout<<8<<endl;
}
else if (16<=N && N<=31){
cout<<16<<endl;
}
else if (32<=N && N<=63){
cout<<32<<endl;
}
else{
cout<<64<<endl;
} | a.cc: In function 'int main()':
a.cc:28:4: error: expected '}' at end of input
28 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s527525242 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N = 0;
cin>>N;
if (N == 1){
cout<<1<<endl;
}
else if (2<=N && N<=3){
cout<<2<<endl;
}
else if (4<=N && N<=7){
cout<<4<<endl;
}
else if (8<=N && N<=15){
cout<<8<<endl;
}
else if (16<=N && N<=31){
cout<<16><<endl;
}
else if (32<=N && N<=63){
cout<<32<<endl;
}
else{
cout<<64<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:21:14: error: expected primary-expression before '<<' token
21 | cout<<16><<endl;
| ^~
|
s527388611 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N = 0;
cin>>N;
if (N == 1){
cout>>1>>endl;
}
else if (2<=N && N<=3){
cout>>2>>endl;
}
else if (4<=N && N<=7){
cout>>4>>endl;
}
else if (8<=N && N<=15){
cout>>8>>endl;
}
else if (16<=N && N<=31){
cout>>16>>endl;
}
else if (32<=N && N<=63){
cout>>32>>endl;
}
else{
cout>>64>>endl;
}
} | a.cc: In function 'int main()':
a.cc:9:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
9 | cout>>1>>endl;
| ~~~~^~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:9:10: note: candidate: 'operator>>(int, int)' (built-in)
9 | cout>>1>>endl;
| ~~~~^~~
a.cc:9:10: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:9:6: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
9 | cout>>1>>endl;
| ^~~~
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout>>1>>endl;
| ^
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int]':
a.cc:9:12: required from here
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout>>1>>endl;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 | cout>>1>>endl;
| ^
/usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)'
207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:207:5: note: template argument deduction/substitution failed:
a.cc:9:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
9 |
s163428382 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N = 0;
cin>>N;
if (N == 1){
return 1;
}
else if (2<=N && N<=3){
return 2;
}
else if (4<=N && N<=7){
return 4;
}
else if (8<=N && N<=15){
return 8;
}
else if (16<=N && N<=31){
return 16;
}
else if (32<=N && N<=63){
return 32;
}
else{
return 64:
}
}
| a.cc: In function 'int main()':
a.cc:27:14: error: expected ';' before ':' token
27 | return 64:
| ^
| ;
a.cc:27:14: error: expected primary-expression before ':' token
|
s312970147 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N = 0;
cin>>N;
if (N == 1){
return 1;
}
else if (2<=N<=3){
return 2;
}
else if (4<=N<=7){
return 4;
}
else if (8<=N<=15){
return 8;
}
else if (16<=N<=31){
return 16;
}
else if (32<=N<=63){
return 32;
}
else{
return 64:
}
}
| a.cc: In function 'int main()':
a.cc:27:14: error: expected ';' before ':' token
27 | return 64:
| ^
| ;
a.cc:27:14: error: expected primary-expression before ':' token
|
s992817967 | p03644 | C++ | #include <iostream>
using namespace std;
int main() {
int N;
cin >> N >> ;
if (N >= 64 && 100 >= N)
{
cout << 64 << endl;
}
if (N >= 32 && 63 >= N)
{
cout << 32 << endl;
}
if (N >= 16 && 31 >= N)
{
cout << 16 << endl;
}
if (N >= 8 && 15 >= N)
{
cout << 8 << endl;
}
if (N >= 4 && 7 >= N)
{
cout << 4 << endl;
}
if (N >= 2 && 3 >= N)
{
cout << 2 << endl;
}
if (N == 1)
{
cout << 1 << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:21: error: expected primary-expression before ';' token
6 | cin >> N >> ;
| ^
|
s546475869 | p03644 | C++ | #include <iostream>
using namespace std;
int main() {
int N;
cin>>N>>endl;
if(N>=64&&100>=N)
{
cout<<64<<endl;
}
if(N>=32&&63>=N)
{
cout<<32<<endl;
}
if(N>=16&&31>=N)
{
cout<<16<<endl;
}
if(N>=8&&15>=N)
{
cout<<8<<endl;
}
if(N>=4&&7>=N)
{
cout<<4<<endl;
}
if(N>=2&&3>=N)
{
cout<<2<<endl;
}
if(N==1)
{
cout<<1<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:8: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
6 | cin>>N>>endl;
| ~~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
352 | operator>>(__streambuf_type* __sb);
| ^~~~~~~~
/usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'}
352 | operator>>(__streambuf_type* __sb);
| ~~~~~~~~~~~~~~ |
s756995059 | p03644 | C | #include <stdio.h>
int main()
{
int n, i, x, qTmp, tmp, qSum = 0;;
scanf("%d", &n);
for (i = 1; i <= n; i++)
{
tmp = 0;
x = i;
while (true)
{
if (x % 2 == 0)
{
tmp++;
}
x /= 2;
if (x <= 1)
break;
}
if (tmp > qSum) {
qSum = tmp;
qTmp = i;
}
}
printf("%d", qTmp);
return 0;
} | main.c: In function 'main':
main.c:12:24: error: 'true' undeclared (first use in this function)
12 | while (true)
| ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include <stdio.h>
+++ |+#include <stdbool.h>
2 |
main.c:12:24: note: each undeclared identifier is reported only once for each function it appears in
12 | while (true)
| ^~~~
|
s535224344 | p03644 | C | #include<stdio.h>
int main(void)
{
int N,num=1;
int i;
scanf("%d",&N);
for(i=0;i<7;i++){
num=num*2;
if(num>N){
printf("%d",num/2);
}
if(num==N){
printf("%d",num);
}
return 0;
} | main.c: In function 'main':
main.c:18:3: error: expected declaration or statement at end of input
18 | }
| ^
|
s477501573 | p03644 | C++ | #include<stdio.h>
int main(void){
int n;
int num=1;
int i=1;
scanf("%d",&n);
while(i=<n){
i=i*2;
num=i;
}
if(i>=num){
printf("%d",num/2);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before '<' token
8 | while(i=<n){
| ^
|
s629292489 | p03644 | C++ | #include<stdio.h>
int main(void)
{
int i,n,max=0,maxn,s=0,a;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
a=i;
while(a%2==0)
{
s++;
a=a/2;
}
if(s>max){max=s;maxn=i;}
s=0;
} | a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s012115265 | p03644 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <stdio.h>
#include <set>
#include <vector>
using namespace std;
int main(){
int n;
cin>>n;
int max = 0;
int tmp = 0;
int tmp2 = 0;
for(i=1; i<=n; i++){
tmp2 = i;
tmp = 0;
while(1){
if(tmp2%2==0){
tmp2 = tmp2/2;
tmp++;
}
else{
if(max<tmp){
max = tmp;
}
break;
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:9: error: 'i' was not declared in this scope
17 | for(i=1; i<=n; i++){
| ^
|
s929982424 | p03644 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <stdio.h>
#include <set>
#include <vector>
using namespace std;
int main(){
int n;
cin>>n;
int max = 0;
int tmp = 0;
int tmp2 = 0;
for(i=1; i<=n; i++){
tmp2 = i;
whiel(1){
if(tmp2%2==0){
tmp2 = tmp2/2;
tmp++;
}
else{
if(max<tmp){
max = tmp;
}
break;
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:9: error: 'i' was not declared in this scope
17 | for(i=1; i<=n; i++){
| ^
a.cc:19:9: error: 'whiel' was not declared in this scope
19 | whiel(1){
| ^~~~~
|
s230874507 | p03644 | C++ | #include <iostream>
using namespace std;
void main() {
int n;
cin >> n;
int i = 1;
int ans = 1;
while (i <= 100) {
i *= 2;
if (i > n) {
cout << ans << endl;
return;
}
ans = i;
}
return;
} | a.cc:5:1: error: '::main' must return 'int'
5 | void main() {
| ^~~~
a.cc: In function 'int main()':
a.cc:15:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
15 | return;
| ^~~~~~
a.cc:20:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
20 | return;
| ^~~~~~
|
s444175921 | p03644 | C++ | #include<stdio.h>
#include<math.h>
int main (){
int n;
int a;
int i;
scanf("%d",&n);
for(i=0;a<=n;i++){
a=(int)pow(2,(double)i);
}
printf("%d",a/2);
return 0; | a.cc: In function 'int main()':
a.cc:12:18: error: expected '}' at end of input
12 | return 0;
| ^
a.cc:3:12: note: to match this '{'
3 | int main (){
| ^
|
s597503575 | p03644 | C++ | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int p = 0;
for (int i = 0;i < n;i++) {
if (std::pow(2, i) > n) {
p = i - 1;
break;
}
}
cout << std::pow(2, p) << endl;
}
| a.cc: In function 'int main()':
a.cc:11:26: error: 'pow' is not a member of 'std'
11 | if (std::pow(2, i) > n) {
| ^~~
a.cc:17:22: error: 'pow' is not a member of 'std'
17 | cout << std::pow(2, p) << endl;
| ^~~
|
s427077569 | p03644 | C++ |
#include "pch.h"
#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
int p = 0;
for (int i = 0;i < n;i++) {
if (pow(2, i) > n) {
p = i - 1;
break;
}
}
cout << pow(2, p) << endl;
}
| a.cc:2:10: fatal error: pch.h: No such file or directory
2 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s011917172 | p03644 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
int p = 0;
for (int i = 0;i < n;i++) {
if (pow(2, i) > n) {
p = i - 1;
break;
}
}
cout << pow(2, p) << endl;
}
| a.cc: In function 'int main()':
a.cc:12:21: error: 'pow' was not declared in this scope
12 | if (pow(2, i) > n) {
| ^~~
a.cc:18:17: error: 'pow' was not declared in this scope
18 | cout << pow(2, p) << endl;
| ^~~
|
s118886507 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N, max = 0;
cin >> N;
for (i = 1; i < N; i++){
int n = i, count = 0;
while(n%2 == 0){
count++;
n /= 2;
}
if(max < count){
max = count;
}
}
cout << count << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
8 | for (i = 1; i < N; i++){
| ^
a.cc:19:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
19 | cout << count << endl;
| ~~~~~^~~~~~~~
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Trai |
s342743314 | p03644 | Java | import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
while(n>=answer){
answer *= 2;
}
System.out.println(answer/2);
}
} | Main.java:6: error: cannot find symbol
while(n>=answer){
^
symbol: variable answer
location: class Main
Main.java:7: error: cannot find symbol
answer *= 2;
^
symbol: variable answer
location: class Main
Main.java:9: error: cannot find symbol
System.out.println(answer/2);
^
symbol: variable answer
location: class Main
3 errors
|
s822617443 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >>N;
vector<int> counter(N,0);
for(int i=1;i<=N;i++){
while(i>0){
if(i%2>0)
break;
i/=2;
conter.at(i)++;
}
}
sort(counter.begin(),counter.end());
cout <<counter.at(N-1) <<endl;
} | a.cc: In function 'int main()':
a.cc:13:7: error: 'conter' was not declared in this scope; did you mean 'counter'?
13 | conter.at(i)++;
| ^~~~~~
| counter
|
s194779215 | p03644 | C++ | #include <iostream>
using namespace std;
int main(){
//cout<<"hello"<<endl;
int N;cin>>N;
int ans=0;
int nums[110];
for(int i=0;i<N;i++){
nums[i]=i+1; //1以上N以下
}
int maxNumDividableByTwo=1;
int maxNumDividableByTwo_times=0;
for(int i=0;i<N;i++){
int numDividableByTwo_times=0;
int numsForWhile=nums[i];
while(numsForWhile%2==0){//無限ループ注意
//無限ループに陥っているプログラムを終了しないとコンパイルに通らない
numsForWhile/=2;
numDividableByTwo_times++;
}
if(numDividableByTwo_times>maxNumDividableByTwo_times){
maxNumDividableByTwo=nums[i];
maxNumDividableByTwo_times=numDividableByTwo_times;
}
}
| a.cc: In function 'int main()':
a.cc:29:6: error: expected '}' at end of input
29 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.