submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s455538135 | p03644 | C++ | #include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
int main() {
int n;
cin >> n;
int cnt = 0;
for (int i=0;n > 0;i++) {
n /= 2;
cnt++;
}
cout << pow(2, cnt-1) << endl;
} | a.cc: In function 'int main()':
a.cc:31:17: error: 'pow' was not declared in this scope
31 | cout << pow(2, cnt-1) << endl;
| ^~~
|
s188670130 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int x = 1;
whlie(x <= n)
x <<= 1;
x/=2;
cout << x;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:2: error: 'whlie' was not declared in this scope
7 | whlie(x <= n)
| ^~~~~
|
s200345350 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
if(n=>1 && n<2)cout << 1 << endl;
if(n=>2 && n<4)cout << 2 << endl;
if(n=>4 && n<8)cout << 4 << endl;
if(n=>8 && n<16)cout << 8 << endl;
if(n=>16 && n<32)cout << 16 << endl;
if(n=>32 && n<64)cout << 32 << endl;
if(n=>64 && n<100)cout << 64 << endl;
}
| a.cc: In function 'int main()':
a.cc:8:8: error: expected primary-expression before '>' token
8 | if(n=>1 && n<2)cout << 1 << endl;
| ^
a.cc:9:8: error: expected primary-expression before '>' token
9 | if(n=>2 && n<4)cout << 2 << endl;
| ^
a.cc:10:8: error: expected primary-expression before '>' token
10 | if(n=>4 && n<8)cout << 4 << endl;
| ^
a.cc:11:8: error: expected primary-expression before '>' token
11 | if(n=>8 && n<16)cout << 8 << endl;
| ^
a.cc:12:8: error: expected primary-expression before '>' token
12 | if(n=>16 && n<32)cout << 16 << endl;
| ^
a.cc:13:8: error: expected primary-expression before '>' token
13 | if(n=>32 && n<64)cout << 32 << endl;
| ^
a.cc:14:8: error: expected primary-expression before '>' token
14 | if(n=>64 && n<100)cout << 64 << endl;
| ^
|
s422703214 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
int max = -1;
int n = 0;
for(int i=0; i<N; i++){
int count = 0;
int num = i;
while(true){
if(num%2 == 0 ){
count++;
num /= 2;
}else{
break;
}
}
if(max < count){
max = count;
n = i;
}
}
count << n << endl;
} | a.cc: In function 'int main()':
a.cc:30:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
30 | count << n << endl;
| ~~~~~~^~~~
|
s373057664 | p03644 | C++ | #include <iostream>
#include<algorithm>
#include<vector>
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
if (N == 1) {
cout << 0 << end;
}
else if (2 <= N && N < 4) {
cout << 2 << end;
}
else if (4 <= N && N < 8) {
cout << 4 << endl;
}
else if (8 <= N && N < 16) {
cout << 8 << endl;
}
else if (16 <= N && N < 32) {
cout << 16 << endl;
}
else if (32 <= N && N < 64) {
cout << 32 << endl;
}
else {
cout << 64 << endl;
}
} | a.cc: In function 'int main()':
a.cc:11:27: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
11 | cout << 0 << end;
| ~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:41,
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; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::nullptr_t'
306 | operator<<(null |
s898400626 | p03644 | C++ | int main() {
int N, count = 0, max_count = -1, max_N = -1;
cin >> N;
for(int i=1; i<N+1; i++){
count = 0;
int j = i;
while(j%2 == 0){
j = j/2;
count++;
}
if(count > max_count){
max_count = count;
max_N = i;
}
}
cout << max_N << endl;
} | a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin >> N;
| ^~~
a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'count'?
17 | cout << max_N << endl;
| ^~~~
| count
a.cc:17:20: error: 'endl' was not declared in this scope
17 | cout << max_N << endl;
| ^~~~
|
s518837358 | p03644 | C++ | #include <iostream>
using namespace std;
int main(){
int N;
cin >> N;
for(int ans = 1; ans < N; ans *=2){
}
cout << ans;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
9 | cout << ans;
| ^~~
| abs
|
s216882279 | p03644 | C++ | #include<iostream>
using namespace std;
int main()
{
int a,i=1;
cin>>a;
while(ans<i){
i*=2;
}
cout<<i/2;
}
| a.cc: In function 'int main()':
a.cc:7:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
7 | while(ans<i){
| ^~~
| abs
|
s186472544 | p03644 | C++ | #include<iostream>
using namespace std;
int main()
{
int a,ans=1;
cin>>a;
while(ans<i){
i*=2;
}
cout<<i/2;
} | a.cc: In function 'int main()':
a.cc:7:13: error: 'i' was not declared in this scope
7 | while(ans<i){
| ^
a.cc:10:9: error: 'i' was not declared in this scope
10 | cout<<i/2;
| ^
|
s737063375 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define rep1(i,n) for(int i=0; i+1<n; i++)
int main(){
int N;
scanf("%d", &N);
int count = 0;
int a = 2;
while(a < N){
count++;
a = a*2;
}
if(count == 0) printf("%d\n",N);
else prinf("%d\n", a/2);
return 0;
} | a.cc: In function 'int main()':
a.cc:19:8: error: 'prinf' was not declared in this scope; did you mean 'printf'?
19 | else prinf("%d\n", a/2);
| ^~~~~
| printf
|
s960327198 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
int main(){
int N;
scanf("%d", &N);
int a[N];
rep(i,N){
a[i] = i;
}
int count = 0;
int ans = 0;
rep(i+1,N){
while(a[i+1]%2 == 0){
a[i+1] = a[i+1]/2;
count++;
}
if(count>ans) ans = count;
}
printf("%d\n", &ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:16:8: error: expected ';' before '+' token
16 | rep(i+1,N){
| ^
a.cc:3:26: note: in definition of macro 'rep'
3 | #define rep(i,n) for(int i=0; i<n; i++)
| ^
a.cc:16:8: error: lvalue required as left operand of assignment
16 | rep(i+1,N){
| ^~
a.cc:3:26: note: in definition of macro 'rep'
3 | #define rep(i,n) for(int i=0; i<n; i++)
| ^
a.cc:3:34: error: expected ')' before ';' token
3 | #define rep(i,n) for(int i=0; i<n; i++)
| ~ ^
a.cc:16:3: note: in expansion of macro 'rep'
16 | rep(i+1,N){
| ^~~
a.cc:16:7: error: 'i' was not declared in this scope
16 | rep(i+1,N){
| ^
a.cc:3:36: note: in definition of macro 'rep'
3 | #define rep(i,n) for(int i=0; i<n; i++)
| ^
a.cc:16:9: error: lvalue required as increment operand
16 | rep(i+1,N){
| ^
a.cc:3:36: note: in definition of macro 'rep'
3 | #define rep(i,n) for(int i=0; i<n; i++)
| ^
|
s025674486 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >>n;
int ans, countans = 0;
for (int i = 1, i <= n; i++) {
int a = i;
int counta = 0;
while (a % 2 == 0) {
counta ++;
a /= 2;
}
if (counta > countans) {
ans = i;
countans = counta;
}
}
cout << ans;
} | a.cc: In function 'int main()':
a.cc:10:20: error: expected ';' before '<=' token
10 | for (int i = 1, i <= n; i++) {
| ^~~
| ;
a.cc:10:21: error: expected primary-expression before '<=' token
10 | for (int i = 1, i <= n; i++) {
| ^~
|
s249460549 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N ,a=0,ans=1;
cin >> N ;
for (int i=N ; j>1 ; j= (j-j%2)/2 ){
a++ ;
}
for (int i= 0 ; i< a ; i++){
ans*=2;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:7:18: error: 'j' was not declared in this scope
7 | for (int i=N ; j>1 ; j= (j-j%2)/2 ){
| ^
|
s641432099 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N ,a=0,ans=1;
cin >> N ;
for (int i=N ; j>1 ; j= (j-j%2)/2 ){
a++ ;
}
for (int i= 0 ; i< a ; i++){
ans*=2
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:7:18: error: 'j' was not declared in this scope
7 | for (int i=N ; j>1 ; j= (j-j%2)/2 ){
| ^
a.cc:11:11: error: expected ';' before '}' token
11 | ans*=2
| ^
| ;
12 | }
| ~
|
s194142805 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,X=1;
cin >> N;
for(int i=1; i<=N; i*=2){
i=X;
}
cout << X << endl;
}
| a.cc:5:2: error: extended character is not valid in an identifier
5 | int N,X=1;
| ^
a.cc: In function 'int main()':
a.cc:5:2: error: '\U00003000int' was not declared in this scope
5 | int N,X=1;
| ^~~~~
a.cc:6:10: error: 'N' was not declared in this scope
6 | cin >> N;
| ^
a.cc:8:7: error: 'X' was not declared in this scope
8 | i=X;
| ^
a.cc:10:11: error: 'X' was not declared in this scope
10 | cout << X << endl;
| ^
|
s760931944 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int maxcount = 0;
int ans;
for (int i = 1; i < N; i++) {
int x = i;
int count = 0;
while (x % 2 == 0) {
count++;
x /= 2;
}
if (count > maxcount) {
maxcount = count;
ans = i;
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:7:23: error: 'N' was not declared in this scope
7 | for (int i = 1; i < N; i++) {
| ^
|
s097572070 | p03644 | C++ | /**
* created: 05.07.2020 17:48:14
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pcnt(bit) __builtin_popcountll(bit)
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;}
const long double pi = acos(-1.0);
const int INF = 1LL << 60;
const int MOD = 1000000007;
// const int MOD = 998244353;
signed main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
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;;
else cout << 1 << endl;;
return 0;
} | a.cc: In function 'int main()':
a.cc:31:5: error: 'else' without a previous 'if'
31 | else if (n >= 16) cout << 16 << endl;;
| ^~~~
a.cc:32:5: error: 'else' without a previous 'if'
32 | else if (n >= 8) cout << 8 << endl;;
| ^~~~
a.cc:33:5: error: 'else' without a previous 'if'
33 | else if (n >= 4) cout << 4 << endl;;
| ^~~~
a.cc:34:5: error: 'else' without a previous 'if'
34 | else if (n >= 2) cout << 2 << endl;;
| ^~~~
a.cc:35:5: error: 'else' without a previous 'if'
35 | else cout << 1 << endl;;
| ^~~~
|
s356133279 | p03644 | C++ | void b_break_number(void) {
int n,m;
cin >> n;
int cnt = 0;
int cnt_max = 0;
int n_max=1;
for (int i = 1; i <= n; i++) {
m = i;
cnt = 0;
while (true) {
if ((m & 0x1) == 0x1) break;
m = m >> 1;
cnt++;
}
if (cnt > cnt_max) {
cnt_max = cnt;
n_max = i;
}
}
cout << n_max << endl;
}
int main()
{
b_break_number();
return 0;
} | a.cc: In function 'void b_break_number()':
a.cc:3:9: error: 'cin' was not declared in this scope
3 | cin >> n;
| ^~~
a.cc:20:9: error: 'cout' was not declared in this scope
20 | cout << n_max << endl;
| ^~~~
a.cc:20:26: error: 'endl' was not declared in this scope
20 | cout << n_max << endl;
| ^~~~
|
s449505762 | p03644 | C++ | #include <iostream>
using namespace std;
int main() {
int a; cin >> a;
int ans = 1;
while(ans * 2 =< a) {
ans *= 2;
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:18: error: expected primary-expression before '<' token
9 | while(ans * 2 =< a) {
| ^
|
s344127711 | p03644 | Java | mport java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class Main {
static Scanner scanner;
public static void main(String[] args) {
scanner = new Scanner(System.in);
int N=gi();
int m= 2;
for(int i=1; i<=N;i++) {
int c=0;
int a=i;
while(true) {
if(a%2!=0) {
break;
}
a/=2;
c++;
}
if (c>m) {
m=c;
}
}
System.out.print(m);
// if (t.equals("Sunny")) {
// System.out.print("Cloudy");
// }else if(t.equals("Cloudy")){
// System.out.print("Rainy");
// } else {
// System.out.print("Sunny");
// }
}
// 文字列として入力を取得
public static String gs() {
return scanner.next();
}
// intとして入力を取得
public static int gi() {
return Integer.parseInt(scanner.next());
}
// longとして入力を取得
public static long gl() {
return Long.parseLong(scanner.next());
}
// doubleとして入力を取得
public static double gd() {
return Double.parseDouble(scanner.next());
}
} | Main.java:1: error: class, interface, enum, or record expected
mport java.util.HashMap;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.List;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.Map;
^
Main.java:4: error: class, interface, enum, or record expected
import java.util.Scanner;
^
4 errors
|
s303059136 | p03644 | Java | import java.util.Scanner;
public class void Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int result = 1;
for(int i = 1; i <= N; i *= 2) {
result = i;
}
System.out.println(result);
}
}
| Main.java:2: error: <identifier> expected
public class void Main {
^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
Main.java:13: error: class, interface, enum, or record expected
}
^
3 errors
|
s946067599 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector<int>A(N);
for(int i=0;i<N;i++){
cin>>A.at(i);
}
while(true){
bool exist_num=false;
for(int i=0;i<N;i++){
if(A.at(i)%2==1) exist_num=true;
if(exist_num) break;
}
int res=0;
for(int i=0;i<N;i++){
if(A.at(i)%2==0) A.at(i)/=2;
}
++res;
}
}
cout << pow(2,res) << endl;
return 0;
}
| a.cc:26:3: error: 'cout' does not name a type
26 | cout << pow(2,res) << endl;
| ^~~~
a.cc:27:1: error: expected unqualified-id before 'return'
27 | return 0;
| ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
28 | }
| ^
|
s056789394 | p03644 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
using namespace std;
int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;
int main() {
int n,cnt = 0, ans = 0; cin >> n;
REP(i,n){
cnt = 0;
int I = i;
while(I % 2 == 0) {
cnt++;
I /= 2;
}
ans = max(ans,cnt);
}
cout << pow(2,ans) << endl;
}
| a.cc: In function 'int main()':
a.cc:41:13: error: 'pow' was not declared in this scope
41 | cout << pow(2,ans) << endl;
| ^~~
|
s601497512 | p03644 | C | #include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
const int MOD = 1000000007;
using namespace std;
int main(){
int N,maxnum=1,maxcount=0;
cin >> N;
for(int i=1;i<=N;i++){
int num = i;
int count = 0;
while(true){
// printf("%d ",num);
if(num%2!=0 || num == 0){
break;
}else{
num /= 2;
count++;
}
}
// printf("\n");
if(count>maxcount){
maxcount=count;
maxnum = i;
}
}
cout << maxnum << endl;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s203708106 | p03644 | C++ | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
#define rep(i,n) for (ll i = 0; i < (ll)(n); ++i)
#define rrep(i,j,n) for(ll i = (ll)(j); i < (ll)(n); i++)
#define mrep(i,n) for (ll i = (ll)(n); i > 0; i--)
#define be(v) (v).begin(), (v).end()
#define dcout cout << fixed << setprecision(20)
ll INF = 1LL << 60;
ll mod = 1e9 + 7;
int main() {
int n;
cin >> n;
int ans=0;
for(int i=n;i>=0;i--) {
int count = 0;
for(int j=0;j<n;j++) {
if(i%2==0) count++;
else goto H;
}
H:
ans=max(ans,count);
}
pcout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:27:9: error: 'pcout' was not declared in this scope; did you mean 'dcout'?
27 | pcout << ans << endl;
| ^~~~~
| dcout
|
s919359370 | p03644 | C | #include <stdio.h>
int main(void) {
int n;
scanf("%d",&n);
int ans=0;
for(int i=n;i>=0;i--) {
int count = 0;
for(int j=0;j<n;j++) {
if(i%2==0) count++;
else goto H;
}
H:
ans=max(ans,count);
}
printf("%d\n",ans);
} | main.c: In function 'main':
main.c:13:21: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
13 | ans=max(ans,count);
| ^~~
|
s106457083 | p03644 | C++ |
using namespace std;
int main(){
//initialization
int N;
int ans=0;
//input
cin >> N;
int even[N+1];
for(int i=0; i<=N; i++) even[i] = 0;
//solver
for(int i=N/2; i<=N; i++){
int j = i;
while( (j%2) != 1){
even[i] += 1;
j /= 2;
}
if(ans < even[i]) ans=even[i];
//output
//cout << i << " " << even[i] << "\n";
}
cout << ans << "\n";
}
| a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
11 | cin >> N;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 |
a.cc:28:3: error: 'cout' was not declared in this scope
28 | cout << ans << "\n";
| ^~~~
a.cc:28:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s362682624 | p03644 | C | #include <stdio.h>
int main(void)
{
int n,i=1;
scanf("%d",&n);
while(i<=a){
i=i*2;
}
printf("%d",i/2);
return 0;
} | main.c: In function 'main':
main.c:10:12: error: 'a' undeclared (first use in this function)
10 | while(i<=a){
| ^
main.c:10:12: note: each undeclared identifier is reported only once for each function it appears in
|
s338888616 | p03644 | C++ | #include <stdio.h>
void main(){
int input,i,max=-1;
scanf("%d",&input);
for(i=0;i<input;i++){
if(max<(i%2)){
max=i%2;
}
}
printf("%d",max);
} | a.cc:2:1: error: '::main' must return 'int'
2 | void main(){
| ^~~~
|
s170767537 | p03644 | C++ | void main(){
int input,i,max=-1;
scanf("%d",&input);
for(i=0;i<input;i++){
if(max<(i%2)){
max=i%2;
}
}
printf("%d",max);
} | a.cc:1:1: error: '::main' must return 'int'
1 | void main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:3:3: error: 'scanf' was not declared in this scope
3 | scanf("%d",&input);
| ^~~~~
a.cc:9:3: error: 'printf' was not declared in this scope
9 | printf("%d",max);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | void main(){
|
s738527792 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a;
cin >> a;
for(int i=0;i<20;i++){
if(n<(1<<(i+1))){
cout << (i<<n) << endl;
break;
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:8: error: 'n' was not declared in this scope
7 | if(n<(1<<(i+1))){
| ^
|
s232541061 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
for(int i=0;i<n;i++)
a[i]=i;
int count=0;
int max=0;
int max_number;
for(int i=0;i<n;i++){
while(true){
if(a[i]%2==0){
count++;
a[i]/=2;
}
if(a[i]%2!=0)break;
}
int max=max(max,count);
if(max==count)
max_number=i;
}
cout << max_number << endl;
}
| a.cc: In function 'int main()':
a.cc:20:16: error: 'max' cannot be used as a function
20 | int max=max(max,count);
| ~~~^~~~~~~~~~~
|
s844873473 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
for(int i=0;i<n;i++)
a[i]=i;
int count=0;
int max=0;
int max_number;
for(int i=0;i<n;i++){
while(true){
if(a[i]%2==0){
count++;
a[i]/=2;
}
if(a[i]%2!=0)break;
}
max=max(max,count);
if(max==count)
max_number=i;
}
cout << max_number << endl;
}
| a.cc: In function 'int main()':
a.cc:20:12: error: 'max' cannot be used as a function
20 | max=max(max,count);
| ~~~^~~~~~~~~~~
|
s369505256 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
int main(){
ll N,;
cin >> N;
ll ans=0;
for(int i=N;i>=1;i--){
if(i%2==0){cout<<i<<endl;return 0;}
}
cout<<1<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:10: error: expected unqualified-id before ';' token
7 | ll N,;
| ^
|
s777750065 | p03644 | C++ | #include <bits/stdc++.h>
typedef long long ll;
#define rep(i,a,n) for(ll i = a;i < n;i++)
#define rrep(i,a,n) for(ll i = n; i >= a;i--)
#define index_check(i,n) if(i > n-1 || i < 0) continue;
#define LINF 1e18
#define INF 1e9
#define MOD (ll)(1e9+7)
using namespace std;
#define fs first
#define sc second
using P = pair<ll,ll>;
using Pll = pair<P,ll>;
using PQ = priority_queue<P,vector<P>,greater<P>>;
signed main(){
ll n;
cin >> n;
ll cnt = 0,ans = ,memo,a;
rep(i,1,n+1){
a = i;
cnt = 0;
while(a % 2 == 0){
cnt++;
a /= 2;
}
if(ans != (ll)max(ans,cnt)){
ans = max(ans,cnt);
memo = i;
}
}
cout << memo << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:22: error: expected primary-expression before ',' token
21 | ll cnt = 0,ans = ,memo,a;
| ^
a.cc:23:9: error: 'a' was not declared in this scope
23 | a = i;
| ^
a.cc:31:13: error: 'memo' was not declared in this scope
31 | memo = i;
| ^~~~
a.cc:36:13: error: 'memo' was not declared in this scope
36 | cout << memo << endl;
| ^~~~
|
s244445592 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector <int> A={1, 2, 4, 8, 16, 32, 64};
for (int i=0; i<6; i++){
if (N<A[i]){
a=A[i-1];
break;
}
}
cout << a << endl;
}
| a.cc: In function 'int main()':
a.cc:10:7: error: 'a' was not declared in this scope
10 | a=A[i-1];
| ^
a.cc:14:11: error: 'a' was not declared in this scope
14 | cout << a << endl;
| ^
|
s087509014 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N, a;
cin >> N;
while(1){
bool small=true;
for (int i=1; i<N; i*=2){
if (i>N){
small false;
i=a;
}
}
if (small){
break;
}
}
a/=2;
cout << a << endl;
}
| a.cc: In function 'int main()':
a.cc:11:14: error: expected ';' before 'false'
11 | small false;
| ^~~~~~
| ;
|
s414341312 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N, a;
cin >> N;
while(1){
bool small true;
for (int i=1; i<N; i*=2){
if (i>N){
small false;
i=a
}
}
if (small){
break;
}
}
a/=2;
cout << i << endl;
}
| a.cc: In function 'int main()':
a.cc:8:16: error: expected initializer before 'true'
8 | bool small true;
| ^~~~
a.cc:11:9: error: 'small' was not declared in this scope; did you mean 'scalbl'?
11 | small false;
| ^~~~~
| scalbl
a.cc:12:12: error: expected ';' before '}' token
12 | i=a
| ^
| ;
13 | }
| ~
a.cc:15:9: error: 'small' was not declared in this scope; did you mean 'scalbl'?
15 | if (small){
| ^~~~~
| scalbl
a.cc:20:11: error: 'i' was not declared in this scope
20 | cout << i << endl;
| ^
|
s873209313 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
bool small true;
while(1){
for (int i=1; i<N; i++){
if (i>N){
small false;
}
}
if (small){
break;
}
i*=2;
}
i/=2;
cout << i << endl;
}
| a.cc: In function 'int main()':
a.cc:7:14: error: expected initializer before 'true'
7 | bool small true;
| ^~~~
a.cc:11:9: error: 'small' was not declared in this scope; did you mean 'scalbl'?
11 | small false;
| ^~~~~
| scalbl
a.cc:14:9: error: 'small' was not declared in this scope; did you mean 'scalbl'?
14 | if (small){
| ^~~~~
| scalbl
a.cc:17:5: error: 'i' was not declared in this scope
17 | i*=2;
| ^
a.cc:19:3: error: 'i' was not declared in this scope
19 | i/=2;
| ^
|
s221911282 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int counter = 0;
while(true){
int num = pow(2,counter);
if(num == n) {
cout << num;
break;
}
else if (num > n) {
cout << num/2;
break;
}
else {
++counter;
}
} | a.cc: In function 'int main()':
a.cc:25:3: error: expected '}' at end of input
25 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s271939703 | p03644 | C++ | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int counter = 0;
while(true){
if(2^counter >= n) {
cout << 2^counter;
break;
}
++counter;
}
} | a.cc: In function 'int main()':
a.cc:15:16: error: no match for 'operator^' (operand types are 'std::basic_ostream<char>' and 'int')
15 | cout << 2^counter;
| ~~~~~~~~~^~~~~~~~
| | |
| | int
| std::basic_ostream<char>
a.cc:15:16: note: candidate: 'operator^(int, int)' (built-in)
15 | cout << 2^counter;
| ~~~~~~~~~^~~~~~~~
a.cc:15:16: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68,
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/cstddef:146:3: note: candidate: 'constexpr std::byte std::operator^(byte, byte)'
146 | operator^(byte __l, byte __r) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:146:18: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::byte'
146 | operator^(byte __l, byte __r) noexcept
| ~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:94:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator^(_Ios_Fmtflags, _Ios_Fmtflags)'
94 | operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:94:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Fmtflags'
94 | operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:144:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator^(_Ios_Openmode, _Ios_Openmode)'
144 | operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:144:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Openmode'
144 | operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:191:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator^(_Ios_Iostate, _Ios_Iostate)'
191 | operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:191:26: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Iostate'
191 | operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~^~~
|
s677458193 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
if (N==1){
cout<<1
}else if(N<=3){
cout<<2;
}else if(N<=7){
cout<<4;
}else if(N<=15){
cout<<8;
}else if(N<=31){
cout<<16;
}else if(N<=63){
cout<<32;
}else{
cout<<64;
}
}
| a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before '}' token
9 | cout<<1
| ^
| ;
10 | }else if(N<=3){
| ~
|
s650796238 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
if (N <=1){
cout<<1
}elseif(N<=3){
cout<<2;
}elseif(N<=7){
cout<<4;
}elseif(N<=15){
cout<<8;
}elseif(N<=31){
cout<<16;
}elseif(N<=63){
cout<<32;
}else{
cout<<64;
}
} | a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before '}' token
9 | cout<<1
| ^
| ;
10 | }elseif(N<=3){
| ~
a.cc:10:4: error: 'elseif' was not declared in this scope
10 | }elseif(N<=3){
| ^~~~~~
a.cc:20:4: error: 'else' without a previous 'if'
20 | }else{
| ^~~~
|
s690293676 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
int max = 0;
int cmax=0;
int i;
cin >> N;
for (i=1;i<=N;i++){
int counter = 0;
while(i%2 =0){
counter = counter+1;
i = i/2;
}
if(counter >= cmax){
max = i;
cmax = counter;
}
}
cout << max;
}
| a.cc: In function 'int main()':
a.cc:13:12: error: lvalue required as left operand of assignment
13 | while(i%2 =0){
| ~^~
|
s713466777 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
int max = 0;
int cmax=0;
int i;
cin >> N;
for (i=1,i<=N,i++){
int counter = 0;
while(i%2 =0){
counter = counter+1;
i = i/2;
}
if(counter >= cmax){
max = i;
cmax = counter;
}
}
cout << max;
}
| a.cc: In function 'int main()':
a.cc:11:20: error: expected ';' before ')' token
11 | for (i=1,i<=N,i++){
| ^
| ;
a.cc:24:1: error: expected primary-expression before '}' token
24 | }
| ^
a.cc:22:15: error: expected ')' before '}' token
22 | cout << max;
| ^
| )
23 |
24 | }
| ~
a.cc:11:7: note: to match this '('
11 | for (i=1,i<=N,i++){
| ^
a.cc:24:1: error: expected primary-expression before '}' token
24 | }
| ^
|
s325277829 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
int max = 0;
int cmax=0;
cin >> N;
for (i=1,i<=N,i++){
int counter = 0;
while(i%2 =0){
counter = counter+1;
i = i/2;
}
if(counter >= cmax){
max = i;
cmax = counter;
}
}
cout << max;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:8: error: 'i' was not declared in this scope
10 | for (i=1,i<=N,i++){
| ^
a.cc:23:3: error: expected primary-expression before 'return'
23 | return 0;
| ^~~~~~
a.cc:21:15: error: expected ')' before 'return'
21 | cout << max;
| ^
| )
22 |
23 | return 0;
| ~~~~~~
a.cc:10:7: note: to match this '('
10 | for (i=1,i<=N,i++){
| ^
|
s662480977 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
int N;
int max = 0;
int cmax=0;
cin << N;
for (i=1,i<=N,i++){
int counter = 0;
while(i%2 =0){
counter = counter+1;
i = i/2;
}
if(counter >= cmax){
max = i;
cmax = counter;
}
}
cout << max;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
9 | cin << N;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:9:7: note: candidate: 'operator<<(int, int)' (built-in)
9 | cin << N;
| ~~~~^~~~
a.cc:9:7: 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | 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:9:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | 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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | cin << N;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 |
s607040600 | p03644 | C++ | #include <bits/stdc++.h>
usinng namespace std;
int main(){
int n;
cin>>n;
if(n<2){cout<<1<<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 if (n<=100){cout<<64<<endl;}
} | a.cc:2:1: error: 'usinng' does not name a type
2 | usinng namespace std;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin>>n;
| ^~~
| std::cin
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:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:10: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | if(n<2){cout<<1<<endl;}
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:6:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
6 | if(n<2){cout<<1<<endl;}
| ^~~~
| std::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:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:7:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | else if (n<4){cout<<2<<endl;}
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:7:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | else if (n<4){cout<<2<<endl;}
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:8:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | else if (n<8){cout<<4<<endl;}
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:8:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | else if (n<8){cout<<4<<endl;}
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:9:18: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | else if (n<16){cout<<8<<endl;}
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:9:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | else if (n<16){cout<<8<<endl;}
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:10:18: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | else if (n<32){cout<<16<<endl;}
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:10:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
10 | else if (n<32){cout<<16<<endl;}
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:11:18: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | else if (n<64){cout<<32<<endl;}
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:11:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | else if (n<64){cout<<32<<endl;}
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:12:20: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | else if (n<=100){cout<<64<<endl;}
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:12:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | else if (n<=100){cout<<64<<endl;}
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s964745118 | p03644 | C++ | #include <iostream>
using namespace std;
int N;
int res;
int A[210]; // 最大 200 個なので余裕を持って 210 に --- 200 以上ならなんでもよいです
int main() {
cin >> N;
for (int i = 1; i <= N; ++i) A[i]=i;
// 操作が行える限り操作を繰り返す
while (true) {
bool exist_odd = false; // A[i] がすべて偶数かどうかを判定するフラグ
for (int i = 0; i < N; ++i) {
if (A[i] % 2 != 0) exist_odd = true; // 奇数があったらフラグを立てる
}
if (exist_odd)
res = i;
break; // 奇数があったら break
// 操作を行えるなら操作を実際に行う
for (int i = 0; i < N; ++i) {
A[i] /= 2;
}
}
cout << A[res] << endl;
} | a.cc: In function 'int main()':
a.cc:20:17: error: 'i' was not declared in this scope
20 | res = i;
| ^
|
s574817415 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include<set>
#include<math.h>
#define pai 3.14159265358979323846264338327950288;
#define keta(n) cout << fixed << setprecision((n));
using ll = long long;
int main(){
int n;
cin>>n;
int ans = 1;
while(ans<=n){
ans *= 2;
}
cout<<ans/2<<endl;
}
c | a.cc:20:1: error: 'c' does not name a type
20 | c
| ^
|
s504504847 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int ans = 1;
while(ans <= n) res *= 2;
cout << ans / 2 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:19: error: 'res' was not declared in this scope
8 | while(ans <= n) res *= 2;
| ^~~
|
s534788360 | p03644 | C++ | #include<stdio.h>
#include<math.h>
int main()
{
int n,c;
while(~scanf("%d", &n))
{
c = (logn)/(log2);
n = pow(2,c);
printf("%d\n", n);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:10: error: 'logn' was not declared in this scope; did you mean 'long'?
8 | c = (logn)/(log2);
| ^~~~
| long
|
s955635089 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define NREP(i, n) FOR(i, 1, n + 1)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
#define RREP(i, n) RFOR(i, n, 0)
#define RNREP(i, n) RFOR(i, n, 1)
// debug
#define test(x) cout << #x << " = " << x << endl
// answer output
#define Yes(c) cout << ((c) ? "Yes" : "No") << endl;
#define YES(c) cout << ((c) ? "YES" : "NO") << endl;
#define yes(c) cout << ((c) ? "yes" : "no") << endl;
#define possible(c) cout << ((c) ? "possible" : "impossible") << endl;
#define POSSIBLE(c) cout << ((c) ? "POSSIBLE" : "INPOSSIBLE") << endl;
int main() {
int k;
cin >> k;
if ( k < 2 ){
cout << 0 << endl;
}else if ( k >= 2 && k < 4 ){
cout << 2 << endl;
}else if ( k >= 4 && k < 8 ){
cout << 4 << endl;
}else if ( k >= 8 && k < 16 ){
cout << 8 << endl;
}else if ( k >= 16 && k < 32 ){
cout << 16 << endl;
}else if ( k >= 32 && k < 64 ){
cout << 32 << endkl;
}else{
cout << 64 << endl;
}
} | a.cc: In function 'int main()':
a.cc:39:19: error: 'endkl' was not declared in this scope
39 | cout << 32 << endkl;
| ^~~~~
|
s509927134 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
//答えは必ず2の累乗
int main() {
int N;
cin >>N;
int p = N;
int answer = 0;
//for文書いてiカウントしてiの数だけ2をかけるとかやるのがかっこいいんだろうけど
//力技
if(p==1){
answer==1;
} //1は0回割れるから1が最大ってことね
else if(p>=2,p<=3){
answer+=2;
}
else if(p>=4,p<=7){
answer+=4;
}
else if(p>=8,p<=15){
answer+=8;
}
else if(p>=16,p<=31){
answer+=16;
}
else if(p>=32,p<=63){
answer+=32;
}
else{
answer+=64;
}
cout << answer << endl;
}
#include <bits/stdc++.h>
using namespace std;
//答えは必ず2の累乗
int main() {
int N;
cin >>N;
int p = N;
int answer = 0;
//for文書いてiカウントしてiの数だけ2をかけるとかやるのがかっこいいんだろうけど
//力技
if(p==1){
answer+=1;
} //1は0回割れるから1が最大ってことね
else if(p>=2,p<=3){
answer+=2;
}
else if(p>=4,p<=7){
answer+=4;
}
else if(p>=8,p<=15){
answer+=8;
}
else if(p>=16,p<=31){
answer+=16;
}
else if(p>=32,p<=63){
answer+=32;
}
else{
answer+=64;
}
cout << answer << endl;
}
| a.cc:49:5: error: redefinition of 'int main()'
49 | int main() {
| ^~~~
a.cc:6:5: note: 'int main()' previously defined here
6 | int main() {
| ^~~~
|
s231997889 | p03644 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
// 7
int n = 8;
int j = 2;
int k = 0; // カウントする数
while(((n/j)/2)%2==0){
if(n%j == 0){
j = j* 2;
k = k+1;
}else{
break;
}
}
System.out.println(j*2);
}
}
| Main.java:7: error: variable n is already defined in method main(String[])
int n = 8;
^
1 error
|
s567345876 | p03644 | Java | import java.util.*;
public class{
public static void main(String[] args{
Scanner sc = new Scaner(System.in);
int n = sc.nextInt();
int j = 2;
int k = 0; // カウントする数
while( 0 <= j && j <= n){
if(n%j == 0){
j = j* 2;
k = k+1;
}else{
System.out.println(j);
}
}
}
}
| Main.java:2: error: <identifier> expected
public class{
^
Main.java:3: error: ',', ')', or '[' expected
public static void main(String[] args{
^
2 errors
|
s578786670 | p03644 | C++ | //AUTHOR:BlackBox Inc.//
#include<bits/stdc++.h>
#include<unordered_map>
#include<tr1/unordered_map>
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vlli vector<long long int>
#define vvi vector<vector<int>>
#define endl "\n"
#define vpii vector<pair<int,int>>
#define vs vector<string>
#define lin1(x) ll int x; x = scan();
#define lin2(x,y) ll int x, y; x = scan(), y = scan();
#define lin3(x,y,z) ll int x, y, z; x = scan(), y = scan(), z = scan();
#define pb(x) push_back(x)
#define makep(x,y) make_pair(x,y)
#define mx(a,b) (a)>(b)?(a):(b)
#define mn(a,b) (a)<(b)?(a):(b)
#define fori(s,e) for(i=s;i<=e;i++)
#define forj(s,e) for(j=s;j<=e;j++)
#define fork(s,e) for(k=s;k<=e;k++)
#define rep(i,s,e) for(int i=s;i<=e;i++)
#define brep(i,s,e) for(int i=s;i>=e;i--)
#define all(x) x.begin(),x.end()
#define mem(x,y) memset(x,y,sizeof(x));
#define bits1(x) __builtin_popcount(x)
#define pi 3.14159265358979323846264338327950
#define MOD7 1000000007
#define MOD9 1000000009
#define fast std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
using namespace std::tr1;
int main()
{
#ifdef RAHUL
freopen("input.txt","r",stdin);
#endif
int rahul;
cin>>rahul;
cout<<pow(2, int(log(rahul)/log(2)))a<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:44:37: error: expected ';' before 'a'
44 | cout<<pow(2, int(log(rahul)/log(2)))a<<endl;
| ^
| ;
|
s272803190 | p03644 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using p = pair<int, int>;
int main() {
int n;
cin >> n;
while (k <= n) {
k *= 2;
}
cout << k/2 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:10: error: 'k' was not declared in this scope
10 | while (k <= n) {
| ^
a.cc:13:11: error: 'k' was not declared in this scope
13 | cout << k/2 << endl;
| ^
|
s930952425 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=61
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pairii;
const double pi=3.1415926535;
const ll mod=1000000007;
//桁数指定 cout << fixed << setprecision(2)
int main() {
cin>>n;
if(n>=64){cout<<64<<endl;return 0;}
else if(n>=32){cout<<32<<endl;return 0;}
else if(n>=16){cout<<16<<endl;return 0;}
else if(n>=8){cout<<8<<endl;return 0;}
else if(n>=4){cout<<4<<endl;return 0;}
else if(n>=2){cout<<2<<endl;return 0;}
else cout<<1<<endl;
} | a.cc: In function 'int main()':
a.cc:13:8: error: 'n' was not declared in this scope; did you mean 'yn'?
13 | cin>>n;
| ^
| yn
|
s459294419 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m1(x) memset(x,-1,sizeof(x))
const int INF = 1e9 + 1;
const ll MOD = 1e9 + 7;
const double PI = 3.141592653589793;
int main(){
int n;
cin >> n;
rep(i, 8){
int ans = pow(2, i);
if(ans > n){
ans = ans/2;
break;
}
}
cout << ans <<endl;
} | a.cc: In function 'int main()':
a.cc:22:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
22 | cout << ans <<endl;
| ^~~
| abs
|
s456861623 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int a,n,ans;
int main()
{
cin>>a;
if(a==1)
{
cout<<1<<endl
return 0;;
}
for(int i=1;i<=30;i++)
{
if(pow(2,i)<=a&&pow(2,i+1)>a)
{
cout<<pow(2,i)<<endl;
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:30: error: expected ';' before 'return'
9 | cout<<1<<endl
| ^
| ;
10 | return 0;;
| ~~~~~~
|
s852619315 | p03644 | Java | import java.util.Scanner;
public class InputSample {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int n = 0;
if ( 2 ^ n <= N ) {
n = n + 1;
} else {
System.out.println(2^n);
}
}
} | Main.java:3: error: class InputSample is public, should be declared in a file named InputSample.java
public class InputSample {
^
Main.java:8: error: bad operand types for binary operator '^'
if ( 2 ^ n <= N ) {
^
first type: int
second type: boolean
2 errors
|
s957439888 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
#include <stdio.h>
#include <math.h>
int main() {
// ここにプログラムを追記
int N;
cin>>N;
if(N ==1 )cout<<N<<endl;
if(){
for (int i=1;i<N;i++){
double A,B;
A =double pow(double 2, double i);
B =double pow(double 2, double i+1);
if(A=<N<B){
cout<<i<<endl;
break;
}
}
}
}
| a.cc: In function 'int main()':
a.cc:12:6: error: expected primary-expression before ')' token
12 | if(){
| ^
a.cc:15:16: error: expected primary-expression before 'double'
15 | A =double pow(double 2, double i);
| ^~~~~~
a.cc:16:16: error: expected primary-expression before 'double'
16 | B =double pow(double 2, double i+1);
| ^~~~~~
a.cc:17:18: error: expected primary-expression before '<' token
17 | if(A=<N<B){
| ^
|
s235806042 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
// ここにプログラムを追記
int N;
cin>>N;
if(N ==1 || N %2==0)cout<<N<<endl;
for (int i=(N-1);i>1;i--){
if(i%2==0){
cout<<i<<endl;
break;
}
} | a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s606074266 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define repp(i, n) for(int i = 1; i <= n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define pb push_back
#define riverse(v) reverse((v).begin(), (v).end())
using vi = vector<int>;
using vs = vector<string>;
using vll = vector<ll>;
const int MOD = 1e9+7;
int main() {
int N;
cin >> N;
int ans;
if(N>=64) ans = 64;
else if(N>=32) ans =32;
else if(N>=16) ans 16;
else if(N>=8) ans =8;
else if(N>=4) ans =4;
else if(N>=2) ans =2;
else ans =1;
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:21:27: error: expected ';' before numeric constant
21 | else if(N>=16) ans 16;
| ^~~
| ;
|
s845044720 | p03644 | C | #include<stdio.h>
int main(void){
int n,cnt;
scanf("%d",&n);
for(int i=1;i<=n;i*=2){
cnt=i;
}
printf("%d\n",ans);
return 0;
} | main.c: In function 'main':
main.c:8:17: error: 'ans' undeclared (first use in this function)
8 | printf("%d\n",ans);
| ^~~
main.c:8:17: note: each undeclared identifier is reported only once for each function it appears in
|
s916986631 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, n=0; x=2; cin >> N;
while (true) {
if (x<=N) {
x *= 2;
n++;
} else break;
}
cout << x << endl;
} | a.cc: In function 'int main()':
a.cc:5:15: error: 'x' was not declared in this scope
5 | int N, n=0; x=2; cin >> N;
| ^
|
s812074856 | p03644 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
#define rrep(i,n) for(int i=1; i<=(n); ++i)
#define drep(i,n) for(int i=(n)-1; i>=0; --i)
#define srep(i,s,t) for (int i=s; i<t; ++i)
#define pb push_back
using namespace std;
using P = pair<int,int>;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef tuple<int,int,int> T;
typedef vector<P> vp;
typedef vector<T> vt;
// head
int main (void){
int N;
for(int i=1; i<=N; i++){
int ans;
ans=N/2;
}
cout << max(0, ans) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:24:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
24 | cout << max(0, ans) << endl;
| ^~~
| abs
|
s070330367 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
int cnt=0;
int pre=0;
//入力が1の時は1が正解
int ans=1;
for(int i=1; i<=N; i++){
int n=i;
//割れる回数を計算
int cnt=0;
while(n%2==0){
cnt++;
n/=2;
}
//割れる回数がそれまでを上回ったら上書き
if(cnt>pre){
pre=cnt;
ans=i;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:29:2: error: expected '}' at end of input
29 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s887169192 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
int cnt=0;
int pre=0;
int ans=1; //入力が1の時は1が正解
for(int i=1; i<=N; i++){
int n=i;
//割れる回数を計算
int cnt=0;
while(n%2==0){
cnt++;
n/=2;
}
//割れる回数がそれまでを上回ったら上書き
if(cnt>pre){
pre=cnt;
ans=i;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:27:2: error: expected '}' at end of input
27 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s051267254 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
ios_base::sync_with_stdio(false);
int n;
cin>>n;
int a[10]={1,2,4,8,16,32,64,128,256,512};
int f=0;
for(int i=0;i<10;i++){
if(a[i]<=n){
f=a[i];
}
}
cout<<a[i];
}
| a.cc: In function 'int main()':
a.cc:16:11: error: 'i' was not declared in this scope
16 | cout<<a[i];
| ^
|
s880412307 | p03644 | C++ |
#include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
ios_base::sync_with_stdio(false);
int n;
cin>>n;
int a[10]=[1,2,4,8,16,32,64,128,256,512];
int f=0;
for(int i=0;i<10;i++){
if(a[i]<=n){
f=a[i];
}
}
cout<<a[i];
}
| a.cc: In function 'int main()':
a.cc:10:14: error: expected identifier before numeric constant
10 | int a[10]=[1,2,4,8,16,32,64,128,256,512];
| ^
a.cc:10:15: error: expected ']' before ',' token
10 | int a[10]=[1,2,4,8,16,32,64,128,256,512];
| ^
| ]
a.cc: In lambda function:
a.cc:10:15: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:10:13: error: array must be initialized with a brace-enclosed initializer
10 | int a[10]=[1,2,4,8,16,32,64,128,256,512];
| ^~
a.cc:10:16: error: expected unqualified-id before numeric constant
10 | int a[10]=[1,2,4,8,16,32,64,128,256,512];
| ^
a.cc:17:11: error: 'i' was not declared in this scope
17 | cout<<a[i];
| ^
|
s824669282 | p03644 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
int n,i;
cin >>n;
i=1;
while(i<=n) i *= 2;
cout <<i/2<<endl;
}
} | a.cc:12:1: error: expected declaration before '}' token
12 | }
| ^
|
s401407901 | p03644 | C++ | #include <iostreamz>
#include <string>
using namespace std;
int main() {
int n,i;
cin >>n;
i=1;
while(i<=n) i *= 2;
cout <<i/2<<endl;
}
} | a.cc:1:10: fatal error: iostreamz: No such file or directory
1 | #include <iostreamz>
| ^~~~~~~~~~~
compilation terminated.
|
s633568487 | p03644 | C++ | #include <iostream>
using namespace std;
int main() {
int n,i;
cin >>n;
i=1;
while(i<=n) i *= 2;
cout <<i/2<<endl;
}
} | a.cc:11:1: error: expected declaration before '}' token
11 | }
| ^
|
s420479816 | p03644 | C++ | #include <iostream>
using namespace std;
int main() {
int n,i;
cin >>n;
i=1;
while(i<=n) i *= 2;
cout <<i/2<<endl;
}
} | a.cc:11:1: error: expected declaration before '}' token
11 | }
| ^
|
s157960777 | p03644 | C++ | int main(){
int n;
cin >> n;
int mx = 0;
int ans = 0;
for(int i = 1; i <= n; i++){
int cnt = 0;
int tmp = i;
while(tmp%2 == 0){
tmp /= 2;
cnt++;
}
if(mx <= cnt){
mx = cnt;
ans = i;
}
}
cout << ans << 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 << ans << endl;
| ^~~~
a.cc:18:20: error: 'endl' was not declared in this scope
18 | cout << ans << endl;
| ^~~~
|
s885144349 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int count = 0;
int mx = 0;
int k, ans;
if (n == 1)
{
ans = 1;
goto goal:
}
for (int i = 0; i < n; i++)
{
count = 0;
k = i + 1;
while (k % 2 == 0)
{
k /= 2;
count++;
}
if (count > mx)
{
ans = i + 1;
mx = count;
}
}
goal:
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:15:14: error: expected ';' before ':' token
15 | goto goal:
| ^
| ;
a.cc:15:14: error: expected primary-expression before ':' token
|
s764529649 | p03644 | C++ | #include<iostream>
using namespace std;
int N;
int main(){
cos >> N;
int count=0;
int max = 1;
for(i=0;i<N;i++){
if(max*2<=N){
max *= 2;
count++;
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'cos' was not declared in this scope
5 | cos >> N;
| ^~~
a.cc:8:5: error: 'i' was not declared in this scope
8 | for(i=0;i<N;i++){
| ^
|
s393934516 | p03644 | C++ | #include<iostream>
using namespace std;
int N;
int main(){
cos >> N;
int max = 1;
while(max*2 <= N){
max *= 2;
}
cout << max << endl;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'cos' was not declared in this scope
5 | cos >> N;
| ^~~
|
s590388087 | p03644 | C++ | #include<iostream>
using namespace std;
int main(){
int max = 1;
while(max*2 <= N){
max *= 2;
}
cout << max << endl;
}
| a.cc: In function 'int main()':
a.cc:5:16: error: 'N' was not declared in this scope
5 | while(max*2 <= N){
| ^
|
s904306337 | p03644 | C++ | #include<iostream>
using namespace std;
int N;
int main(){
cin >> N;
int A[]=[1,2,4,8,16,32,64];
for(int i=0;i<A.size();++i){
if(N=A[0]){
cout << A[0] << endl;
}
break;
if(N<A[i]){
cout << A[i-1] << endl;
}
break;
}
}
| a.cc: In function 'int main()':
a.cc:8:12: error: expected identifier before numeric constant
8 | int A[]=[1,2,4,8,16,32,64];
| ^
a.cc:8:13: error: expected ']' before ',' token
8 | int A[]=[1,2,4,8,16,32,64];
| ^
| ]
a.cc: In lambda function:
a.cc:8:13: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:8:11: error: initializer fails to determine size of 'A'
8 | int A[]=[1,2,4,8,16,32,64];
| ^~
a.cc:8:11: error: array must be initialized with a brace-enclosed initializer
a.cc:8:14: error: expected unqualified-id before numeric constant
8 | int A[]=[1,2,4,8,16,32,64];
| ^
a.cc:10:21: error: request for member 'size' in 'A', which is of non-class type 'int [1]'
10 | for(int i=0;i<A.size();++i){
| ^~~~
|
s188626848 | p03644 | C++ | #include<iostream>
using namespace std;
int N;
int main(){
cin >> N;
int A=[1,2,4,8,16,32,64];
for(int i=0;i<A.size();++i){
if(N=A[0]){
cout << A[0] << endl;
}
if(N<A[i]){
cout << A[i-1] << endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:8:10: error: expected identifier before numeric constant
8 | int A=[1,2,4,8,16,32,64];
| ^
a.cc:8:11: error: expected ']' before ',' token
8 | int A=[1,2,4,8,16,32,64];
| ^
| ]
a.cc: In lambda function:
a.cc:8:11: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:8:9: error: invalid user-defined conversion from 'main()::<lambda()>' to 'int' [-fpermissive]
8 | int A=[1,2,4,8,16,32,64];
| ^~
a.cc:8:9: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
8 | int A=[1,2,4,8,16,32,64];
| ^
a.cc:8:9: note: no known conversion from 'void (*)()' to 'int'
a.cc:8:12: error: expected unqualified-id before numeric constant
8 | int A=[1,2,4,8,16,32,64];
| ^
a.cc:10:21: error: request for member 'size' in 'A', which is of non-class type 'int'
10 | for(int i=0;i<A.size();++i){
| ^~~~
a.cc:11:13: error: invalid types 'int[int]' for array subscript
11 | if(N=A[0]){
| ^
a.cc:12:18: error: invalid types 'int[int]' for array subscript
12 | cout << A[0] << endl;
| ^
a.cc:14:13: error: invalid types 'int[int]' for array subscript
14 | if(N<A[i]){
| ^
a.cc:15:18: error: invalid types 'int[int]' for array subscript
15 | cout << A[i-1] << endl;
| ^
|
s772076429 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int S;
cin>>S;
for(int i=0;i<100;i++){
if(S.at(i)/64==0){
cout<<S.at(i)<<endl;
}
else if (S.at(i)/32==0){
cout<<S.at(i)<<endl;
}
else if (S.at(i)/16==0){
cout<<S.at(i)<<endl;
}
else if (S.at(i)/8==0){
cout<<S.at(i)<<endl;
}
else if (S.at(i)/32==0){
cout<<S.at(i)<<endl;
}
else if (S.at(i)/32==0){
cout<<S.at(i)<<endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:8:10: error: request for member 'at' in 'S', which is of non-class type 'int'
8 | if(S.at(i)/64==0){
| ^~
a.cc:9:15: error: request for member 'at' in 'S', which is of non-class type 'int'
9 | cout<<S.at(i)<<endl;
| ^~
a.cc:11:16: error: request for member 'at' in 'S', which is of non-class type 'int'
11 | else if (S.at(i)/32==0){
| ^~
a.cc:12:15: error: request for member 'at' in 'S', which is of non-class type 'int'
12 | cout<<S.at(i)<<endl;
| ^~
a.cc:14:16: error: request for member 'at' in 'S', which is of non-class type 'int'
14 | else if (S.at(i)/16==0){
| ^~
a.cc:15:15: error: request for member 'at' in 'S', which is of non-class type 'int'
15 | cout<<S.at(i)<<endl;
| ^~
a.cc:17:16: error: request for member 'at' in 'S', which is of non-class type 'int'
17 | else if (S.at(i)/8==0){
| ^~
a.cc:18:15: error: request for member 'at' in 'S', which is of non-class type 'int'
18 | cout<<S.at(i)<<endl;
| ^~
a.cc:20:16: error: request for member 'at' in 'S', which is of non-class type 'int'
20 | else if (S.at(i)/32==0){
| ^~
a.cc:21:15: error: request for member 'at' in 'S', which is of non-class type 'int'
21 | cout<<S.at(i)<<endl;
| ^~
a.cc:23:16: error: request for member 'at' in 'S', which is of non-class type 'int'
23 | else if (S.at(i)/32==0){
| ^~
a.cc:24:15: error: request for member 'at' in 'S', which is of non-class type 'int'
24 | cout<<S.at(i)<<endl;
| ^~
|
s479456883 | p03644 | C++ | #include<bits/stdc++.h>
using namespace std;
int n;
int max_count(-1);
int main() {
cin >> n;
for (int i(1); i <= n; i++) {
int tmp = i;
int count(0);
int max(0);
while (tmp % 2 == 0) {
tmp /= 2;
count++;
}
if (count > max_count) {
max_count = count;
max = i;
}
}
cout << max << endl;
} | a.cc: In function 'int main()':
a.cc:20:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
20 | cout << max << 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; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::n |
s990240001 | p03644 | C++ | #include <iostream>
using namespace std;
int n;
int max_count(-1);
int main() {
cin >> n;
for (int i(1); i <= n; i++) {
int tmp = i;
int count(0);
int max(0);
while (tmp % 2 == 0) {
tmp /= 2;
count++;
}
if (count > max_count) {
max_count = count;
max = i;
}
}
cout << max << endl;
} | a.cc: In function 'int main()':
a.cc:20:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
20 | cout << max << endl;
| ~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:41,
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; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::nullptr_t'
306 | operator<<(n |
s924413700 | p03644 | C++ | #include <iostream>
using namespace std;
int n;
int max_count(-1);
int main() {
cin >> n;
for (int i(1); i <= n; i++) {
int tmp = i;
int count(0);
int max(0);
while (tmp % 2 == 0) {
tmp /= 2;
count++;
}
if (count > max_count) {
max_count = count;
max = i;
}
}
cout << max << endl;
} | a.cc: In function 'int main()':
a.cc:20:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
20 | cout << max << endl;
| ~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:41,
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; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::nullptr_t'
306 | operator<<(n |
s415090674 | p03644 | C++ | #include <iostream>
using namespace std;
int n;
int max_count(-1);
int max;
int main(){
cin >> n;
for (int i(0); i < n; i++) {
int tmp = i+1;
int count(0);
while (tmp % 2 == 0) {
tmp /= 2;
count++;
}
if (count > max_count){
max_count = count;
max = i+1;
}
}
cout << max << endl;
} | a.cc: In function 'int main()':
a.cc:17:25: error: reference to 'max' is ambiguous
17 | max = i+1;
| ^~~
In file included from /usr/include/c++/14/string:51,
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/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:5:5: note: 'int max'
5 | int max;
| ^~~
a.cc:20:17: error: reference to 'max' is ambiguous
20 | cout << max << endl;
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:5:5: note: 'int max'
5 | int max;
| ^~~
|
s318569945 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int n;
int main{
int count(0), max(-1);
cin >> n;
for(int i(0); i<n; i++){
int tmp = i;
while(tmp%2 == 0){
tmp /= 2;
count++;
}
if(count>max)max=i;
}
cout << max << endl;
} | a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main{
| ^~~~
a.cc:5:3: error: expected primary-expression before 'int'
5 | int count(0), max(-1);
| ^~~
a.cc:5:3: error: expected '}' before 'int'
a.cc:4:9: note: to match this '{'
4 | int main{
| ^
a.cc:6:3: error: 'cin' does not name a type
6 | cin >> n;
| ^~~
a.cc:7:3: error: expected unqualified-id before 'for'
7 | for(int i(0); i<n; i++){
| ^~~
a.cc:7:17: error: 'i' does not name a type
7 | for(int i(0); i<n; i++){
| ^
a.cc:7:22: error: 'i' does not name a type
7 | for(int i(0); i<n; i++){
| ^
a.cc:15:3: error: 'cout' does not name a type
15 | cout << max << endl;
| ^~~~
a.cc:16:1: error: expected declaration before '}' token
16 | }
| ^
|
s556435932 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin>>N;
if(N==1){
cout<<1<<endl
}
else if(2<=N<4){
cout<<2<<endl;
}
else if(4<=N<8){
cout<<4<<endl;
}
else if(8<=N<16){
cout<<8<<endl;
}
else if(16<=N<32){
cout<<16<<endl;
}
else if(32<=N<64){
cout<<32<<endl;
}
else{
cout<<64<<endl;
}
} | a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before '}' token
8 | cout<<1<<endl
| ^
| ;
9 | }
| ~
|
s534592796 | p03644 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.next.Int();
int ans = 1;
while(0==0){
if(ans*2<=N){
ans*=2;
}
else{
break;
}
}
System.out.println(ans);
}
} | Main.java:6: error: cannot find symbol
int N = sc.next.Int();
^
symbol: variable next
location: variable sc of type Scanner
1 error
|
s027744676 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long N;
cin >> N;
int v[0];
int cnt = 0;
int tmp = 0;
if (N==1){
cout << 1 << endl;
return 0;
}
while (1)
{
tmp = pow(2, cnt);
if (tmp > 100)
{
break;
}
else
{
v.push_back(tmp);
cnt++;
}
}
int imax =0;
for (int i = 0; i < v.size(); i++)
{
if (v[i] <= N){
imax = max(imax,v[i]);
}
}
cout << imax << endl;
} | a.cc: In function 'int main()':
a.cc:30:15: error: request for member 'push_back' in 'v', which is of non-class type 'int [0]'
30 | v.push_back(tmp);
| ^~~~~~~~~
a.cc:37:27: error: request for member 'size' in 'v', which is of non-class type 'int [0]'
37 | for (int i = 0; i < v.size(); i++)
| ^~~~
|
s199637021 | p03644 | C++ | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for(int i = j; i < 129; i*=2) {
if(i > n) {
cout << i / 2;
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:7:15: error: 'j' was not declared in this scope
7 | for(int i = j; i < 129; i*=2) {
| ^
|
s204436308 | p03644 | C++ | #include <iostream>
using namespace std;
double main(){
double N;
cin >> N;
double max;
for (double i = 0; i < 7; ++i){
double A = pow(2, i);
if (A <= N){
max = A;
}
else break;
}
cout << max << endl;
}
| a.cc:4:1: error: '::main' must return 'int'
4 | double main(){
| ^~~~~~
a.cc: In function 'int main()':
a.cc:9:20: error: 'pow' was not declared in this scope
9 | double A = pow(2, i);
| ^~~
|
s568399488 | p03644 | C++ | #include <iostream>
using namespace std;
int main(){
int N;
cin >> N;
int max;
for (int i = 0; i < 7; ++i){
int A = pow(2, i);
if (A <= N){
max = A;
}
else break;
}
cout << max << endl;
}
| a.cc: In function 'int main()':
a.cc:9:17: error: 'pow' was not declared in this scope
9 | int A = pow(2, i);
| ^~~
|
s738002106 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,kai;
cin >> N;
while(int i = 0){
if(2**(i) <= N) {
kai = std::pow(2, i);
i++;
}
else break;
}
cout << kai <<endl;
} | a.cc: In function 'int main()':
a.cc:10:21: error: invalid type argument of unary '*' (have 'int')
10 | if(2**(i) <= N) {
| ^~~~
|
s296556159 | p03644 | C++ | #include <iostream>
using namespace std;
int main(){
int N;
cin >> N;
int max;
for (int i = 0; i < 7; ++i){
int A = 2**i;
if (A <= N){
max = A;
}
else break;
}
cout << max << endl;
}
| a.cc: In function 'int main()':
a.cc:9:19: error: invalid type argument of unary '*' (have 'int')
9 | int A = 2**i;
| ^~
|
s924090411 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,kai;
cin >> N;
while(int i = 0){
if(2**(i) <= N) {
kai = 2**(i);
i++;
}
else break;
}
cout << kai <<endl;
} | a.cc: In function 'int main()':
a.cc:10:21: error: invalid type argument of unary '*' (have 'int')
10 | if(2**(i) <= N) {
| ^~~~
a.cc:11:33: error: invalid type argument of unary '*' (have 'int')
11 | kai = 2**(i);
| ^~~~
|
s398483811 | p03644 | C++ | #include <iostream>
using namespace std;
int main(){
int N;
cin >> N;
int max;
for (int i = 0; i<7; ++i){
if (2**i <= N){
max = 2**i;
}
else break;
}
cout << max << endl;
}
| a.cc: In function 'int main()':
a.cc:9:15: error: invalid type argument of unary '*' (have 'int')
9 | if (2**i <= N){
| ^~
a.cc:10:21: error: invalid type argument of unary '*' (have 'int')
10 | max = 2**i;
| ^~
|
s763437590 | p03644 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int res, kai, j;
int maxN = 0;
for(int i=1; i <=N; i++){
j = i;
res = 0;
while(true){
bool fl = false ;
if( j%2==1){
fl = true ;
}
else{
j = j/2;
res = res + 1;
}
if(fl) break;
}
if(maxN =< res) {
maxN = res ;
kai = i ;
}
}
cout << kai << endl;
}
| a.cc: In function 'int main()':
a.cc:24:17: error: expected primary-expression before '<' token
24 | if(maxN =< res) {
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.