submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s280285468
p03644
C++
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> using namespace std; int inf = (1 << 30); int mod = 1e9; long long long_inf = (1 << 60); int main(){ int N; cin >> N; int ans = 0; for(int i = 1; pow(2, i) <= N; i++){ ans = pow(2, i); } cout << ans << endl; return 0; }
a.cc:11:25: warning: left shift count >= width of type [-Wshift-count-overflow] 11 | long long long_inf = (1 << 60); | ~~^~~~~ a.cc: In function 'int main()': a.cc:19:20: error: 'pow' was not declared in this scope 19 | for(int i = 1; pow(2, i) <= N; i++){ | ^~~
s603113442
p03644
C++
#include<iostream> using 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: In function 'int main()': a.cc:27:4: error: expected '}' at end of input 27 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s929339147
p03644
C++
#include<iostream> using 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: In function 'int main()': a.cc:25:14: error: expected primary-expression before '<' token 25 | else if(N =< 100){ | ^ a.cc:27:4: error: expected '}' at end of input 27 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s174251298
p03644
C++
#include<iostream> using namespace std; int main() { int N; cin >> N; int ans; for(int i; i<6; ++i){ if(pow(2,i)<=N) ans = pow(2,i); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:11:8: error: 'pow' was not declared in this scope 11 | if(pow(2,i)<=N) ans = pow(2,i); | ^~~
s167890726
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; for( int i = 0; i < N; i++ ) { if( 2 ^ i >= N ) { i--; i = 2 ^ i cout << i << endl; break; } } }
a.cc: In function 'int main()': a.cc:10:16: error: expected ';' before 'cout' 10 | i = 2 ^ i | ^ | ; 11 | cout << i << endl; | ~~~~
s175978663
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; for( int i = 0; i < N; i++ ) { if( 2 ^ i >= N ) { i--; cout << 2 ^ i << endl; break; } } }
a.cc: In function 'int main()': a.cc:10:21: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 10 | cout << 2 ^ i << endl; | ~~^~~~~~~
s296912558
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; for( int i = 0; i < N; i++ ) { if( 2 ^ i >= N ) { i--; cout << 2^i << endl; break; } } }
a.cc: In function 'int main()': a.cc:10:19: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 10 | cout << 2^i << endl; | ~~^~~~~~~
s016522011
p03644
C++
from sys import exit # A,B,C = [int(n) for n in input().split()] N = int(input()) # a = [int(input()) for _ in range(N)] # S = str(input()) # L = len(S) # T = str(input()) maxd = 0 for i in range(1,N+1): tmp = i tmpa = 0 while(tmp%2 == 0): tmp//=2 tmpa +=1 if(maxd < tmpa): ans = i maxd = tmpa print(ans)
a.cc:2:3: error: invalid preprocessing directive #A 2 | # A,B,C = [int(n) for n in input().split()] | ^ a.cc:4:3: error: invalid preprocessing directive #a 4 | # a = [int(input()) for _ in range(N)] | ^ a.cc:5:3: error: invalid preprocessing directive #S 5 | # S = str(input()) | ^ a.cc:6:3: error: invalid preprocessing directive #L 6 | # L = len(S) | ^ a.cc:7:3: error: invalid preprocessing directive #T 7 | # T = str(input()) | ^ a.cc:1:1: error: 'from' does not name a type 1 | from sys import exit | ^~~~
s857641619
p03644
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0;i < n;i++) int N; int x; //--------------------------------------------------------------------------------------------------- void main() { cin >> N; int macnt = -1, ans = -1; rep(x, 1, N + 1) { int cnt = 0; int y = x; while (y % 2 == 0) y /= 2, cnt++; if (macnt < cnt) macnt = cnt, ans = x; } cout << ans << endl; }
a.cc:11:20: error: macro "rep" passed 3 arguments, but takes just 2 11 | rep(x, 1, N + 1) { | ^ a.cc:4:9: note: macro "rep" defined here 4 | #define rep(i, n) for(int i = 0;i < n;i++) | ^~~ a.cc:8:1: error: '::main' must return 'int' 8 | void main() { | ^~~~ a.cc: In function 'int main()': a.cc:11:5: error: 'rep' was not declared in this scope 11 | rep(x, 1, N + 1) { | ^~~
s261660579
p03644
C++
#include<bits/stdc++.h> using namespace std; int N; //--------------------------------------------------------------------------------------------------- void main() { cin >> N; int macnt = -1, ans = -1; rep(x, 1, N + 1) { int cnt = 0; int y = x; while (y % 2 == 0) y /= 2, cnt++; if (macnt < cnt) macnt = cnt, ans = x; } cout << ans << endl; }
a.cc:6:1: error: '::main' must return 'int' 6 | void main() { | ^~~~ a.cc: In function 'int main()': a.cc:9:9: error: 'x' was not declared in this scope 9 | rep(x, 1, N + 1) { | ^ a.cc:9:5: error: 'rep' was not declared in this scope 9 | rep(x, 1, N + 1) { | ^~~
s008599926
p03644
C++
#include<bits/stdc++.h> using namespace std; int N; //--------------------------------------------------------------------------------------------------- void _main() { cin >> N; int macnt = -1, ans = -1; rep(x, 1, N + 1) { int cnt = 0; int y = x; while (y % 2 == 0) y /= 2, cnt++; if (macnt < cnt) macnt = cnt, ans = x; } cout << ans << endl; }
a.cc: In function 'void _main()': a.cc:9:9: error: 'x' was not declared in this scope 9 | rep(x, 1, N + 1) { | ^ a.cc:9:5: error: 'rep' was not declared in this scope 9 | rep(x, 1, N + 1) { | ^~~
s792651362
p03644
C++
#include<bits/stdc++.h> using namespace std; int N; //--------------------------------------------------------------------------------------------------- void _main() { cin >> N; int macnt = -1, ans = -1; rep(x, 1, N + 1) { int cnt = 0; int y = x; while (y % 2 == 0) y /= 2, cnt++; if (macnt < cnt) macnt = cnt, ans = x; } cout << ans << endl; }
a.cc: In function 'void _main()': a.cc:9:9: error: 'x' was not declared in this scope 9 | rep(x, 1, N + 1) { | ^ a.cc:9:5: error: 'rep' was not declared in this scope 9 | rep(x, 1, N + 1) { | ^~~
s095983395
p03644
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; const int maxn=0x7fffff; int main(){ int n,ma=-1,num; cin>>n; for(int i=1;i<=n;i++){ int x=0; int nn=i; while(nn%2==0){ nn/=2; x++;. } if(x>ma){ ma=x; num=i; } } cout<<num; return 0; }
a.cc: In function 'int main()': a.cc:15:29: error: expected primary-expression before '.' token 15 | x++;. | ^ a.cc:16:17: error: expected unqualified-id before '}' token 16 | } | ^
s086547486
p03644
C++
#include<iostream> using namespace std; int main(){ int i,n; cin>>n; while(i<n){ i*=2; } if(i<=n){ cout<<i<<endl; } else if(i>n){ cout<<i/2<<endl; } return 0; }#include<iostream> using namespace std; int main(){ int i,n; cin>>n; while(i<n){ i*=2; } if(i<=n){ cout<<i<<endl; } else if(i>n){ cout<<i/2<<endl; } return 0; }
a.cc:16:2: error: stray '#' in program 16 | }#include<iostream> | ^ a.cc:16:3: error: 'include' does not name a type 16 | }#include<iostream> | ^~~~~~~ a.cc:18:5: error: redefinition of 'int main()' 18 | int main(){ | ^~~~ a.cc:3:5: note: 'int main()' previously defined here 3 | int main(){ | ^~~~
s742059424
p03644
C++
#include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; int res = 0; while (true) { N /= 2; if (N % 2 !=0) break; ++res; } cout << pow(2,(double)res) << endl; }
a.cc: In function 'int main()': a.cc:14:17: error: 'pow' was not declared in this scope 14 | cout << pow(2,(double)res) << endl; | ^~~
s420173605
p03644
C++
#include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; int res = 0; while (true) { N /= 2; if (N % 2 !=0) break; ++res; } cout << pow(2,res) << endl; }
a.cc: In function 'int main()': a.cc:14:17: error: 'pow' was not declared in this scope 14 | cout << pow(2,res) << endl; | ^~~
s530542045
p03644
C++
#include <iostream> #include <string> using namespace std; double main() { int N; cin >> N; int res = 0; while (true) { N /= 2; if (N % 2 !=0) break; ++res; } cout << pow(2,res) << endl; }
a.cc:5:1: error: '::main' must return 'int' 5 | double main() { | ^~~~~~ a.cc: In function 'int main()': a.cc:14:17: error: 'pow' was not declared in this scope 14 | cout << pow(2,res) << endl; | ^~~
s534815182
p03644
C++
#include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; int res = 0; while (true) { N /= 2; if (N % 2 !=0) break; ++res; } cout << pow(2.0,res) << endl; }
a.cc: In function 'int main()': a.cc:14:17: error: 'pow' was not declared in this scope 14 | cout << pow(2.0,res) << endl; | ^~~
s137978482
p03644
C++
#include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; int res = 0; while (true) { N /= 2; if (N % 2 !=0) break; ++res; } cout << pow(2.0,res) << endl; }
a.cc: In function 'int main()': a.cc:14:17: error: 'pow' was not declared in this scope 14 | cout << pow(2.0,res) << endl; | ^~~
s729567581
p03644
C++
#include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; int res = 0; while (true) { N /= 2; if (N % 2 !=0) break; ++res; } cout << pow(2,res) << endl; }
a.cc: In function 'int main()': a.cc:14:17: error: 'pow' was not declared in this scope 14 | cout << pow(2,res) << endl; | ^~~
s114477850
p03644
C++
#include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; int res = 0; while (true) { N /= 2; if (N % 2 == 1) break; ++res; } cout << pow(2,res) << endl; }
a.cc: In function 'int main()': a.cc:14:17: error: 'pow' was not declared in this scope 14 | cout << pow(2,res) << endl; | ^~~
s506381715
p03644
C++
#include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; int res = 0; while (true) { n /= 2; if (n % 2 == 1) break; ++res; } cout << pow(2,res) << endl; }
a.cc: In function 'int main()': a.cc:10:17: error: 'n' was not declared in this scope 10 | n /= 2; | ^ a.cc:14:17: error: 'pow' was not declared in this scope 14 | cout << pow(2,res) << endl; | ^~~
s578707153
p03644
C++
#include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; res = 0; while (true) { n /= 2; if (n % 2 == 1) break; ++res; } cout << pow(2,res) << endl; }
a.cc: In function 'int main()': a.cc:8:9: error: 'res' was not declared in this scope 8 | res = 0; | ^~~ a.cc:10:17: error: 'n' was not declared in this scope 10 | n /= 2; | ^ a.cc:14:17: error: 'pow' was not declared in this scope 14 | cout << pow(2,res) << endl; | ^~~
s739429415
p03644
C++
#include<iostream> using namespace std; int main(void){ int N; cin >> N; int ans = 1; while(N >= ans) ans <<= 1 cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:28: error: expected ';' before 'cout' 9 | while(N >= ans) ans <<= 1 | ^ | ; 10 | cout << ans << endl; | ~~~~
s148408208
p03644
C++
#include <iostream> using namespace std; int main(void){ int N; cin>>N; if(N==1){ cout<<1<<endl; }else if(N<4){ cout<<2<<endl; }else if(N<7){ cout<<4<<endl; }else if(N<8){ cout<<4<<endl; }else if(N<16){ cout<<8<<endl; }else if(N<32){ cout<<16<<endl; }else if(N<64){ cout<<32<<endl; }else{ cout<<64<<endl; } return 0;
a.cc: In function 'int main()': a.cc:23:14: error: expected '}' at end of input 23 | return 0; | ^ a.cc:3:15: note: to match this '{' 3 | int main(void){ | ^
s666717766
p03644
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; int max; for (int i = 0; i < 7; i++) { int two_pow_i = int(pow(2, i)); if (two_pow_i > N) { max = int(pow(2, i-1)); break; } } cout << max << endl; }
a.cc: In function 'int main()': a.cc:9:29: error: 'pow' was not declared in this scope 9 | int two_pow_i = int(pow(2, i)); | ^~~
s899298776
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { // ここにプログラムを追記 int N; cin >> N; int c = 0; int m = 0; vector<int> vec(110); for(int i = 0; i<N; i++){ vec.at(i) = i; } while(true){ bool check = false; for(int i = 0; i<N; i++){ if(vec.at(i)%2 != 0)check = true; if(check)break; for(int i = 0; i<N; i++){ vec.at(i) /= 2; } c++; if(c>m)m=c; } }
a.cc: In function 'int main()': a.cc:28:2: error: expected '}' at end of input 28 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s215517172
p03644
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; if (n>=64) cout << 6 << endl; else if (n>=32) cout << 5 << endl; else if (n>=16) cout << 4 << endl; else if (n>=8) cout << 3 << endl; else if (n>=4) cout << 2 << endl; else if (n>=2) cout << 1 << endl; else if cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:13:12: error: expected '(' before 'cout' 13 | else if cout << 0 << endl; | ^~~~ | (
s095982015
p03644
C
#include <stdio.h> int main(){ int n,max = 0; scanf("%d",&n); for(int i = 1;i <= n;i++){ int cnt = 0; int j = i; whole(j % 2 < 1){ cnt++; j /= 2; } if(max < cnt){ max = cnt; } } printf("%d\n",cnt); return 0; }
main.c: In function 'main': main.c:8:5: error: implicit declaration of function 'whole' [-Wimplicit-function-declaration] 8 | whole(j % 2 < 1){ | ^~~~~ main.c:8:21: error: expected ';' before '{' token 8 | whole(j % 2 < 1){ | ^ | ; main.c:16:17: error: 'cnt' undeclared (first use in this function); did you mean 'int'? 16 | printf("%d\n",cnt); | ^~~ | int main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in
s179261873
p03644
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >>N; int res=0; int ans=0; for (int i=1;i<=N;i++){ int cnt=0; int j=i; while(true){ if(j%2==0){ j/=2; cnt++; }else{ break; } } if(res<cnt){ res=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:5:11: note: to match this '{' 5 | int main(){ | ^
s393751849
p03644
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >>N; int res=0; for (int i=1;i<=N;i++){ int cnt=0; int j=i; while(true){ if(j%2==0){ j/=2; cnt++; }else{ break; } if(res<cnt)res=cnt; } cout <<res <<endl; }
a.cc: In function 'int main()': a.cc:23:2: error: expected '}' at end of input 23 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s341606762
p03644
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >>N; int res=0; for (int i=1;i<=N;i++){ int cnt=0; int j=i; while(true){ if(j%2==0){ j/=2; cnt++; }else{ break; } if(res<cnt)res=cnt; } cout <<res<<endl; }
a.cc: In function 'int main()': a.cc:23:2: error: expected '}' at end of input 23 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s449498986
p03644
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >>N; int res=0 for (int i=1;i<=N;i++){ int cnt=0; int j=i; while(true){ if(j%2==0){ j/=2; cnt++; }else{ break; } if(res<cnt)res=cnt; } cout <<res<<endl; }
a.cc: In function 'int main()': a.cc:9:3: error: expected ',' or ';' before 'for' 9 | for (int i=1;i<=N;i++){ | ^~~ a.cc:9:16: error: 'i' was not declared in this scope 9 | for (int i=1;i<=N;i++){ | ^ a.cc:23:2: error: expected '}' at end of input 23 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s089649080
p03644
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >>N; int res=0 for (int i=0;i<N;i++){ int cnt=0; int j=i; while(true){ if(j%2==0){ j/=2; cnt++; }else{ break; } if(res<cnt)res=cnt; } cout <<res<<endl; }
a.cc: In function 'int main()': a.cc:9:3: error: expected ',' or ';' before 'for' 9 | for (int i=0;i<N;i++){ | ^~~ a.cc:9:16: error: 'i' was not declared in this scope 9 | for (int i=0;i<N;i++){ | ^ a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s265196001
p03644
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a;cin>>a; for(int i=1;i<=a;i=i*2); cout<<i<<endl;}
a.cc: In function 'int main()': a.cc:6:9: error: 'i' was not declared in this scope 6 | cout<<i<<endl;} | ^
s525365459
p03644
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; int max = 0; for (int i = 1; i <= N; ++i) { bool can = true; int number = i; int count = 0; while(can) { if (number % 2 == 0) { number /= 2; ++count; } else { can = false; if (count > max) { res = i; } } } } cout << res << endl; }
a.cc: In function 'int main()': a.cc:20:21: error: 'res' was not declared in this scope 20 | res = i; | ^~~ a.cc:25:13: error: 'res' was not declared in this scope 25 | cout << res << endl; | ^~~
s926672256
p03644
C++
#include <bits/stdc++.h> using namespace std; /* REPmacro */ #define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i) #define REPR(i,n) for(int i=((int)(n)-1);i>=0;--i) #define FOR(i,m,n) for(int i=(int)(m);i<=(int)(n);++i) /*alias*/ #define ALL(x) (x).begin(),(x).end() #define SZ(x) ((int)(x).size()) #define F first #define S second #define PB push_back #define MP make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 #define next asdnext #define prev asdprev /*using*/ using ll = long long; using ull = unsigned long long; using unsi = unsigned; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using pii = pair<int, int>; using db = double; using plex = complex<double>; using vs = vector<string>; /*template*/ template<class T>inline bool amax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>inline bool amin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } /* func */ int gcd(int a,int b){return b?gcd(b,a%b):a;} /*struct*/ struct aaa{ aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); }; }aaaaaaa; /* const */ const int INF = 1001001001; const ll LINF = 1001001001001001001ll; const int MOD = 1e9 + 7; //10^9 const db EPS = 1e-9; const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1}; //#define int ll //#define int long long signed main() { int n; cin >> n;  int exp = log2(n); cout << pow(2,exp); return 0; }
a.cc:65:3: error: extended character   is not valid in an identifier 65 |  int exp = log2(n); | ^ a.cc: In function 'int main()': a.cc:65:3: error: '\U00003000int' was not declared in this scope 65 |  int exp = log2(n); | ^~~~~ a.cc:67:14: error: no matching function for call to 'pow(int, <unresolved overloaded function type>)' 67 | cout << pow(2,exp); | ~~~^~~~~~~ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/bits/valarray_after.h:549:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Constant, std::_ValArray, _Tp, _Tp>, _Tp> std::pow(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::valarray<_Tp>' and 'float(float)' 67 | cout << pow(2,exp); | ~~~^~~~~~~ a.cc:67:14: note: mismatched types 'const std::valarray<_Tp>' and 'long double(long double)' a.cc:67:14: note: mismatched types 'const std::valarray<_Tp>' and 'double(double) noexcept' a.cc:67:14: note: couldn't deduce template parameter '_Tp' /usr/include/c++/14/bits/valarray_after.h:549:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_ValArray, std::_Constant, _Tp, _Tp>, _Tp> std::pow(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::valarray<_Tp>' and 'int' 67 | cout << pow(2,exp); | ~~~^~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_ValArray, std::_ValArray, _Tp, _Tp>, _Tp> std::pow(const valarray<_Tp>&, const valarray<_Tp>&)' 549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::valarray<_Tp>' and 'int' 67 | cout << pow(2,exp); | ~~~^~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename _Dom::value_type> std::pow(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'float(float)' 67 | cout << pow(2,exp); | ~~~^~~~~~~ a.cc:67:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long double(long double)' a.cc:67:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'double(double) noexcept' a.cc:67:14: note: couldn't deduce template parameter '_Dom' /usr/include/c++/14/bits/valarray_after.h:549:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename _Dom::value_type> std::pow(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 67 | cout << pow(2,exp); | ~~~^~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename _Dom::value_type> std::pow(const valarray<typename _Dom::valarray>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'float(float)' 67 | cout << pow(2,exp); | ~~~^~~~~~~ a.cc:67:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long double(long double)' a.cc:67:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'double(double) noexcept' a.cc:67:14: note: couldn't deduce template parameter '_Dom' /usr/include/c++/14/bits/valarray_after.h:549:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename _Dom::value_type> std::pow(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 67 | cout << pow(2,exp); | ~~~^~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::_Pow, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename _Dom1::value_type> std::pow(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 549 | _DEFINE_EXPR_BINARY_FUNCTION(pow, struct std::_Pow) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:549:1: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 67 | cout << pow(2,exp); | ~~~^~~~~~~ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:2482:5: note: candidate: 'template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote<decltype (((typename __gnu_cxx::__promote<_Tp, std::__is_integer<_Tp>::__value>::__type)(0) + (typename __gnu_cxx::__promote<_Up, std::__is_integer<_Up>::__value>::__type)(0)))>::__type> std::pow(const complex<_Tp>&, const complex<_Up>&)' 2482 | pow(const std::complex<_Tp>& __x, const std::complex<_Up>& __y) | ^~~ /usr/include/c++/14/complex:2482:5: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::complex<_Tp>' and 'int' 67 | cout << pow(2,exp); | ~~~^~~~~~~ /usr/include/c++/14/complex:2474:5: note: candidate: 'template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote<decltype (((typename __gnu_cxx::__promote<_Tp, std::__is_integer<_Tp>::__value>::__type)(0) + (typename __gnu_cxx::__promote<_Up, std::__is_integer<_Up>::__value>::__type)(0)))>::__type> std::pow(const _Tp&, const complex<_Up>&)' 2474 | pow(const _Tp& __x, const std::complex<_Up>& __y) | ^~~ /usr/include/c++/14/complex:2474:5: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::complex<_Up>' and 'float(float)' 67 | cout << pow(2,exp); | ~~~^~~~~~~ a.cc:67:14: note: mismatched types 'const std::complex<_Up>' and 'long double(long double)' a.cc:67:14: note: mismatched types 'const std::complex<_Up>' and 'double(double) noexcept' a.cc:67:14: note: couldn't deduce template parameter '_Up' /usr/include/c++/14/complex:2466:5: note: candidate: 'template<class _Tp, class _Up> std::complex<typename __gnu_cxx::__promote<decltype (((typename __gnu_cxx::__promote<_Tp, std::__is_integer<_Tp>::__value>::__type)(0) + (typename __gnu_cxx::__promote<_Up, std::__is_integer<_Up>::__value>::__type)(0)))>::__type> std::pow(const complex<_Tp>&, const _Up&)' 2466 | pow(const std::complex<_Tp>& __x, const _Up& __y) | ^~~ /usr/include/c++/14/complex:2466:5: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::complex<_Tp>' and 'int' 67 | cout << pow(2,exp); | ~~~^~~~~~~ /usr/include/c++/14/complex:1339:5: note: candidate: 'std::complex<_Tp> std::pow(const _Tp&, const complex<_Tp>&) [with _Tp = int]' 1339 | pow(const _Tp& __x, const complex<_Tp>& __y) | ^~~ /usr/include/c++/14/complex:1339:45: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to 'const std::complex<int>&' 1339 | pow(const _Tp& __x, const complex<_Tp>& __y) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/complex:1328:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::pow(const complex<_Tp>&, const complex<_Tp>&)' 1328 | pow(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~ /usr/include/c++/14/complex:1328:5: note: template argument deduction/substitution failed: a.cc:67:14: note: mismatched types 'const std::complex<_Tp>' and 'int' 67 | cout << pow(2,exp); | ~~~^~~~~~~ /usr/include/c++/14/complex:1294:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::pow(const complex<_Tp>&, const _Tp&)' 1294 | pow(const complex<_Tp>& __x, const _Tp& __y) | ^~~ /usr/include/c++/14/complex:1294:5: note: template argument dedu
s750183214
p03644
C++
#include<iostream> #include <cstdio> #include <algorithm> using namespace std; /*struct*/ struct aaa{ aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); }; }aaaaaaa; int N, A[200]; int main() { int dmin = 1000; cin >> N; for (int i = 0; i < N; ++i) { int A; cin >> A; int d = 0; while (A % 2 == 0) { A /= 2; ++d; } dmin = min(dmin, d); } cout << dmin; return 0; }
a.cc: In constructor 'aaa::aaa()': a.cc:9:59: error: 'setprecision' was not declared in this scope 9 | cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); | ^~~~~~~~~~~~ a.cc:4:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>' 3 | #include <algorithm> +++ |+#include <iomanip> 4 | using namespace std;
s265830147
p03644
C++
#include <cstdio> #include <algorithm> using namespace std; /*struct*/ struct aaa{ aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); }; }aaaaaaa; int N, A[200]; int main() { int dmin = 1000; cin >> N; for (int i = 0; i < N; ++i) { int A; cin >> A; int d = 0; while (A % 2 == 0) { A /= 2; ++d; } dmin = min(dmin, d); } cout << dmin; return 0; }
a.cc: In constructor 'aaa::aaa()': a.cc:8:9: error: 'cin' was not declared in this scope 8 | cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <algorithm> +++ |+#include <iostream> 3 | using namespace std; a.cc:8:21: error: 'ios' has not been declared 8 | cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); | ^~~ a.cc:8:46: error: 'cout' was not declared in this scope 8 | cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); | ^~~~ a.cc:8:46: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:8:52: error: 'fixed' was not declared in this scope 8 | cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); | ^~~~~ a.cc:3:1: note: 'std::fixed' is defined in header '<ios>'; this is probably fixable by adding '#include <ios>' 2 | #include <algorithm> +++ |+#include <ios> 3 | using namespace std; a.cc:8:59: error: 'setprecision' was not declared in this scope 8 | cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); | ^~~~~~~~~~~~ a.cc:3:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>' 2 | #include <algorithm> +++ |+#include <iomanip> 3 | using namespace std; a.cc: In function 'int main()': a.cc:20:9: error: 'cin' was not declared in this scope 20 | cin >> N; | ^~~ a.cc:20:9: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:31:9: error: 'cout' was not declared in this scope 31 | cout << dmin; | ^~~~ a.cc:31:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s602648042
p03644
C++
#include<iostream> #include<algorithm> #include<cmath> #include<cstdio> #include<string> #include<vector> #include<list> #include<set> #include<cctype> #define ld long double #define ll long long int #define ull unsigned long long int using namespace std; template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;} template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;} const long long INF=1LL<<60; int main(void){ ios::sync_with_stdio(false); cin.tie(0); a[]={64,32,16,8,4,2,1}; int n,i; cin>>n; for(i=0;i<7;i++){ if(a[i]<=n){ cout<<a[i]<<endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:22:9: error: 'a' was not declared in this scope 22 | a[]={64,32,16,8,4,2,1}; | ^ a.cc:22:11: error: expected primary-expression before ']' token 22 | a[]={64,32,16,8,4,2,1}; | ^
s625093488
p03644
C++
#include<algorithm> #include<iostream> #include<functional> #include<cmath> #include<iomanip> using namespace std; int main(){ int n,a=1; cin>>n; if(n==1) cout<<1<<endl; else{ for(int i=0;i<100;i++){ a*=2; count++; if(a>n) break; } cout<<a/2<<endl; } }
a.cc: In function 'int main()': a.cc:15:12: error: no post-increment operator for type 15 | count++; | ^~
s403492943
p03644
C++
#include <iostream> using ll = long long; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll n,m; cin >> n; int t =1; while((t<<1)<=n)t=t<<1; cout << t; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin.tie(0); | ^~~ | std::cin In file included from a.cc:2: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:9:9: error: 'ios' has not been declared 9 | ios::sync_with_stdio(false); | ^~~ a.cc:14:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 14 | cout << t; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s073963637
p03644
C++
#include<iostream> #include<math.h> using namespace std; int main(){ int N; cin >> N; int i=0; int c; while(pow(2,i)<=N){ c=pow(2,i); i++ } cout << c << endl; }
a.cc: In function 'int main()': a.cc:13:8: error: expected ';' before '}' token 13 | i++ | ^ | ; 14 | } | ~
s282609848
p03644
C++
#include <bits/stdc++.h> using namespace std; int func(int x) { if (x % 2 == 1) return 0; return func(x / 2) + 1; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; int maxv = 0; int ans; for (int i = 1; i <= n; i++) { if (maxv < func(i)) { maxv = func(i); ans = i; } } cout << ans << endl; }
a.cc: In function 'int func(int)': a.cc:9:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 9 | int main() { | ^~ a.cc:9:9: note: remove parentheses to default-initialize a variable 9 | int main() { | ^~ | -- a.cc:9:9: note: or replace parentheses with braces to value-initialize a variable a.cc:9:12: error: a function-definition is not allowed here before '{' token 9 | int main() { | ^ a.cc:25:2: error: expected '}' at end of input 25 | } | ^ a.cc:5:17: note: to match this '{' 5 | int func(int x) { | ^
s585619554
p03644
C++
#include <iostream> #include <algorithm> #include <vector> #include<string> using namespace std; int main() { int N; cin >> N; int ans = 0; int res = 1; for (int i = 1;i <= N;i++) { if (i % 2 == 0) { int s = 0; for (int j = i;j%2 == 0;j /= 2) { s++; if (ans < s) { ans = s; res = i; } } } } cout << res << endl;
a.cc: In function 'int main()': a.cc:25:37: error: expected '}' at end of input 25 | cout << res << endl; | ^ a.cc:8:1: note: to match this '{' 8 | { | ^
s161146540
p03644
C++
#include <iostream> using namespace std; int N; int main(){ cin >> N; if(N=1){N=1} else if(2<=N<=3){N=2} else if(4<=N<=7){N=4} else if(8<=N<=15){N=8} else if(16<=N<=31){N=16} else if(32<=N<=63){N=32;} else{N=64;} cout << N << endl; }
a.cc: In function 'int main()': a.cc:7:16: error: expected ';' before '}' token 7 | if(N=1){N=1} | ^ | ; a.cc:8:25: error: expected ';' before '}' token 8 | else if(2<=N<=3){N=2} | ^ | ; a.cc:9:25: error: expected ';' before '}' token 9 | else if(4<=N<=7){N=4} | ^ | ; a.cc:10:26: error: expected ';' before '}' token 10 | else if(8<=N<=15){N=8} | ^ | ; a.cc:11:28: error: expected ';' before '}' token 11 | else if(16<=N<=31){N=16} | ^ | ;
s508908096
p03644
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N, max_number, result; cin >> N; vector<int> vec(N); vector<int> count(N); for(int i = 0; i < N; i++){ vec.at(i) = i + 1; } vector<int> copy1 = vec; for(int i = 0; i < N / 2; i++){ for(int i = 0; i < N; i++){ if( vec.at(i) % 2 == 0){ vec.at(i) /= 2; count.at(i)++; } } } vector<int> copy = count; sort(count.begin(), count.end()); reverse(count.begin(), count.end()); max_number = count.at(0); for(int i = 0; i < N; i++){ if(max_number == copy.at(i)){ result = i; break; } } cout << copy1.at(result) << endl; }
a.cc: In function 'int main()': a.cc:23:3: error: 'sort' was not declared in this scope; did you mean 'short'? 23 | sort(count.begin(), count.end()); | ^~~~ | short a.cc:24:3: error: 'reverse' was not declared in this scope 24 | reverse(count.begin(), count.end()); | ^~~~~~~
s919148362
p03644
C++
#include <algorithm> #include <iostream> #include <string> using namespace; int main(){ int n; int count = 0; cin >> n; while(n>1){ n /= 2; count ++; } cout << count << endl; }
a.cc:4:16: error: expected identifier before ';' token 4 | using namespace; | ^ a.cc: In function 'int main()': a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | cin >> n; | ^~~ | std::cin In file included from a.cc:2: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 14 | cout << count << 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:14:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 14 | cout << count << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s357396558
p03644
C++
#include <iostream> #include <bits/stdc++.h> using namespace std; int main(){ int N = 0; int a = 0; int max = 0; cin >> N; int counter = 0; bool flag = true; for(int i; i < N; i++){ a = i while(a > 1){ if(a % 2 != 0) break; a /= 2; counter++; } if (max <= counter) max = counter; counter = 0; } }
a.cc: In function 'int main()': a.cc:13:10: error: expected ';' before 'while' 13 | a = i | ^ | ; 14 | while(a > 1){ | ~~~~~
s000018043
p03644
C++
include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; int main() { int n; cin >> n; int ans = 0; int a = 0; for (int i = 2; i < 128; i*=2) { if (i<n) { ans = i; } else { break; } } cout << ans << endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> | ^~~ /usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> |
s782899354
p03644
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int counter = 0; for(int i = 0; i < 6){ if(n%2 == 0){ counter++; n = n/2; }else{ break; } } cout << counter << endl; }
a.cc: In function 'int main()': a.cc:7:23: error: expected ';' before ')' token 7 | for(int i = 0; i < 6){ | ^ | ;
s851626658
p03644
C++
#include <iostream> use namespace std; int main() { int n; cin >> n; for(; n % 2; --n); cout << n << endl; }
a.cc:3:1: error: 'use' does not name a type 3 | use namespace std; | ^~~ a.cc: In function 'int main()': a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin >> n; | ^~~ | std::cin In file included 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:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 9 | cout << n << 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:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 9 | cout << n << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s090156912
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; if(N<3){ cout << 3 << endl; } else if(N<5){ cout << 4 << endl; } else if(N<9){ cout << 8 << endl; } else if(N<17){ cout << 16 << endl; } else if(N<33){ cout << 32 << endl; } else else{ cout << 64 << endl; } }
a.cc: In function 'int main()': a.cc:21:7: error: expected primary-expression before 'else' 21 | else else{ | ^~~~
s784139034
p03644
C++
#ianclude<iostream> using namespace std; int main(){ int n; cin>>n; int ans=0; while(n%2==0){ ++ans; n/=2; } cout<<2*ans<<endl; }
a.cc:1:2: error: invalid preprocessing directive #ianclude; did you mean #include? 1 | #ianclude<iostream> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | 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 | #ianclude<iostream> a.cc:15:3: error: 'cout' was not declared in this scope 15 | cout<<2*ans<<endl; | ^~~~ a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:15:16: error: 'endl' was not declared in this scope 15 | cout<<2*ans<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #ianclude<iostream>
s982946362
p03644
C++
#ianclude<iostrea> using namespace std; int main(){ int n; cin>>n; int ans=0; while(n%2==0){ ++ans; n/=2; } cout<<2*ans<<endl; }
a.cc:1:2: error: invalid preprocessing directive #ianclude; did you mean #include? 1 | #ianclude<iostrea> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | 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 | #ianclude<iostrea> a.cc:15:3: error: 'cout' was not declared in this scope 15 | cout<<2*ans<<endl; | ^~~~ a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:15:16: error: 'endl' was not declared in this scope 15 | cout<<2*ans<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #ianclude<iostrea>
s643857752
p03644
C++
#ianclude<iostrea> using namespace std; int main(){ int n; cin>>n; int ans=0; while(N%2==0){ ++ans; n/=2; } cout<<2*ans>>endl; }
a.cc:1:2: error: invalid preprocessing directive #ianclude; did you mean #include? 1 | #ianclude<iostrea> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | 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 | #ianclude<iostrea> a.cc:10:9: error: 'N' was not declared in this scope 10 | while(N%2==0){ | ^ a.cc:15:3: error: 'cout' was not declared in this scope 15 | cout<<2*ans>>endl; | ^~~~ a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:15:16: error: 'endl' was not declared in this scope 15 | cout<<2*ans>>endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #ianclude<iostrea>
s097857907
p03644
C++
#include<iostream> using namespace std; int main(){ int n;cin>>n; int max=1; for(int i=0;i<n;i++){ if(pow(2,i)<=n&&pow(2,i+1)>n)max=pow(2,i); } cout<<max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:8: error: 'pow' was not declared in this scope 8 | if(pow(2,i)<=n&&pow(2,i+1)>n)max=pow(2,i); | ^~~
s055431591
p03644
C++
#include <bits/stdc++.h> using namespace std; int func(int N) { int num = 0; while (N % 2 == 0) { N %= 2; num++; } return num; } int main() { int ans = 0; for (int i = 1; i <= N; i++) { ans = max(ans, func(i)); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:15:24: error: 'N' was not declared in this scope 15 | for (int i = 1; i <= N; i++) { | ^
s733416268
p03644
Java
import java.util.Scanner; public class java{ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int Max = 0, MaxValue = 0; int count = 0; for (int i = 1; i <= N; i++) { int tempI = i; while(true) { if (tempI % 2 == 0) { ++count; tempI /= 2; } else { if(MaxValue < count) { Max = i; MaxValue = count; } break; } } count = 0; } System.out.println(Max); } }
Main.java:3: error: class java is public, should be declared in a file named java.java public class java{ ^ 1 error
s765375265
p03644
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int j = 0; int count = 0; if(n >= 64) cout << 6 << endl; else if (32 <= n && n < 64) cout << 5 << endl; else if (16 <= n && n < 32) cout << 4 << endl; else if (8 <= n && n < 16) cout << 3 << endl; else if (4 <= n && n < 8) cout << 2 << endl; else if (2 <= n && n < 4) cout << 1 << endl; else if (n == 1) cout << 0 << endl;
a.cc: In function 'int main()': a.cc:13:38: error: expected '}' at end of input 13 | else if (n == 1) cout << 0 << endl; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s060865599
p03644
C++
#include<iostream> using namespace std; int main() { int N, A[110], B[110]; cin >> N; for (int i = 1; i <= N; i++) { A[i] = i; } for (int i = 0; i <= N; i++) { B[i] == 0; } for (int i = 1; i <= N; i++) { while (true) { if (A[i] % 2 != 0) { break; } A[i] /= 2; B[i] += 1; } } int X=-1; for (int i = 1; i <= N; i++) { X = max(X, ans); } int ans=1; for (int i = 0; i < X; i++) { ans *= 2; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:24:28: error: 'ans' was not declared in this scope; did you mean 'abs'? 24 | X = max(X, ans); | ^~~ | abs
s309886858
p03644
C++
#include <iostream> using namespace std; int N; int main() { cin >> N; int res = 0; int a = 1; while (true) { bool w = false; for (int i = 0; i < N; ++i) { a *= 2 if (N < a) w = true; if(w) break; } } cout << a << endl; }
a.cc: In function 'int main()': a.cc:13:17: error: expected ';' before 'if' 13 | a *= 2 | ^ | ; 14 | if (N < a) w = true; | ~~
s026698174
p03644
C++
#include <iostream> using namespace std; int N; int main() { cin >> N; int res = 0; while (true) { bool exist_odd = false; for (int i = 1; i <= N; ++i) { if (i % 2 != 0) exist_odd = true; } if (exist_odd) break; for (int i = 0; i < N; ++i) { A[i] /= 2; } ++res; } int a; for (int j = 0;j < res;++j) { a *= 2; } cout << a << endl; }
a.cc: In function 'int main()': a.cc:19:13: error: 'A' was not declared in this scope 19 | A[i] /= 2; | ^
s947342199
p03644
C++
#include <iostream> using namespace std; int N; int main() { cin >> N; int res = 0; while (true) { bool exist_odd = false; for (int i = 1; i <= N; ++i) { if (i % 2 != 0) exist_odd = true; } if (exist_odd) break; for (int i = 0; i < N; ++i) { A[i] /= 2; } ++res; } int a; for (int j = 0;j < res;++j) { a *= 2; } cout << a << endl;
a.cc: In function 'int main()': a.cc:19:13: error: 'A' was not declared in this scope 19 | A[i] /= 2; | ^ a.cc:27:23: error: expected '}' at end of input 27 | cout << a << endl; | ^ a.cc:6:12: note: to match this '{' 6 | int main() { | ^
s176986245
p03644
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; int res = 0; while (true) { bool exist_odd = false; for (i = 1;i <= N;++i) { if (i % 2 != 0) exist_odd = true; } if (exist_odd) break; for (i = 1;i <= N;++i) { i /= 2; } ++res; } cout << res << endl; }
a.cc: In function 'int main()': a.cc:10:10: error: 'i' was not declared in this scope 10 | for (i = 1;i <= N;++i) { | ^ a.cc:14:10: error: 'i' was not declared in this scope 14 | for (i = 1;i <= N;++i) { | ^
s539946287
p03644
C
AtCoder Beginner Contest 068 日本語 siehna (Guest) コンテスト時間: 2017-07-29(土) 21:00 ~ 2017-07-29(土) 22:40 AtCoderホームへ戻る トップ 問題 質問 提出 提出一覧 順位表 コードテスト 解説 B - Break Number 実行時間制限: 2 sec / メモリ制限: 256 MB 配点 : 200 点 問題文 高橋君は 2 で割れる数が好きです。 正整数 N が与えられるので、 1 以上 N 以下の整数のうち、最も 2 で割れる回数が多いものを求めてください。答えは必ず 1 つに定まります。 なお、 2 で割っていき、何回あまりが出ずに割れるかを、 2 で割れる回数と呼ぶことにします。 例えば 6 ならば、 6 -> 3 で、 1 回 2 で割れます。 8 ならば、 8 -> 4 -> 2 -> 1 で、 3 回 2 で割れます。 3 ならば、 0 回 2 で割れます。 制約 1 ≦ N ≦ 100 入力 入力は以下の形式で標準入力から与えられる。 N 出力 問題の答えを出力する。 入力例 1 Copy 7 出力例 1 Copy 4 4 は 2 回 2 で割ることができ、これは 1 , 2 , ..., 7 の中で最も多いです。 入力例 2 Copy 32 出力例 2 Copy 32 入力例 3 Copy 1 出力例 3 Copy 1 入力例 4 Copy 100 出力例 4 Copy 64 言語 ソースコード 1 ​ ※ 512 KiB まで ※ ソースコードは「Main.拡張子」で保存されます ルール 用語集 よくある質問 利用規約 プライバシーポリシー 個人情報保護方針 企業情報 お問い合わせ 資料請求 Copyright 2018 ©AtCoder Inc. All rights reserved.
main.c:2:1: error: unknown type name 'AtCoder' 2 | AtCoder Beginner Contest 068 | ^~~~~~~ main.c:2:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Contest' 2 | AtCoder Beginner Contest 068 | ^~~~~~~ main.c:2:26: error: invalid digit "8" in octal constant 2 | AtCoder Beginner Contest 068 | ^~~ main.c:24:22: error: stray '\343' in program 24 | <U+3067><U+5272><U+308C><U+308B><U+6570><U+304C><U+597D><U+304D><U+3067><U+3059><U+3002> | ^~~~~~~~ main.c:28:18: error: stray '\343' in program 28 | <U+304C><U+4E0E><U+3048><U+3089><U+308C><U+308B><U+306E><U+3067><U+3001> | ^~~~~~~~ main.c:32:18: error: stray '\343' in program 32 | <U+4EE5><U+4E0B><U+306E><U+6574><U+6570><U+306E><U+3046><U+3061><U+3001><U+6700><U+3082> | ^~~~~~~~ main.c:34:40: error: stray '\343' in program 34 | <U+3067><U+5272><U+308C><U+308B><U+56DE><U+6570><U+304C><U+591A><U+3044><U+3082><U+306E><U+3092><U+6C42><U+3081><U+3066><U+304F><U+3060><U+3055><U+3044><U+3002><U+7B54><U+3048><U+306F><U+5FC5><U+305A> | ^~~~~~~~ main.c:36:16: error: stray '\343' in program 36 | <U+3064><U+306B><U+5B9A><U+307E><U+308A><U+307E><U+3059><U+3002> | ^~~~~~~~ main.c:38:5: error: stray '\343' in program 38 | <U+306A><U+304A><U+3001> | ^~~~~~~~ main.c:40:14: error: stray '\343' in program 40 | <U+3067><U+5272><U+3063><U+3066><U+3044><U+304D><U+3001><U+4F55><U+56DE><U+3042><U+307E><U+308A><U+304C><U+51FA><U+305A><U+306B><U+5272><U+308C><U+308B><U+304B><U+3092><U+3001> | ^~~~~~~~ main.c:40:44: error: stray '\343' in program 40 | <U+3067><U+5272><U+3063><U+3066><U+3044><U+304D><U+3001><U+4F55><U+56DE><U+3042><U+307E><U+308A><U+304C><U+51FA><U+305A><U+306B><U+5272><U+308C><U+308B><U+304B><U+3092><U+3001> | ^~~~~~~~ main.c:42:32: error: stray '\343' in program 42 | <U+3067><U+5272><U+308C><U+308B><U+56DE><U+6570><U+3068><U+547C><U+3076><U+3053><U+3068><U+306B><U+3057><U+307E><U+3059><U+3002> | ^~~~~~~~ main.c:47:8: error: stray '\343' in program 47 | <U+306A><U+3089><U+3070><U+3001> | ^~~~~~~~ main.c:51:3: error: stray '\343' in program 51 | <U+3067><U+3001> | ^~~~~~~~ main.c:55:12: error: stray '\343' in program 55 | <U+3067><U+5272><U+308C><U+307E><U+3059><U+3002> | ^~~~~~~~ main.c:57:8: error: stray '\343' in program 57 | <U+306A><U+3089><U+3070><U+3001> | ^~~~~~~~ main.c:65:3: error: stray '\343' in program 65 | <U+3067><U+3001> | ^~~~~~~~ main.c:69:12: error: stray '\343' in program 69 | <U+3067><U+5272><U+308C><U+307E><U+3059><U+3002> | ^~~~~~~~ main.c:71:8: error: stray '\343' in program 71 | <U+306A><U+3089><U+3070><U+3001> | ^~~~~~~~ main.c:75:12: error: stray '\343' in program 75 | <U+3067><U+5272><U+308C><U+307E><U+3059><U+3002> | ^~~~~~~~ main.c:78:1: error: stray '\342' in program 78 | <U+2266> | ^~~~~~~~ main.c:80:1: error: stray '\342' in program 80 | <U+2266> | ^~~~~~~~ main.c:83:41: error: stray '\343' in program 83 | <U+5165><U+529B><U+306F><U+4EE5><U+4E0B><U+306E><U+5F62><U+5F0F><U+3067><U+6A19><U+6E96><U+5165><U+529B><U+304B><U+3089><U+4E0E><U+3048><U+3089><U+308C><U+308B><U+3002> | ^~~~~~~~ main.c:88:21: error: stray '\343' in program 88 | <U+554F><U+984C><U+306E><U+7B54><U+3048><U+3092><U+51FA><U+529B><U+3059><U+308B><U+3002> | ^~~~~~~~ main.c:101:18: error: stray '\343' in program 101 | <U+3067><U+5272><U+308B><U+3053><U+3068><U+304C><U+3067><U+304D><U+3001><U+3053><U+308C><U+306F> | ^~~~~~~~ main.c:107:20: error: stray '\343' in program 107 | <U+306E><U+4E2D><U+3067><U+6700><U+3082><U+591A><U+3044><U+3067><U+3059><U+3002> | ^~~~~~~~ main.c:132:1: error: stray '\342' in program 132 | <U+203B> 512 KiB <U+307E><U+3067> | ^~~~~~~~ main.c:133:1: error: stray '\342' in program 133 | <U+203B> <U+30BD><U+30FC><U+30B9><U+30B3><U+30FC><U+30C9><U+306F><U+300C>Main.<U+62E1><U+5F35><U+5B50><U+300D><U+3067><U+4FDD><U+5B58><U+3055><U+308C><U+307E><U+3059> | ^~~~~~~~ main.c:133:17: error: stray '\343' in program 133 | <U+203B> <U+30BD><U+30FC><U+30B9><U+30B3><U+30FC><U+30C9><U+306F><U+300C>Main.<U+62E1><U+5F35><U+5B50><U+300D><U+3067><U+4FDD><U+5B58><U+3055><U+308C><U+307E><U+3059> | ^~~~~~~~ main.c:133:30: error: stray '\343' in program 133 | <U+203B> <U+30BD><U+30FC><U+30B9><U+30B3><U+30FC><U+30C9><U+306F><U+300C>Main.<U+62E1><U+5F35><U+5B50><U+300D><U+3067><U+4FDD><U+5B58><U+3055><U+308C><U+307E><U+3059> | ^~~~~~~~ main.c:140:16: error: stray '\302' in program 140 | Copyright 2018 <U+00A9>AtCoder Inc. All rights reserved. | ^~~~~~~~
s691318034
p03644
Java
import java.util.Scanner; public class ABC068B { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int N=sc.nextInt(); for(int i =1;i<=N;i++){ if(Math.pow(2, i)<=N&&N<Math.pow(2, i+1)){ System.out.println((int)Math.pow(2, i)); break; } } } }
Main.java:3: error: class ABC068B is public, should be declared in a file named ABC068B.java public class ABC068B { ^ 1 error
s118935956
p03644
Java
import java.util.Scanner; public class ABC068B { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int N=sc.nextInt(); for(int i =N;i>=1;i--){ if(i%2==0){ System.out.println(i); break; } } } }
Main.java:3: error: class ABC068B is public, should be declared in a file named ABC068B.java public class ABC068B { ^ 1 error
s076503839
p03644
C
import java.util.Scanner; public class ABC068B { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int N=sc.nextInt(); for(int i =N;i>=1;i--){ if(i%2==0){ System.out.println(i); break; } } } }
main.c:1:1: error: unknown type name 'import' 1 | import java.util.Scanner; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.util.Scanner; | ^ main.c:3:1: error: unknown type name 'public' 3 | public class ABC068B { | ^~~~~~ main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ABC068B' 3 | public class ABC068B { | ^~~~~~~
s913128441
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >>N; int ans =1 for(int i=0;ans<=N;i++){ ans *= 2; } cout << ans/2 << endl; }
a.cc: In function 'int main()': a.cc:8:3: error: expected ',' or ';' before 'for' 8 | for(int i=0;ans<=N;i++){ | ^~~ a.cc:8:22: error: 'i' was not declared in this scope 8 | for(int i=0;ans<=N;i++){ | ^
s037071886
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >>N; int ans =1 for(i=0;ans<=N;i++){ ans *= 2; } cout << ans/2 << endl; }
a.cc: In function 'int main()': a.cc:8:3: error: expected ',' or ';' before 'for' 8 | for(i=0;ans<=N;i++){ | ^~~ a.cc:8:18: error: 'i' was not declared in this scope 8 | for(i=0;ans<=N;i++){ | ^
s329105149
p03644
C++
#include <iostream> using namespace std; int main() { cin>>n; if (n>=64) cout<<64; if (n<64&&n>=32) cout<<32; if (n<32&&n>=16) cout<<16; if (n<16&&n>=8) cout<<8; if (n<8&&n>=4) cout<<4; if (n<4&&n>=2) cout<<2; if (n<2) cout<<1; return 0; }
a.cc: In function 'int main()': a.cc:5:10: error: 'n' was not declared in this scope 5 | cin>>n; | ^
s076456681
p03644
C++
/^1$/c1 /^2$/c2 /^3$/c2 /^4$/c4 /^5$/c4 /^6$/c4 /^7$/c4 /^8$/c8 /^9$/c8 /^10$/c8 /^11$/c8 /^12$/c8 /^13$/c8 /^14$/c8 /^15$/c8 /^16$/c16 /^17$/c16 /^18$/c16 /^19$/c16 /^20$/c16 /^21$/c16 /^22$/c16 /^23$/c16 /^24$/c16 /^25$/c16 /^26$/c16 /^27$/c16 /^28$/c16 /^29$/c16 /^30$/c16 /^31$/c16 /^32$/c32 /^33$/c32 /^34$/c32 /^35$/c32 /^36$/c32 /^37$/c32 /^38$/c32 /^39$/c32 /^40$/c32 /^41$/c32 /^42$/c32 /^43$/c32 /^44$/c32 /^45$/c32 /^46$/c32 /^47$/c32 /^48$/c32 /^49$/c32 /^50$/c32 /^51$/c32 /^52$/c32 /^53$/c32 /^54$/c32 /^55$/c32 /^56$/c32 /^57$/c32 /^58$/c32 /^59$/c32 /^60$/c32 /^61$/c32 /^62$/c32 /^63$/c32 c64
a.cc:1:1: error: expected unqualified-id before '/' token 1 | /^1$/c1 | ^
s965341705
p03644
C++
#include <iostream> #include <limits.h> using namespace std; int main() { int n; cin >> n; if (n == 1) cout << "1"; else if (2 <= n && n < 4) cout << "2"; else if (4 <= n && n < 8) cout << "4"; else if (8 <= n && n < 16) cout << "8"; else if (16 <= n && n < 32) cout << "16"; else if (32 <= n && n < 64) cout << "32"; else cout << "64"; return 0; } }
a.cc:17:1: error: expected declaration before '}' token 17 | } | ^
s826950504
p03644
C++
#include <bits/stdc++.h> int main() { int N,M=4; if(N<4 && N>=2){ cout << "2" << endl; } if(N>2){ cout << N << endl; } if(N>=4){ while(1){ if(N<=M){ cout << M << endl; break; } M+4; } } }
a.cc: In function 'int main()': a.cc:6:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 6 | cout << "2" << endl; | ^~~~ | std::cout In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:6:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 6 | cout << "2" << 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:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 9 | cout << N << 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:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 9 | cout << N << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:14:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 14 | cout << M << 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:14:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 14 | cout << M << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s184383096
p03644
C++
#include<bits/stdc++.h> using namespace std; long long n; int main(void) { cin>>n; cout<<n/2*2 return 0; }
a.cc: In function 'int main()': a.cc:7:16: error: expected ';' before 'return' 7 | cout<<n/2*2 | ^ | ; 8 | return 0; | ~~~~~~
s719001922
p03644
C++
#include<cstdio> #include<iostream> using namespace std; int n,ans; void ksm(int a) { int k=1,b=2; while(a) { if (a & 1) k*=b; b*=b; a>>=1; } return k; } int main() { cin>>n; while(n) { n>>=1; ans++; } cout<<ans; ksm(ans-1); return 0; }
a.cc: In function 'void ksm(int)': a.cc:14:16: error: return-statement with a value, in function returning 'void' [-fpermissive] 14 | return k; | ^
s845342102
p03644
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.*; public class Main { int[] inputArray; public static void main(String[] args) throws IOException { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); int input = sc.nextInt(); int n = 1; while(true){ if (n >= input) { n/=2; break;} n*=2; } System.out.println(n); } }
Main.java:24: error: illegal character: '\uff0a' n?=2; ^ Main.java:24: error: not a statement n?=2; ^ 2 errors
s467235851
p03644
C++
#include <iostream> #include <sstream> using namespace std; int main(){ int n; int i; cin >> n; int wari = 0; int kouho = 1; for(i = 1; i<= n; i++){ int count = 0; int j =i while (j % 2 == 0){ count++; if(j % 2 == 0){ j = j / 2; }else{ break; } } if (count > wari){ wari = count; kouho = i; } } cout << kouho << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:5: error: expected ',' or ';' before 'while' 13 | while (j % 2 == 0){ | ^~~~~
s194702868
p03644
C++
#include <iostream> #include <sstream> using namespace std; int main(){ int n; int i; cin >> n; int wari = 0; int kouho = 1; for(i = 1; i<= n; i ++){ int count = 0; while (i % 2 == 0){ count++; if(i % 2 == 0){ i = i / 2; } if (count > wari){ wari = count; kouho = i } } } cout << kouho << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:16: error: expected ';' before '}' token 19 | kouho = i | ^ | ; 20 | } | ~
s627186921
p03644
C++
#include <iostream> #include <sstream> using namespace std; int main(){ int n; int i; cin >> n; int wari = 0; int kouho = 1; for(i = 1; i<= n; i ++){ count = 0; while (i % 2 == 0){ count++; if(i % 2 == 0){ i = i / 2; } if (count > wari){ wari = count; kouho = i } } } cout << kouho << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: 'count' was not declared in this scope 11 | count = 0; | ^~~~~ a.cc:19:16: error: expected ';' before '}' token 19 | kouho = i | ^ | ; 20 | } | ~
s289196997
p03644
C
#include<bits/stdc++.h> using namespace std; int ans; int main(){ int N; cin>>N; for(int i=1;i<=N;i*=2){ ans=max(ans,i); } cout<<ans<<endl; return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s347891972
p03644
C++
#include "bits/stdc++.h" using namespace std; #define MOD 1000000007 #define FOR(i,a,b) for(long long i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define dump(x) cout << #x << " = " << (x) << endl; #define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; typedef long long ll; typedef pair<ll,ll> P; typedef vector<vector<P>> Graph; int main(){ int n; int i = 1 while(1){ i *= 2 if(i > n) break; } cout << i/2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:3: error: expected ',' or ';' before 'while' 19 | while(1){ | ^~~~~
s403251030
p03644
C++
#include<iostream> using namespace std; int N, res = 1,; main() { cin >> N; while (N > res) res = res * 2; cout << res << endl; return 0; }
a.cc:4:16: error: expected unqualified-id before ';' token 4 | int N, res = 1,; | ^ a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() { | ^~~~
s548489872
p03644
C++
#include<iostream> using namespace std; int N, ans; int A[123],res[123]; main() { cin >> N; for (int i = 0; i < N; ++i) A[i] = i; for (int i = 0; i < N; ++i) res[i] = 0; for (int i = 0; i < N; ++i) { while (A[i] % 2 == 0) { A[i] = A[i] % 2 res[i] = res[i] + 1 if (res[i] > ans) ans = res[i] } } cout << ans << endl; return 0; }
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main() { | ^~~~ a.cc: In function 'int main()': a.cc:13:28: error: expected ';' before 'res' 13 | A[i] = A[i] % 2 | ^ | ; 14 | res[i] = res[i] + 1 | ~~~
s599095126
p03644
C++
#include<iostream> using namespace std; int N, ans; int A[123],res[123]; main() { cin >> N; for (int i = 0; i < N; ++i) A[i] = i; for (int i = 0; i < N; ++i) res[i] = 0; for (int i = 0; i < N; ++i) { while (A[i] % 2 = 0) { A[i] = A[i] % 2 ++res[i] if (res[i] > ans) ans = res[i] } } cout << ans << endl; return 0; }
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main() { | ^~~~ a.cc: In function 'int main()': a.cc:12:21: error: lvalue required as left operand of assignment 12 | while (A[i] % 2 = 0) { | ~~~~~^~~ a.cc:13:27: error: lvalue required as increment operand 13 | A[i] = A[i] % 2 | ^
s567067263
p03644
C++
#include<iostream> using namespace std; int N, ans; int A[123],res[123]; main() { cin >> N; for (int i = 0; i < N; ++i) A[i] = i; for (int i = 0; i < N; ++i) { while (A[i] % 2 = 0) { A[i] % 2 = 0 ++res[i] if (res[i] > ans) ans = res[i] } } cout >> ans >> endl; return 0; }
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main() { | ^~~~ a.cc: In function 'int main()': a.cc:11:21: error: lvalue required as left operand of assignment 11 | while (A[i] % 2 = 0) { | ~~~~~^~~ a.cc:12:24: error: lvalue required as increment operand 12 | A[i] % 2 = 0 | ^ a.cc:17:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 17 | cout >> ans >> endl; | ~~~~ ^~ ~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:17:8: note: candidate: 'operator>>(int, int)' (built-in) 17 | cout >> ans >> endl; | ~~~~~^~~~~~ a.cc:17:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:17:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 17 | cout >> ans >> endl; | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:17:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 17 | cout >> ans >> endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:17:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 17 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:17:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:17:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:17:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 17 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:17:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:17:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:17:11: required from here 17 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s057439225
p03644
C++
#include<iostream> using namespace std; int N, ans; int A[123],res[123]; main() { cin >> N; for (int i = 0; i < N; ++i) A[i] = i; for (int i = 0; i < N; ++i) { while (A[i] % 2 = 0) { A[i] % 2 = 0 ++res[i] if (res[i] > ans) ans = res[i] } cout >> ans >> endl; return 0; }
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main() { | ^~~~ a.cc: In function 'int main()': a.cc:11:21: error: lvalue required as left operand of assignment 11 | while (A[i] % 2 = 0) { | ~~~~~^~~ a.cc:12:24: error: lvalue required as increment operand 12 | A[i] % 2 = 0 | ^ a.cc:16:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 16 | cout >> ans >> endl; | ~~~~ ^~ ~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:16:8: note: candidate: 'operator>>(int, int)' (built-in) 16 | cout >> ans >> endl; | ~~~~~^~~~~~ a.cc:16:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:16:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 16 | cout >> ans >> endl; | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:16:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 16 | cout >> ans >> endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:16:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 16 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:16:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 16 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:16:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 16 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:16:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 16 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:16:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 16 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:16:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 16 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:16:11: required from here 16 | cout >> ans >> endl; | ^~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:7:8: note: to match this '{' 7 | main() { | ^
s187581974
p03644
C++
include <iostream> using namespace std; int N, ans; int A[123],res[123]; main() { cin >> N; for (int i = 0; i < N; ++i) A[i] = i; for (int i = 0; i < N; ++i) { while (A[i] % 2 = 0) { A[i] % 2 = 0 ++res[i] if (res[i] > ans) ans = res[i] } cout >> ans >> endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main() { | ^~~~ a.cc: In function 'int main()': a.cc:8:3: error: 'cin' was not declared in this scope 8 | cin >> N; | ^~~ a.cc:11:21: error: lvalue required as left operand of assignment 11 | while (A[i] % 2 = 0) { | ~~~~~^~~ a.cc:12:24: error: lvalue required as increment operand 12 | A[i] % 2 = 0 | ^ a.cc:16:3: error: 'cout' was not declared in this scope 16 | cout >> ans >> endl; | ^~~~ a.cc:16:18: error: 'endl' was not declared in this scope 16 | cout >> ans >> endl; | ^~~~ a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:7:8: note: to match this '{' 7 | main() { | ^
s611691534
p03644
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include <cstdlib> using namespace std; int main(){ int n,a=1; cin >> n; for(int i = 6; 0 <= i; i--){ for(int j = i; 0 < j; j--){ a = a*2; }¥ if( a <= n ){ cout << a << endl; return 0; } a = 1; } return 0; }
a.cc:16:18: error: extended character ¥ is not valid in an identifier 16 | }¥ | ^ a.cc: In function 'int main()': a.cc:16:18: error: '\U000000a5' was not declared in this scope 16 | }¥ | ^
s756011662
p03644
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int i,j,input,counter, int max = 0; int maxcounter = 0; cin >> input; for(i = 1;i <= input; i++) { j = i while(j <= 1) { if(j % 2 == 0) { j /= 2; counter++; }else { break; } } if(counter >= maxcounter) { max = input; maxcounter = counter; } } cout << max << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: expected unqualified-id before 'int' 9 | int max = 0; | ^~~ a.cc:15:14: error: expected ';' before 'while' 15 | j = i | ^ | ; 16 | while(j <= 1) { | ~~~~~ a.cc:27:19: error: overloaded function with no contextual type information 27 | max = input; | ^~~~~ a.cc:32:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 32 | 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, _
s052161020
p03644
C++
#include <iostream> using namespace std; int main(){ int n,ans=0; cin>>n; if(n>=64) cout<<"64"<<endl; else if(n<64&&n>=8){ for(int i=1;i<=n%8){ ans*=8*i; } cout<<ans<<endl; } else if(1<n<4) cout<<"2"<<endl; else if(n==1) cout<<"1"<<endl; else cout<<"4"<<endl; }
a.cc: In function 'int main()': a.cc:8:23: error: expected ';' before ')' token 8 | for(int i=1;i<=n%8){ | ^ | ;
s059336654
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, i; cin >> N; for (i=0; i<7; ++i){ if ( N <= pow(2,(i+1))-1){ cout << pow(2,i) <<endl break; } }
a.cc: In function 'int main()': a.cc:9:30: error: expected ';' before 'break' 9 | cout << pow(2,i) <<endl | ^ | ; 10 | break; | ~~~~~ a.cc:12:2: error: expected '}' at end of input 12 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s062164357
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int counter = 0; for (i=0; i <10; ++i){ if (N%2 == 0) break; ++counter; N = N/2; } cout << counter <<endl; }
a.cc: In function 'int main()': a.cc:8:8: error: 'i' was not declared in this scope 8 | for (i=0; i <10; ++i){ | ^
s314837847
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N int counter = 0; for (i=0; i <10; ++i){ if (N%2 == 0) break; ++counter; N = N/2; } cout << counter <<endl; }
a.cc: In function 'int main()': a.cc:6:11: error: expected ';' before 'int' 6 | cin >> N | ^ | ; 7 | int counter = 0; | ~~~ a.cc:8:8: error: 'i' was not declared in this scope 8 | for (i=0; i <10; ++i){ | ^ a.cc:10:7: error: 'counter' was not declared in this scope 10 | ++counter; | ^~~~~~~ a.cc:13:11: error: 'counter' was not declared in this scope 13 | cout << counter <<endl; | ^~~~~~~
s635001195
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; int counter = 0; for (i=0; i <10; ++i){ if (N%2 == 0) break; ++counter; N = N/2; } cout << counter <<endl; }
a.cc: In function 'int main()': a.cc:7:8: error: 'i' was not declared in this scope 7 | for (i=0; i <10; ++i){ | ^
s793867795
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { string N; int counter = 0; for (i=0; i <10; ++i){ if (N%2 == 0) break; ++counter; N = N/2; } cout << counter <<endl; }
a.cc: In function 'int main()': a.cc:7:8: error: 'i' was not declared in this scope 7 | for (i=0; i <10; ++i){ | ^ a.cc:8:10: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 8 | if (N%2 == 0) break; | ~^~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:8:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 8 | if (N%2 == 0) break; | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:8:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 8 | if (N%2 == 0) break; | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:8:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 8 | if (N%2 == 0) break; | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:8:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 8 | if (N%2 == 0) break; | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:8:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 8 | if (N%2 == 0) break; | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const valarray<_Tp>&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:8:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 8 | if (N%2 == 0) break; | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:8:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 8 | if (N%2 == 0) break; | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:8:11: note: mismatched types 'const std::valarray<_Tp>' and 'int' 8 | if (N%2 == 0) break; | ^ a.cc:10:10: error: no match for 'operator/' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 10 | N = N/2; | ~^~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:430:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator/(const complex<_Tp>&, const complex<_Tp>&)' 430 | operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:430:5: note: template argument deduction/substitution failed: a.cc:10:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 10 | N = N/2; | ^ /usr/include/c++/14/complex:439:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator/(const complex<_Tp>&, const _Tp&)' 439 | operator/(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:439:5: note: template argument deduction/substitution failed: a.cc:10:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 10 | N = N/2; | ^ /usr/include/c++/14/complex:448:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator/(const _Tp&, const complex<_Tp>&)' 448 | operator/(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:448:5: note: template argument deduction/substitution failed: a.cc:10:11: note: mismatched types 'const std::complex<_Tp>' and 'int' 10 | N = N/2; | ^ /usr/include/c++/14/bits/valarray_after.h:408:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__divides, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__divides, typename _Dom1::value_type>::result_type> std::operator/(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 408 | _DEFINE_EXPR_BINARY_OPERATOR(/, struct std::__divides) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:408:5: note: template argument deduction/substitution failed: a.cc:10:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 10 | N = N/2; | ^ /usr/include/c++/14/bits/valarray_after.h:408:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__divides, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__divides, typename _Dom1::value_type>::result_type> std::operator/(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 408 | _DEFINE_EXPR_BINARY_OPERATOR(/, struct std::__divides) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:408:5: note: template argument deduction/substitution failed: a.cc:10:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 10 | N = N/2; | ^ /usr/include/c++/14/bits/valarray_after.h:408:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__divides, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__divides, typename _Dom1::value_type>::result_type> std::operator/(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 408 | _DEFINE_EXPR_BINARY_OPERATOR(/, struct std::__divides) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /u
s041619879
p03644
C++
#include<iostream> #include<algorithm> #include<cmath> #include<string> #include<array> #include<vector> #include<functional> #include<unordered_map> #include<map> #include<numeric> #include<limits> #include<utility> #include<queue> #include<random> using namespace std; int main(){ int N,A,B; cin >> N; int A = 2; while(N < A){ A = A * A; B = N; } cout << B << endl; return 0; }
a.cc: In function 'int main()': a.cc:24:7: error: redeclaration of 'int A' 24 | int A = 2; | ^ a.cc:20:9: note: 'int A' previously declared here 20 | int N,A,B; | ^
s628310926
p03644
C++
#include<iostream> #include<algorithm> #include<cmath> #include<string> #include<array> #include<vector> #include<functional> #include<unordered_map> #include<map> #include<numeric> #include<limits> #include<utility> #include<queue> #include<random> using namespace std; int main(){ int N; int A,B,C,D,E; int i; D = 1; E = 1; cin >> N; for(i = 1;i <=N;i++){ C = N; while (A == 0 && C =! 0){ A = C % 2; C = C / 2; B = B + 1; } if(B > D) E = i; } cout << E << endl; return 0; }
a.cc: In function 'int main()': a.cc:31:17: error: lvalue required as left operand of assignment 31 | while (A == 0 && C =! 0){ | ~~~~~~~^~~~
s489293150
p03644
C++
#include <iostream> using namespace std; int main(){ int N, ans=0; cin >> N; for(int i=1; i<=N; i++){ if(i/2>ans/2) ans=i; } cout << i; }
a.cc: In function 'int main()': a.cc:10:17: error: 'i' was not declared in this scope 10 | cout << i; | ^