submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s734290922
p03644
C
#include<bits/stdc++.h> using namespace std; int n; int a=2; int main(){ cin>>n; while(a<=n){ a*=2; } cout<<a/2<<endl; return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s760406400
p03644
C++
#include <iostream> #include <string> #include <string.h> #include <map> #include <set> #include <vector> #include <stdio.h> #include <math.h> #include <algorithm> #include <queue> #include <cmath> #include <cstdio> using namespace std; int main(){ int a; cin>>a; int b=1; int c=1; for(int i=0;i<n;i++) {b*=2; if(a>=b) c=b;} cout<<c; system("pause"); return 0; }
a.cc: In function 'int main()': a.cc:19:15: error: 'n' was not declared in this scope 19 | for(int i=0;i<n;i++) | ^
s561396437
p03644
C++
#include<stdio.h> #include<math.h> #include<algorithm> #include<queue> #include<deque> #include<string> #include<string.h> #include<vector> #include<set> #include<map> #include<bitset> #include<stdlib.h> #include<cassert> #include<time.h> #include<bitset> using namespace std; const long long mod=1000000007; const long long inf=mod*mod; const long long d2=(mod+1)/2; const double EPS=1e-6; const double PI=acos(-1.0); int ABS(int a){return max(a,-a);} long long ABS(long long a){return max(a,-a);} char in[100000]; int main(){ int a;scanf("%d",&a); int ret=1; int val=0; for(int i=1;i<=a;i++){ int tmp=i; int v=0; wihle(tmp%2==0){ tmp/=2;v++; } if(val<v){ val=v;ret=i; } }printf("%d\n",ret); }
a.cc: In function 'int main()': a.cc:32:17: error: 'wihle' was not declared in this scope 32 | wihle(tmp%2==0){ | ^~~~~
s707105076
p03644
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; int x=2; cin>>n; for(n>=x)x*=2; cout<<x/2; return 0; }
a.cc: In function 'int main()': a.cc:7:11: error: expected ';' before ')' token 7 | for(n>=x)x*=2; | ^ | ; a.cc:9:3: error: expected primary-expression before 'return' 9 | return 0; | ^~~~~~ a.cc:8:13: error: expected ')' before 'return' 8 | cout<<x/2; | ^ | ) 9 | return 0; | ~~~~~~ a.cc:7:6: note: to match this '(' 7 | for(n>=x)x*=2; | ^
s347894195
p03644
C++
#include<bits/stdc++.h> using namespace std; int n; int x=2; int main(){ cin>>n; for(n>=x)x*=2; cout<<x/2; return 0; }
a.cc: In function 'int main()': a.cc:7:11: error: expected ';' before ')' token 7 | for(n>=x)x*=2; | ^ | ; a.cc:9:3: error: expected primary-expression before 'return' 9 | return 0; | ^~~~~~ a.cc:8:13: error: expected ')' before 'return' 8 | cout<<x/2; | ^ | ) 9 | return 0; | ~~~~~~ a.cc:7:6: note: to match this '(' 7 | for(n>=x)x*=2; | ^
s464992180
p03644
C++
#include <iostream> #include <sstream> #include <cstdio> #include <cstdlib> #include <cmath> #include <ctime> #include <cstring> #include <string> #include <vector> #include <stack> #include <queue> #include <deque> #include <map> #include <set> #include <bitset> #include <numeric> #include <utility> #include <iomanip> #include <algorithm> #include <functional> using namespace std; #define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl #define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i) template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) { return s << '<' << P.first << ", " << P.second << '>'; } template<class T> ostream& operator << (ostream &s, vector<T> P) { for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; } template<class T> ostream& operator << (ostream &s, vector<vector<T> > P) { for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; } template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) { EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; } int N; int main() { cin >> N; res = 1; while (res <= N) res *= 2; cout << res/2 << endl; }
a.cc: In function 'int main()': a.cc:40:3: error: 'res' was not declared in this scope 40 | res = 1; | ^~~
s794109733
p03644
C
#include<stdio.h> #include<math.h> int main() { int a,i,d[101]; d[0]=1; while (scanf("%d".&a)!=EOF) { int b=0; for(i=0;i<=a;i++) { d[i]=pow(2,i); if(d[i]>a) { b=d[i-1]; break; } } printf("%d\n",b); } return 0; }
main.c: In function 'main': main.c:7:23: error: expected identifier before '&' token 7 | while (scanf("%d".&a)!=EOF) | ^
s530997263
p03644
C
#include<stdio.h> #include<math.h> int main() { int a,i,d[101]; j[0]=1; while (scanf("%d".&a)!=EOF) { int b=0; for(i=0;i<=a;i++) { j[i]=pow(2,i); if(j[i]>a) { b=j[i-1]; break; } } printf("%d\n",b); } return 0; }
main.c: In function 'main': main.c:6:5: error: 'j' undeclared (first use in this function) 6 | j[0]=1; | ^ main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in main.c:7:23: error: expected identifier before '&' token 7 | while (scanf("%d".&a)!=EOF) | ^
s864567971
p03644
C
#include<stdio.h> int main() { int N; while(scanf("%d",&N)!=EOF) { if(N>=100)&&(N<=999) { printf("%dth round of ABC is ABC%d.\n",N,N); } } return 0; }
main.c: In function 'main': main.c:7:21: error: expected identifier before '(' token 7 | if(N>=100)&&(N<=999) | ^
s848403913
p03644
C
include<stdio.h> int main(){ int n,r=1; scanf("%d",&n); while(1){if(n<r*2){printf("%d\n",r);return 0;}r*=2;} return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s850674290
p03644
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner inp = new Scanner(System.in); String u = input.nextLine(); int aPos = -1; int zPos = u.length(); for(int i = u.length() - 1; i > 0; i--){ String chr = u.substring(i - 1,i); if(chr.equals("A")) aPos = i; } for(int j = aPos; j < u.length() - 1; j++){ String chr2 = u.substring(j,j+ 1); if(chr2.equals("Z")) zPos = j; } System.out.println(zPos - aPos + 1); } }
Main.java:6: error: cannot find symbol String u = input.nextLine(); ^ symbol: variable input location: class Main 1 error
s107890136
p03644
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner inp = new Scanner(System.in); String u = input.nextLine(); int aPos = -1; int zPos = u.length(); for(int i = u.length() - 1; i > 0; i--){ String chr = u.substring(i - 1,i); if(chr.equals("A")) aPos = i; } for(int j = aPos; j < u.length() - 1; j++){ String chr2 = u.substring(j,j+ 1); if(chr2.equals("Z")) zPos = j; } System.out.println(zPos - aPos + 1); } }
Main.java:6: error: cannot find symbol String u = input.nextLine(); ^ symbol: variable input location: class Main 1 error
s123625328
p03644
C++
int main(){ int num; int mostNum = 1; int mostTimes = 0; int counter; cin >> num; for(int i = num; i >= 1; i--){ counter = 0; int number = i; while(number>1 && number % 2 == 0){ number = number / 2; counter++; } if(counter > mostTimes){ mostTimes = counter; mostNum = i; } } cout << mostNum << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope 6 | cin >> num; | ^~~ a.cc:19:9: error: 'cout' was not declared in this scope 19 | cout << mostNum << endl; | ^~~~ a.cc:19:28: error: 'endl' was not declared in this scope 19 | cout << mostNum << endl; | ^~~~
s337893175
p03644
Java
import java.util.Scanner; class Break_Number { static void main() { Scanner sc=new Scanner(System.in); n=sc.nextInt(); int i=0; while((int)(Math.pow(2,i))<=n) { i++; } i--; System.out.println((int)(Math.pow(2,i))); } }
Main.java:7: error: cannot find symbol n=sc.nextInt(); ^ symbol: variable n location: class Break_Number Main.java:9: error: cannot find symbol while((int)(Math.pow(2,i))<=n) ^ symbol: variable n location: class Break_Number 2 errors
s728040079
p03644
Java
import java.util.Scanner; public class Break_Number { static void main() { Scanner sc=new Scanner(System.in); int n=0; outer:while(true) { n=sc.nextInt(); if(n>100) continue; else break outer; } int i=0; while((int)(Math.pow(2,i))<=n) { i++; } i--; System.out.println((int)(Math.pow(2,i))); } }
Main.java:2: error: class Break_Number is public, should be declared in a file named Break_Number.java public class Break_Number ^ 1 error
s753989253
p03644
C++
#include <iostream> #include <cstdio> using namespace std; int main() { int n,ans=64,c[101]={0}; cin>>n; while(true) { if(n<ans) { ans /=2; } else { cout<<ans<<endl } } return 0; }
a.cc: In function 'int main()': a.cc:16:40: error: expected ';' before '}' token 16 | cout<<ans<<endl | ^ | ; 17 | } | ~
s380131165
p03644
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,m; cin >> n; while(1){ n=n/2 m+=1 if(n%2==0)break; } cout << m << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:8: error: expected ';' before 'm' 10 | n=n/2 | ^ | ; 11 | m+=1 | ~
s626366140
p03644
C++
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; for (i = 6; i >= 0; i--) { int c = 2**i; if (c <= N) { cout << c << endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:24:10: error: 'i' was not declared in this scope 24 | for (i = 6; i >= 0; i--) { | ^
s939181371
p03644
C++
// ConsoleApplication1.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 // #pragma warning(disable:4996) #include "stdafx.h" #include <stdio.h> static int dev2(int i) { int devcnt = 0; if (i == 0) { return 1; } while (i % 2 == 0) { devcnt++; if ((i = i / 2) == 0) { break; } } return devcnt; } int main(void) { int n, i, devcnt, topcnt = 0; int topnum = 0; scanf("%d", &n); for (i = 0; i < n; i++) { devcnt = dev2(i); if (devcnt > topcnt) { topcnt = devcnt; topnum = i; } } printf("%d", topnum); return 0; }
a.cc:6:10: fatal error: stdafx.h: No such file or directory 6 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s967165491
p03644
C++
#include <stdio.h> static int dev2(int i) { int devcnt = 0; if (i == 0) { return 1; } while (i % 2 == 0) { devcnt++; if ((i = i / 2) == 0) { break; } } return devcnt; } int main(void) { int n, i, devcnt, topcnt = 0; int topnum = 0; scanf_s("%d", &n); for (i = 0; i < n; i++) { devcnt = dev2(i); if (devcnt > topcnt) { topcnt = devcnt; topnum = i; } } printf("%d", topnum); return 0; }
a.cc: In function 'int main()': a.cc:26:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 26 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s116220602
p03644
C++
#include <stdio.h> int main(void) { int n, i, devcnt, topcnt = 0; int topnum = 0; /* 数値(N)入力 */ scanf("%d", &n); for (i = 0; i < n; i++) { devcnt = dev2(i); if (devcnt > topcnt) { topcnt = devcnt; topnum = i; } } printf("%d", topnum); return 0; }
a.cc: In function 'int main()': a.cc:12:26: error: 'dev2' was not declared in this scope 12 | devcnt = dev2(i); | ^~~~
s879519113
p03644
C
#include <stdio.h> int main(void) { int n, i, devcnt, topcnt = 0; int topnum = 0; /* 数値(N)入力 */ scanf("%d", &n); for (i = 0; i < n; i++) { devcnt = dev2(i); if (devcnt > topcnt) { topcnt = devcnt; topnum = i; } } printf("%d", topnum); return 0; }
main.c: In function 'main': main.c:12:26: error: implicit declaration of function 'dev2' [-Wimplicit-function-declaration] 12 | devcnt = dev2(i); | ^~~~
s851141438
p03644
C++
#include <bits/stdc++.h> int main() { int n; cin >> n; for (int i = 0; i < 9; ++i) { if (pow(2, i) > n) { if (i == 0) { cout << n << endl; } else { cout << pow(2, i - 1) << endl; } } } return 0; }
a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> n; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:10:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 10 | 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:10:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 10 | cout << n << 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:13:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 13 | cout << pow(2, i - 1) << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:13:42: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 13 | cout << pow(2, i - 1) << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s491400431
p03644
C++
#include<iostream> using namespace std; int ans[8] = {1,2,4,8,16,32,64,128}; int main(){ int n; cin >> n; for(int i=0;i<8;i++){ if(ans[i] > n){ cout << ans[i-1] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s560012374
p03644
C++
#include<iostream> using namespace std; int main(){ int i,N,count=0; int a[8]; cin >> N; a[0]=1; if(N==0){cout << 1}; for(i=1;i<=7;i++){ a[i]=a[i-1]*2; } for(i=0;i<=7;i++){ if(N>a[i]){ count=a[i]; } } cout << count; return 0; }
a.cc: In function 'int main()': a.cc:9:19: error: expected ';' before '}' token 9 | if(N==0){cout << 1}; | ^ | ;
s495199720
p03644
C++
#include<iostream> using namespace std; int main(){ int i,N,count=0; int a[8]; cin >> N; a[0]=1; if(N==0){cout << 1;); for(i=1;i<=7;i++){ a[i]=a[i-1]*2; } for(i=0;i<=7;i++){ if(N>a[i]){ count=a[i]; } } cout << count; return 0; }
a.cc: In function 'int main()': a.cc:9:20: error: expected primary-expression before ')' token 9 | if(N==0){cout << 1;); | ^ a.cc:22:8: error: expected '}' at end of input 22 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s842563820
p03644
C++
#include<iostream> using namespace std; int main(){ int i,N,count=0; int a[8]; cin >> N; a[0]=1; if(N==0){cout << 1); for(i=1;i<=7;i++){ a[i]=a[i-1]*2; } for(i=0;i<=7;i++){ if(N>a[i]){ count=a[i]; } } cout << count; return 0; }
a.cc: In function 'int main()': a.cc:9:19: error: expected ';' before ')' token 9 | if(N==0){cout << 1); | ^ | ; a.cc:22:8: error: expected '}' at end of input 22 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s566716194
p03644
Java
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskB solver = new TaskB(); solver.solve(1, in, out); out.close(); } static class TaskB { int f(int x) { int c = 0; while (x % 2 == 0) { x /= 2; ++c; } return c; } public void solve(int testNumber, InputReader in, PrintWriter out) { int n = in.nextInt(); int max = 0, res = 1; for (int i = 1; i <= n; ++i) { if (f(i) > max) { res = i; max = Math.max(max, f(i)); } } out.println(res); } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768);
Main.java:55: error: reached end of file while parsing reader = new BufferedReader(new InputStreamReader(stream), 32768); ^ 1 error
s400416895
p03644
C++
#include<iostream> using namespace std; int main(){ int n; cin>>n; for(int i=0;i<20;i++){ if(n<(1<<(i+1)){ cout<<(1<<i)<<endl; break; } } return 0; }
a.cc: In function 'int main()': a.cc:7:25: error: expected ')' before '{' token 7 | if(n<(1<<(i+1)){ | ~ ^ | ) a.cc:11:8: error: expected primary-expression before '}' token 11 | } | ^
s474154774
p03644
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) {; try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 1); String s = br.readLine(); int N = Integer.valueOf(s); if (N < 1 || N > 100) System.exit(0); int max = 0; int maxNum = 0; for (int i = 1; i <= N; i++) { int num = calc(i); if (maxNum < num) { max = i; maxNum = num; } } System.out.println(max); } catch (IOException e) { e.printStackTrace(); } } protected static int calc(int N) { int i = 0; while (N % 2 == 0) { N = N / 2; i++; } return i; }
Main.java:38: error: reached end of file while parsing } ^ 1 error
s041610430
p03644
C
#include <stdio.h> int main(){ int n; scanf("%d",&n); if(n<2) printf("1\n", ); if(n>=2 && n<3) printf("2\n"); if(n>=4 && n<8) printf("4\n"); if(n>=8 && n<16)printf("8\n"); if(n>=16 && n<32)printf("16\n"); if(n>=32 && n<64)printf("32\n"); if(n>=64)printf("64\n"); return 0; }
main.c: In function 'main': main.c:5:27: error: expected expression before ')' token 5 | if(n<2) printf("1\n", ); | ^
s458114657
p03644
C++
#include <iostream> #include <cstdio> using namespace std; int n; int main() { ios_base:sync_with_stdio(0); cin >> n; int dem=0; while (n%2==0) { dem++; n/=2; } cout << dem << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:9:14: error: 'sync_with_stdio' was not declared in this scope 9 | ios_base:sync_with_stdio(0); | ^~~~~~~~~~~~~~~
s174491401
p03644
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; int ans = 0; while (N > 1) { ans++; N /= 2; } cout << ans << endl;
a.cc: In function 'int main()': a.cc:13:25: error: expected '}' at end of input 13 | cout << ans << endl; | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s399883238
p03644
C++
#include <iostream> using namespace std; int main() { int N; cin << N; int ans = 0; while (N > 1) { ans++; N /= 2; } cout << ans << endl;
a.cc: In function 'int main()': a.cc:7:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 7 | cin << N; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:7:9: note: candidate: 'operator<<(int, int)' (built-in) 7 | cin << N; | ~~~~^~~~ a.cc:7:9: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, 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/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << N; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << N; | ^ 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:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:7:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 7 | cin << N; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << N; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << N; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << N; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << N; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << N; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << N; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << N; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin << N; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << N; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << N; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:7:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin << N; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:7:12: required from here 7 | cin << N; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ a.cc:13:25: error: expected '}' at end of input 13 | cout << ans << endl; | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s063306678
p03644
C
#include<stdio.h> int main(){ int n,i; scanf("%d",&a); for (i=64; i>=0; i/=2){ if(i <= n) { printf("%d¥n",n); return 0; } } printf("1¥n"); return 0; }
main.c: In function 'main': main.c:5:17: error: 'a' undeclared (first use in this function) 5 | scanf("%d",&a); | ^ main.c:5:17: note: each undeclared identifier is reported only once for each function it appears in
s611555378
p03644
C
#include <stdio.h> int main(void) { int n; scanf("%d",&n); int arr[n+1]; int i; for(i=0;i<=n;i++) { arr[i]=0; } int d; for(i=0;i<=n;i=i+2) { d=i; while(d%2==0) { arr[i]++; d=d/2; } } int max=0,maxindex; for(i=0;i<=n;i++) { if(max<arr[i]) { max=arr[i] maxindex=i; } } printf("%d\n", maxindex); return 0; }
main.c: In function 'main': main.c:29:16: error: expected ';' before 'maxindex' 29 | max=arr[i] | ^ | ; 30 | maxindex=i; | ~~~~~~~~
s312990176
p03644
C++
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int maxCnt = 0; int cntNum = 1; for (int i = 1; i <= n; i++) { int cnt = 0; int num = i; while (num % 2 == 0) { cnt++; num /= 2; } if (cnt >= maxCnt) { maxCnt = cnt; cntNum = i; } } System.out.println(cntNum); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: expected unqualified-id before 'public' 4 | public class Main { | ^~~~~~
s356043665
p03644
C++
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAX = 10005; const int MOD = 1e9+7; const int INF = 0x3f3f3f3f; int main() { int n; cin >> n; int ans; int ma = 0; for(int i = 1; i <= n; ++i) { int t = i; int now = 0; while(t%2 == 0) { now++; t /= 2; } if(now > ma) ma = now, ans = i; } cout << i << endl; return 0; }
a.cc: In function 'int main()': a.cc:25:13: error: 'i' was not declared in this scope 25 | cout << i << endl; | ^
s141322944
p03644
C++
#include<iostream> using namespace std; int main() { int n; cin>>n; int i=1 for(;i<=n;){ i<<1; } i>>1; cout<<i; return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: expected ',' or ';' before 'for' 8 | for(;i<=n;){ | ^~~ a.cc:8:15: error: expected primary-expression before ')' token 8 | for(;i<=n;){ | ^
s983009548
p03644
C++
#include<iostream> using namespace std; int main() { int n; cin>>n; for(int i=1;i<=n;){ i = i<<1; } i>>1; cout<<i; return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'i' was not declared in this scope 10 | i>>1; | ^
s303923318
p03644
C++
#include <stdio.h> int main() { int i; scanf"%d", &i); int count = 0; while (1) { if (i % 2 == 0) { count++; i /= 2; } else { break; }} printf("%d", count); }
a.cc: In function 'int main()': a.cc:5:6: error: expected ';' before string constant 5 | scanf"%d", &i); | ^~~~ | ;
s328602964
p03644
C++
#include <stdio.h> int main() { int i; scanf"%d", &i); int count = 0; while (1) { if (i % 2 == 0) { count++; i /= 2; } else { break; } printf("%d", count); }
a.cc: In function 'int main()': a.cc:5:6: error: expected ';' before string constant 5 | scanf"%d", &i); | ^~~~ | ; a.cc:15:2: error: expected '}' at end of input 15 | } | ^ a.cc:3:1: note: to match this '{' 3 | { | ^
s500781179
p03644
Java
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException{ FastScanner f = new FastScanner(); //Replace "problem" with problem name int[] powers = {1,2,4,8,16,32,64}; int n = f.nextInt(); for(int i = 0; i < powers.length; i++){ if (n > powers[i]){ break; } } System.out.println(i-1); } public static class FastScanner { BufferedReader br; StringTokenizer st; public FastScanner(String s) { try { br = new BufferedReader(new FileReader(s)); } catch (FileNotFoundException e) { e.printStackTrace(); } } public FastScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String nextToken() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } String nextLine() { st = null; try { return br.readLine(); } catch (IOException e) { e.printStackTrace(); } return null; } int nextInt() { return Integer.parseInt(nextToken()); } long nextLong() { return Long.parseLong(nextToken()); } double nextDouble() { return Double.parseDouble(nextToken()); } } }
Main.java:16: error: cannot find symbol System.out.println(i-1); ^ symbol: variable i location: class Main 1 error
s934216525
p03644
C++
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<b;i++) #define rrep(i,a,b) for(int i=a;i>=b;i--) #define fore(i,a) for(auto &i:a) #pragma GCC optimize ("-O3") using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } //--------------------------------------------------------------------------------------------------- /*---------------------------------------------------------------------------------------------------             ∧_∧       ∧_∧  (´<_` )  Welcome to My Coding Space!      ( ´_ゝ`) /  ⌒i     /   \    | |     /   / ̄ ̄ ̄ ̄/  |   __(__ニつ/  _/ .| .|____      \/____/ (u ⊃ ---------------------------------------------------------------------------------------------------*/ int N; //--------------------------------------------------------------------------------------------------- void _main() { cin >> N; int macnt = 0, 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 << x << endl; }
a.cc: In function 'void _main()': a.cc:32:13: error: 'x' was not declared in this scope 32 | cout << x << endl; | ^
s540549057
p03644
C
#include <stdio.h> int main() { int a; int b=0; int c=0; scanf("%d",&a); if(a!=0){ if(a%2==0) { a/2=a; b++; } a--; if(b>=c) { c=b; } b=0; } printf("%d",c); }
main.c: In function 'main': main.c:11:28: error: lvalue required as left operand of assignment 11 | a/2=a; | ^
s918740902
p03644
C
#include <stdio.h> int main() { int a; int b=0; int c=0; scanf("%d",%a); if(a!=0){ if(a%2==0) { a/2=a; b++; } a--; if(b>=c) { c=b; } b=0; } printf("%d",c); }
main.c: In function 'main': main.c:7:20: error: expected expression before '%' token 7 | scanf("%d",%a); | ^ main.c:11:28: error: lvalue required as left operand of assignment 11 | a/2=a; | ^
s550374933
p03644
C
#include <stdio.h> int main() { int a,b=0; int c=0;d; scanf("%d",%a); if(a!=0){ if(a%2==0) { a/2=a; b++; } a--; if(b>=c) { c=b; } b=0; } printf("%d",c); }
main.c: In function 'main': main.c:5:17: error: 'd' undeclared (first use in this function) 5 | int c=0;d; | ^ main.c:5:17: note: each undeclared identifier is reported only once for each function it appears in main.c:6:20: error: expected expression before '%' token 6 | scanf("%d",%a); | ^ main.c:10:28: error: lvalue required as left operand of assignment 10 | a/2=a; | ^
s406257604
p03644
C++
#include<iostream> #include<algorithm> #include<vector> #include<cstdio> #include<list> #include<queue> #include<string.h> #include<functional> #include<stack> #include<deque> #include<string> #include<limits.h> #include<map> #include<set> #include<unordered_map> #include<unordered_set> #define int long long using namespace std; signed main(){ int a; cin >> a; int ans = 0; while (a > 1) { ans++; a /= 2; } cout << pow(2,ans) << endl; }
a.cc: In function 'int main()': a.cc:27:17: error: 'pow' was not declared in this scope 27 | cout << pow(2,ans) << endl; | ^~~
s801749327
p03644
C++
#include <stdio.h> #include <string.h> void main() { char num_char[100]; scanf("%[0123456789]", &num_char); if(num < 1 || num_char > 100) { printf("数値1-100の範囲で入力してください.\n"); return; } int num = atoi(num_char); int amari; int wari_num=0; int result=0; int bestRecord =0; for (int i=0 ; i <= num ; ++i) { wari_num = 0; while(1) { amari = num%2; if(amari == 1 || i == 1){ break; } wari_num++; } if(result < wari_num){ result= wari_num; bestRecord = i; } } printf("%d\n",bestRecord); return; }
a.cc:4:1: error: '::main' must return 'int' 4 | void main() { | ^~~~ a.cc: In function 'int main()': a.cc:8:12: error: 'num' was not declared in this scope; did you mean 'enum'? 8 | if(num < 1 || num_char > 100) { | ^~~ | enum a.cc:8:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if(num < 1 || num_char > 100) { | ~~~~~~~~~^~~~~ a.cc:10:17: error: return-statement with no value, in function returning 'int' [-fpermissive] 10 | return; | ^~~~~~ a.cc:12:19: error: 'atoi' was not declared in this scope 12 | int num = atoi(num_char); | ^~~~ a.cc:33:5: error: return-statement with no value, in function returning 'int' [-fpermissive] 33 | return; | ^~~~~~
s774577777
p03644
C
#include<stdio.h> int main(void) { int N; int i, j; int M; int count; int max = 0; scanf_s("%d", &N); if (N >= 64) { max = 64; } else if (N > 32) { max = 32; } else if (N > 16) { max = 16; } else if (N > 8) { max = 8; } else if (N > 4) { max = 4; } else if (N > 2) { max = 2; } else { max = 1; } printf("%d", max); }
main.c: In function 'main': main.c:8:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 8 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s568782420
p03644
C
#include <stdio.h> int waru(int x); int main(){ int input,i; scanf("%d",&input); if(input<=2){ printf("%d\n",input); } for(i=input;i>1;i--){ if(waru(i)==1){ printf("%d\n",i); break; } } return 0; } int waru(int x){ while(x!=0){ if(x%2!=0){ return -1; } x=/2; } return 1; }
main.c: In function 'waru': main.c:23:11: error: expected expression before '/' token 23 | x=/2; | ^
s973380126
p03644
C
#include <stdio.h> int waru(int x); int main(){ int input,i; scanf("%d",&input); if(i<2){ printf("%d\n",input); } for(i=input;i>1;i--){ if(waru(i)==1){ printf("%d\n",i); break; } } return 0; } int waru(int x){ while(x>1){ x=x%2; } if(x==0){ return 1; }else{
main.c: In function 'waru': main.c:25:5: error: expected declaration or statement at end of input 25 | }else{ | ^ main.c:25:5: error: expected declaration or statement at end of input
s874267727
p03644
C++
size_t N; std::cin >> N; size_t t{0}; for (size_t i{ 0 }; i < 7;i++) { if ( x[i]<=N) { t = i; } } std::cout << x[t] << "\n";
a.cc:2:9: error: 'size_t' does not name a type 2 | size_t N; | ^~~~~~ a.cc:1:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | a.cc:3:14: error: 'cin' in namespace 'std' does not name a type 3 | std::cin >> N; | ^~~ a.cc:1:8: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:5:9: error: 'size_t' does not name a type 5 | size_t t{0}; | ^~~~~~ a.cc:5:9: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' a.cc:6:9: error: expected unqualified-id before 'for' 6 | for (size_t i{ 0 }; i < 7;i++) { | ^~~ a.cc:6:29: error: 'i' does not name a type 6 | for (size_t i{ 0 }; i < 7;i++) { | ^ a.cc:6:35: error: 'i' does not name a type 6 | for (size_t i{ 0 }; i < 7;i++) { | ^ a.cc:9:14: error: 'cout' in namespace 'std' does not name a type 9 | std::cout << x[t] << "\n"; | ^~~~ a.cc:9:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 9 | std::cout << x[t] << "\n"; | ^~~
s632440316
p03644
C
#include <stdio.h> int main(void) { int n; int b; int a[100]; int i; scanf ("%d",&n); for (i = 1;i <= n;i++){ for (;i % 2 == 0;){ a[i] += 1; } } if(a[i] > a[i-1]){ b = i; } } printf("%d\n",b); return 0; }
main.c:18:12: error: expected declaration specifiers or '...' before string constant 18 | printf("%d\n",b); | ^~~~~~ main.c:18:19: error: unknown type name 'b' 18 | printf("%d\n",b); | ^ main.c:19:5: error: expected identifier or '(' before 'return' 19 | return 0; | ^~~~~~ main.c:20:1: error: expected identifier or '(' before '}' token 20 | } | ^
s074155657
p03644
C
#include <stdio.h>int main(){ int input,y=2,x=1; scanf("%d",&input); if(input<2){ printf("0\n"); }else if(input==2){ printf("1\n"); } while(y<=input){ y*=2; } x+=1; printf("%d\n",x-1); return 0;}
main.c:2:19: warning: extra tokens at end of #include directive 2 | #include <stdio.h>int main(){ int input,y=2,x=1; scanf("%d",&input); if(input<2){ printf("0\n"); }else if(input==2){ printf("1\n"); } while(y<=input){ y*=2; } x+=1; printf("%d\n",x-1); return 0;} | ^~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s608900160
p03644
C++
#include <iostream> using namespace std; int main(void){ int a,b=0,ans,max=-1; cin>>a; for(int i=1;i<=a;i++){ for(int j=2;;j*=2){ if(i%j==0)b=b+1; else break; } if(b>max){ max=b; ans=i; } } cout<<ans<<endl; return 0;
a.cc: In function 'int main()': a.cc:17:14: error: expected '}' at end of input 17 | return 0; | ^ a.cc:3:15: note: to match this '{' 3 | int main(void){ | ^
s879572676
p03644
C
#include <stdio.h> int main(void){ int n; scanf("%d",&n); if(n<2){ printf("1"); }else if(n<4){ printf("2"); }else if(n<8){ printf("4"); }else if(n<16){ printf("8"); }else if(n<32){ prinf("16"); }else if(n<64){ printf("32"); }else{ printf("64"); } return 0; }
main.c: In function 'main': main.c:14:17: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration] 14 | prinf("16"); | ^~~~~ | printf
s801577010
p03644
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int N, count = 0, mcount max; cin >> N; for (int i = 1; i <= N; i++) { int tmp = i; while (tmp % 2 == 0) { count++; tmp = tmp/2; } if (count > mcount) { max = i; mcount = count; } count = 0; } cout << max << endl; }
a.cc: In function 'int main()': a.cc:8:30: error: expected initializer before 'max' 8 | int N, count = 0, mcount max; | ^~~ a.cc:16:21: error: 'mcount' was not declared in this scope; did you mean 'count'? 16 | if (count > mcount) { | ^~~~~~ | count a.cc:17:19: error: overloaded function with no contextual type information 17 | max = i; | ^ a.cc:22:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 22 | 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, _Tr
s543293454
p03644
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int N, count = 0, mcount max; cin >> N; for (int i = 1; i <= N; i++) { int tmp = i; while (tmp % 2 == 0) { count++; tmp = tmp/2; } if (count > mcount) { max = i; mcount = count; } count = 0; } cout << max << end; }
a.cc: In function 'int main()': a.cc:8:30: error: expected initializer before 'max' 8 | int N, count = 0, mcount max; | ^~~ a.cc:16:21: error: 'mcount' was not declared in this scope; did you mean 'count'? 16 | if (count > mcount) { | ^~~~~~ | count a.cc:17:19: error: overloaded function with no contextual type information 17 | max = i; | ^ a.cc:22:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 22 | cout << max << end; | ~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Tra
s068601918
p03644
C++
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> using namespace std; int main() { int n; scanf("%d",&n); if(64<=n) puts("64"); else if(32<=n) puts("32"); else if(16<=n) puts("16"); else if(8<=n) puts("8'); else if(4<=n) puts("4"); else if(2<=n) puts("2); else puts("1"); return 0; }
a.cc:15:24: warning: missing terminating " character 15 | else if(8<=n) puts("8'); | ^ a.cc:15:24: error: missing terminating " character 15 | else if(8<=n) puts("8'); | ^~~~~ a.cc:17:24: warning: missing terminating " character 17 | else if(2<=n) puts("2); | ^ a.cc:17:24: error: missing terminating " character 17 | else if(2<=n) puts("2); | ^~~~ a.cc: In function 'int main()': a.cc:16:5: error: expected primary-expression before 'else' 16 | else if(4<=n) puts("4"); | ^~~~ a.cc:18:5: error: expected primary-expression before 'else' 18 | else puts("1"); | ^~~~
s228669774
p03644
C
#include <stdio.h> int main(){ int input,y=2,x=0; scanf("%d",&input); while(y<input){ y=y*2 x++; } printf("%d\n", x); return
main.c: In function 'main': main.c:6:14: error: expected ';' before 'x' 6 | y=y*2 | ^ | ; 7 | x++; | ~ main.c:10:5: error: expected expression at end of input 10 | return | ^~~~~~ main.c:10:5: error: expected declaration or statement at end of input
s314895158
p03644
C++
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> using namespace std; int main() { int n; scanf("%d",&n); if(64<=n) puts("64"); else if(32<=n) puts("32"); else if(16<=n) puts("16"); else if(8<=n) puts("8'); else if(4<=n) puts("4"); else if(2<=n) puts("2); else puts("1"); return 0; }
a.cc:15:24: warning: missing terminating " character 15 | else if(8<=n) puts("8'); | ^ a.cc:15:24: error: missing terminating " character 15 | else if(8<=n) puts("8'); | ^~~~~ a.cc:17:24: warning: missing terminating " character 17 | else if(2<=n) puts("2); | ^ a.cc:17:24: error: missing terminating " character 17 | else if(2<=n) puts("2); | ^~~~ a.cc: In function 'int main()': a.cc:16:5: error: expected primary-expression before 'else' 16 | else if(4<=n) puts("4"); | ^~~~ a.cc:18:5: error: expected primary-expression before 'else' 18 | else puts("1"); | ^~~~
s682528024
p03644
C
#include <stdio.h> int main(){ int input,y=2,x=0; scanf("%d",&input); while(y<input){ y=y*2 } printf("%d\n", y); return 0; }
main.c: In function 'main': main.c:6:14: error: expected ';' before '}' token 6 | y=y*2 | ^ | ; 7 | } | ~
s201695440
p03644
Java
public class Main { public static void main(String args[]){ Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.next()); scan.close(); int waru; int max = 0; int cnt = 0; int max_num = 1; while(n > 0){ cnt = 0; waru = n; while(waru % 2 == 0){ cnt++; waru = waru / 2; } if(max < cnt){ max = cnt; max_num = n; } n--; } System.out.println(max_num); } }
Main.java:5: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s465687480
p03644
C++
#include<iostream> using namespace std; int main() { int a; int i; cin >> a; for (i = 1; i <= a; i++) { if (i*i > a) { break; } } printf("%d", (int)pow(2,i-1)); system("pause"); return 0; }
a.cc: In function 'int main()': a.cc:11:27: error: 'pow' was not declared in this scope 11 | printf("%d", (int)pow(2,i-1)); | ^~~
s876162771
p03644
C
#include<stdio.h> using namespace std; int main() { int n; scanf("%d",&n); if(n==1) printf("%d\n",&n); if(2<=n&&n<4) printf("2\n"); if(4<=n&&8>n) printf("4\n"); if(8<=n&&n<16) printf("8\n"); if(16<=n&&n<32) printf("16\n"); if(32<=n&&64>n) printf("32\n"); if(62<=n&&n<=100) printf("64\n"); return 0; }
main.c:2:1: error: unknown type name 'using' 2 | using namespace std; | ^~~~~ main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std' 2 | using namespace std; | ^~~
s800861016
p03644
C++
#include<iostream> using namespace std; int main(){ int n; cin >>n; for(int i=0;;i++){ if(2^i<=n&&n<2^(i+1)){ cout<<2^i<<endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:13:10: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 13 | cout<<2^i<<endl; | ~^~~~~~
s682450358
p03644
C
#include<stdio.h> int main(void) { int k=2,i,N,a[100]; scanf("%d",&N); while(k < N){ k=k*2 } if(k == 1){ k=0; } else { k=k/2; } printf("%d",k); return 0; }
main.c: In function 'main': main.c:9:10: error: expected ';' before '}' token 9 | k=k*2 | ^ | ; 10 | } | ~
s316042790
p03644
C++
#include <sstream> #include <stdio.h> #define rep(x,y) for(int x = 0; x < (y); x++) #define REP(x,z,y) for(int x = (z); x < (y); x++) #define all(x) x.begin(),x.end() #define length(x) (sizeof(x) / sizeof(x[0])) #define split_str(str,sp_word) istringstream stream(str); string res; while(getline(stream,res,sp_word)) #define rm_space(x) x.erase(remove(all(x),' '),x.end()) using namespace std; int main(){ int N; scanf("%d",&N); int buff = 0; int anser = 1; REP(i,1,N){ int tmp = i; int cnt = 0; while(tmp % 2 == 0){ tmp = tmp / 2; cnt++; } if(buff < cnt){ buff = cnt; anser = i; } } printf("%d\n",anser); return 0;
a.cc: In function 'int main()': a.cc:30:12: error: expected '}' at end of input 30 | return 0; | ^ a.cc:12:11: note: to match this '{' 12 | int main(){ | ^
s985158882
p03644
C++
#include <iostream> #include <sstream> #include <cstdio> #include <vector> #include <algorithm> using namespace std; int main(void){ int n; cin >> n; int m=-1; while(pow(2,++m)<n); cout << pow(2,m) << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:15: error: 'pow' was not declared in this scope 11 | while(pow(2,++m)<n); | ^~~ a.cc:12:17: error: 'pow' was not declared in this scope 12 | cout << pow(2,m) << endl; | ^~~
s512931409
p03644
C++
#include<set> #include<map> #include<stack> #include<queue> #include<deque> #include<cstdio> #include<string> #include<vector> #include<math.h> #include<time.h> #include<utility> #include<cstdlib> #include<sstream> #include<cstring> #include<stdio.h> #include<iomanip> #include<iostream> #include<conio.h> #include<algorithm> using namespace std; int main(){ int n,product=1; cin>>n; while(product<=n){ product*=2; } cout<<product/2; return 0; }
a.cc:18:9: fatal error: conio.h: No such file or directory 18 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s398814372
p03644
C++
#include <iostream> //#include <array> int main() { int n; int counter = 0; std::cin >> n; while (n != 1) { n = n / 2; counter++; } std::cout << 2 ^ n << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:12:22: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 12 | std::cout << 2 ^ n << std::endl; | ~~^~~~~~~~~~~~
s337724604
p03645
C++
# include <bits/stdc++.h> # include <atcoder/all> # define rep(i, n) for (ll i = 0; i < (n); i++) # define reps(i, n) for (ll i = 1; i <= (n); i++) # define foreps(i, m, n) for (ll i = (m); i < (n); i++) # define len(x) ((int)(x).size()) # define all(x) (x).begin(), (x).end() using namespace std; using namespace atcoder; typedef long long ll; typedef long double ld; const long long mod = 1e9 + 7; const long long inf = 1e18; int main() { ll N, M; cin >> N >> M; vector<bool> A(200050, false), B(200050, false); rep(i, M) { ll a, b; cin >> a >> b; if (a == 1) A[b] = true; if (b == N) B[a] = true; } rep(i, 200050) { if (A[i] && B[i]) { cout << "POSSIBLE" << endl; return 0; } } cout << "IMPOSSIBLE" << endl; }
a.cc:2:11: fatal error: atcoder/all: No such file or directory 2 | # include <atcoder/all> | ^~~~~~~~~~~~~ compilation terminated.
s350178484
p03645
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for (ll i = 0; i < (n); ++i) int main() { ll n,m; cin >> n >> m; vector<pair<ll,ll>> g(m); rep(i,m){ ll a,b; cin >> a >> b; a--; b--; g[i] = make_pair(a,b); } sort(g.begin(),g.end()); vector<ll> start,goal; rep(i,m){ if(g[i].first == 0){ start.push_back(g[i].second); } if(g[i].second == n-1){ goal.push_back(g[i].first); } } sort(start.begin(),start.end()); sort(goal.begin(),goal.end()); ll s=start.size(),t=goal.size(); rep(i,s){ ll x = start[i]; if(binary_search(goal.begin(),goal.end(),x){ cout << "POSSIBLE" << endl; return(0); } } cout << "IMPOSSIBLE" << endl; return(0); }
a.cc: In function 'int main()': a.cc:37:48: error: expected ')' before '{' token 37 | if(binary_search(goal.begin(),goal.end(),x){ | ~ ^ | ) a.cc:41:3: error: expected primary-expression before '}' token 41 | } | ^
s764295247
p03645
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for (ll i = 0; i < (n); ++i) int main() { ll n,m; cin >> n >> m; vector<pair<ll,ll>> g(m); rep(i,m){ ll a,b; cin >> a >> b; a--; b--; g[i] = make_pair(a,b); } sort(g.begin(),g.end()); vector<ll> start,goal; rep(i,m){ if(g[i].first == 0){ start.push_back(g[i].second); } if(g[i].second == n-1){ goal.push_back(g[i].first); } } sort(start.begin(),start.end()); sotr(goal.begin(),goal.end()); ll s=start.size(),t=goal.size(); rep(i,s){ rep(j,t){ if(start[i] == goal[j]){ cout << "POSSIBLE" << endl; return(0); } } } cout << "IMPOSSIBLE" << endl; return(0); }
a.cc: In function 'int main()': a.cc:32:3: error: 'sotr' was not declared in this scope 32 | sotr(goal.begin(),goal.end()); | ^~~~
s079431757
p03645
C
#include<stdio.h> int main() { int n,m,i; scanf("%d %d",&n,&m); int a[m],b[m],sw1[n+1],sw2[n+1],cc; for(i=0;i<n+1;++i) { sw1=0; sw2=0; } cc=0; for(i=0;i<m;++i) { scanf("%d %d",&a[i],&b[i]); if(a[i]==1) sw1[b[i]]++; if(b[i]==n) sw2[a[i]]++; } for(i=1;i<n+1;++i) { if(sw1[i]>0 && sw2[i]>0) cc++; } if(cc >0) printf("POSSIBLE"); else printf("IMPOSSIBLE"); return 0;}
main.c: In function 'main': main.c:10:6: error: assignment to expression with array type 10 | sw1=0; | ^ main.c:11:6: error: assignment to expression with array type 11 | sw2=0; | ^
s370798624
p03645
C++
#include "/Users/aturgupta/Desktop/CP/stdc++.h" using namespace std; #define prv(a) \ for (auto x : a) \ { \ cout << x << " "; \ } \ cout << '\n'; #define prvp(a) \ for (auto x : a) \ { \ cout << x.first << " " << x.second << '\n'; \ } \ cout << '\n'; #define ll long long #define ld long double #define INF pow(10, 10) #define all(v) v.begin(), v.end() #define bg begin() #define ed end() #define tr(it, v) for (auto it = v.bg; it != v.ed; it++) #define f(a, b) for (ll i = a; i < b; i++) #define fj(a, b) for (ll j = a; j < b; j++) #define fb(b, a) for (ll i = b; i > a; i--) #define out(x) cout << x << '\n'; #define pr1(x) cout << (x) << " "; #define pr(x) cout << #x << " " << (x) << endl; #define pr2(x, y) cout << #x << " " << (x) << " " << #y << " " << (y) << endl; #define pr3(x, y, z) cout << #x << " " << (x) << " " << #y << " " << (y) << " " << #z << " " << (z) << endl; #define pp(x) cout << x.first << " " << x.second << endl; ll min(ll a, ll b) {if(a < b) return a; else return b;} ll max(ll a, ll b) {if(a < b) return b; else return a;} ll min3(ll a, ll b, ll c) {return min(a,min(b,c));} ll max3(ll a, ll b, ll c) {return max(a,max(b,c));} const ll N = 1e9+7; const ll S = 1e5 + 7; ll mod(ll n); ll gcd(ll a, ll b); ll modM(ll n, ll m); ll modA(ll n, ll m); ll modS(ll n, ll m); ll power(ll a, ll b); void ipgraph(ll n, ll m); //============================================================================================== vector<vector<ll>> v; vector<bool> vis; void solve() { ll n,m; cin >> n >> m; ipgraph(n,m); for(auto x:v[0]) { sort(all(v[x])); } for(auto x:v[0]) { auto it=lower_bound(all(v[x]), n-1); if(it!=v[x].end()) {cout << "POSSIBLE"; return;} } cout << "IMPOSSIBLE"; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #ifndef ONLINE_JUDGE freopen("/Users/aturgupta/Desktop/CP/input.txt", "r", stdin); freopen("/Users/aturgupta/Desktop/CP/output.txt", "w", stdout); #endif ll t; //cin >> t; t=1; while (t--) solve(); cerr << endl << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n"; return 0; } void ipgraph(ll n, ll m) { v.assign(n, {}); vis.assign(n, 0); ll x, y; f(0, m) { cin >> x >> y; x--, y--; v[y].push_back(x); v[x].push_back(y); } } ll gcd(ll a, ll b) { if (b > a) return gcd(b, a); if (b == 0) return a; return gcd(b, a % b); } ll power(ll a, ll b) { if (b == 0) return 1; ll c = power(a, b / 2); if (b % 2 == 0) return modM(c,c); else return modM(modM(c,c),a); } ll mod(ll n) {return (n % N + N) % N; } ll modM(ll n, ll m) { return ((n % N * m % N) + N) % N; } ll modA(ll n, ll m) { return ((n % N + m % N) + N) % N; } ll modS(ll n, ll m) { return ((n % N - m % N) + N) % N; }
a.cc:1:10: fatal error: /Users/aturgupta/Desktop/CP/stdc++.h: No such file or directory 1 | #include "/Users/aturgupta/Desktop/CP/stdc++.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s032033035
p03645
C++
#include <bits/stdc++.h> using namespace std; typedef bool boool; typedef long long ll; #define vl vector<ll> #define vb vector<boool> #define vs vector<string> #define vp vector<pair<ll, ll>> #define vvl vector<vector<ll>> #define vvp vector<vector<pair<ll, ll>>> #define mod 1000000007 #define all(x) x.begin(), x.end() #define rep1(i, n) for (long long i=0; i<(long long)(n); i++) #define rep2(i, s, e) for (long long i=(s); i<(long long)(e); i++) #define GET_MACRO(_1,_2,_3,NAME,...) NAME #define rep(...) GET_MACRO(__VA_ARGS__, rep2, rep1)(__VA_ARGS__) struct edge{ll to, cost;}; typedef pair<ll,ll> P; struct graph{ ll V; vector<vector<edge> > G; vector<ll> d; graph(ll n){ init(n); } void init(ll n){ V = n; G.resize(V); d.resize(V); REP(i,V){ d[i] = mod; } } void add_edge(ll s, ll t, ll cost){ edge e1, e2; e1.to = t, e1.cost = cost; e2.to = s, e2.cost = cost; G[s].push_back(e1); G[t].push_back(e2); } void dijkstra(ll s){ REP(i,V){ d[i] = mod; } d[s] = 0; priority_queue<P,vector<P>, greater<P> > que; que.push(P(0,s)); while(!que.empty()){ P p = que.top(); que.pop(); ll v = p.second; if(d[v]<p.first) continue; for(auto e : G[v]){ if(d[e.to]>d[v]+e.cost){ d[e.to] = d[v]+e.cost; que.push(P(d[e.to],e.to)); } } } } }; int main(){ int n, m; cin >> n >> m; graph g(n); rep(i, m){ int a, b; cin >> a >> b; a--; b--; g.add_edge(a,b,1); } g.dijkstra(0); if(g.d[n-1] == 2) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In member function 'void graph::init(ll)': a.cc:33:9: error: 'i' was not declared in this scope 33 | REP(i,V){ | ^ a.cc:33:5: error: 'REP' was not declared in this scope 33 | REP(i,V){ | ^~~ a.cc: In member function 'void graph::dijkstra(ll)': a.cc:47:9: error: 'i' was not declared in this scope 47 | REP(i,V){ | ^ a.cc:47:5: error: 'REP' was not declared in this scope 47 | REP(i,V){ | ^~~
s377011232
p03645
C++
#include <bits/stdc++.h> using namespace std; typedef bool boool; typedef long long ll; #define vl vector<ll> #define vb vector<boool> #define vs vector<string> #define vp vector<pair<ll, ll>> #define vvl vector<vector<ll>> #define vvp vector<vector<pair<ll, ll>>> #define mod 1000000007 #define all(x) x.begin(), x.end() #define rep1(i, n) for (long long i=0; i<(long long)(n); i++) #define rep2(i, s, e) for (long long i=(s); i<(long long)(e); i++) #define GET_MACRO(_1,_2,_3,NAME,...) NAME #define rep(...) GET_MACRO(__VA_ARGS__, rep2, rep1)(__VA_ARGS__) struct edge{ll to, cost;}; typedef pair<ll,ll> P; struct graph{ ll V; vector<vector<edge> > G; vector<ll> d; graph(ll n){ init(n); } void init(ll n){ V = n; G.resize(V); d.resize(V); REP(i,V){ d[i] = mod; } } void add_edge(ll s, ll t, ll cost){ edge e1, e2; e1.to = t, e1.cost = cost; e2.to = s, e2.cost = cost; G[s].push_back(e1); G[t].push_back(e2); } void dijkstra(ll s){ REP(i,V){ d[i] = mod; } d[s] = 0; priority_queue<P,vector<P>, greater<P> > que; que.push(P(0,s)); while(!que.empty()){ P p = que.top(); que.pop(); ll v = p.second; if(d[v]<p.first) continue; for(auto e : G[v]){ if(d[e.to]>d[v]+e.cost){ d[e.to] = d[v]+e.cost; que.push(P(d[e.to],e.to)); } } } } }; int main(){ int n, m; cin >> n >> m; graph g(n); rep(i, m){ int a, b; cin >> a >> b; a--; b--; g.add_edge(a,b,1); } g.dijkstra(s); if(g.d[n-1] == 2) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In member function 'void graph::init(ll)': a.cc:33:9: error: 'i' was not declared in this scope 33 | REP(i,V){ | ^ a.cc:33:5: error: 'REP' was not declared in this scope 33 | REP(i,V){ | ^~~ a.cc: In member function 'void graph::dijkstra(ll)': a.cc:47:9: error: 'i' was not declared in this scope 47 | REP(i,V){ | ^ a.cc:47:5: error: 'REP' was not declared in this scope 47 | REP(i,V){ | ^~~ a.cc: In function 'int main()': a.cc:77:14: error: 's' was not declared in this scope 77 | g.dijkstra(s); | ^
s806174379
p03645
C++
#include<bits/stdc++.h> using namespace std; const int mxn=1e6; vector <int> adj[mxn]; int visited[mxn]; ll dist[mxn]; queue <int> q; void bfs(int start) { q.push(start); visited[start]=1; dist[start]=0; while(!q.empty()) { int u=q.front(); q.pop(); // cout<<u<<' '; for(int i=0;i<adj[u].size();i++) { int v= adj[u][i]; if(!visited[v]) { visited[v]=1; q.push(v); dist[v]=1+dist[u]; } } } } int main() { int n,m; cin>>n>>m; int u,v; for(int i=0;i<m;i++) { cin>>u>>v; adj[u].push_back(v); adj[v].push_back(u); } memset(visited,0,sizeof(visited)); bfs(1); if dist[n]==2) cout<<"POSSIBLE"<<endl; else cout<<"IMPOSSIBLE"<<endl; }
a.cc:6:1: error: 'll' does not name a type 6 | ll dist[mxn]; | ^~ a.cc: In function 'void bfs(int)': a.cc:12:5: error: 'dist' was not declared in this scope 12 | dist[start]=0; | ^~~~ a.cc: In function 'int main()': a.cc:45:12: error: expected '(' before 'dist' 45 | if dist[n]==2) cout<<"POSSIBLE"<<endl; | ^~~~ | ( a.cc:46:9: error: 'else' without a previous 'if' 46 | else cout<<"IMPOSSIBLE"<<endl; | ^~~~
s266446974
p03645
C++
#pragma GCC optimize("Ofast") #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define rep2(i,n) for(int i=0;i<=n;i++) #define repr(i,a,n) for(int i=a;i<n;i++) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define uni(e) e.erase(unique(e.begin(),e.end()),e.end()) #define double long double template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } int INF=1e10; int MOD=1e9+7; template<class T> void out(T a){cout<<a<<'\n';} template<class T> void yesno(T b){if(b)out("yes");else out("no");} template<class T> void YesNo(T b){if(b)out("Yes");else out("No");} template<class T> void YESNO(T b){if(b)out("YES");else out("NO");} template<class T> void noyes(T b){if(b)out("no");else out("yes");} template<class T> void NoYes(T b){if(b)out("No");else out("Yes");} template<class T> void NOYES(T b){if(b)out("NO");else out("YES");} int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int kurai(int a,int b){ int m=pow(10,b),n=pow(10,b-1); return (a%m)/n; } int ketawa(int a){ int k=0; rep(i,keta(a)){ k+=kurai(a,i+1); } return k; } int gcd(int a,int b){ if(a%b==0) return b; return gcd(b,a%b); } int lcm(int a,int b){ return a/gcd(a,b)*b; } int mid(int a,int b,int c){ vector<int> k(3); k[0]=a;k[1]=b;k[2]=c; sort(all(k)); return k[1]; } bool sosuu(int a){ bool b=1; if(a<=1) return 0; else{ rep1(i,sqrt(a)-1){ if(a%(i+1)==0) b=0; } return b; } } int modpow(int a,int b,int m=MOD){ if(!b)return 1; if(b&1)return modpow(a,b-1,m)*a%m; int memo = modpow(a,b>>1,m); return memo*memo%m; } int fact_mod(int n) { int f=1; for(int i=2;i<n+1;i++) f=f*(i%MOD)% MOD; return f; } int mod_pow(int x,int n) { int res=1; while(n>0){ if(n&1) res=(res*x)%MOD; x=(x*x)%MOD; n>>=1; } return res; } int c_mod(int n, int r) { if(r>n-r) r=n-r; if(r==0) return 1; int a=1; rep(i,r) a=a*((n-i)%MOD)%MOD; int b=mod_pow(fact_mod(r), MOD-2); return (a%MOD)*(b%MOD)%MOD; } signed main(){ int a,b; cin>>a>>b; vector<int> c(b),d(b),e(b,0),f(b,0); rep(i,b) cin>>c[i]>>d[i]; rep(i,b){ if(c[i]==1) e[d[i]-1]++; } rep(i,b){ if(d[i]==a){ f[c[i]-1]++; } } bool p=0; rep(i,b){ if(f[i]&&e[i]) p++; } if(p){ out("POSIBLE"); } else out("IMPOSSIBLE"); }
a.cc: In function 'int main()': a.cc:114:5: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17 114 | p++; | ^
s537666914
p03645
C++
#pragma GCC optimize("Ofast") #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define rep2(i,n) for(int i=0;i<=n;i++) #define repr(i,a,n) for(int i=a;i<n;i++) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define uni(e) e.erase(unique(e.begin(),e.end()),e.end()) #define double long double template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } int INF=1e10; int MOD=1e9+7; template<class T> void out(T a){cout<<a<<'\n';} template<class T> void yesno(T b){if(b)out("yes");else out("no");} template<class T> void YesNo(T b){if(b)out("Yes");else out("No");} template<class T> void YESNO(T b){if(b)out("YES");else out("NO");} template<class T> void noyes(T b){if(b)out("no");else out("yes");} template<class T> void NoYes(T b){if(b)out("No");else out("Yes");} template<class T> void NOYES(T b){if(b)out("NO");else out("YES");} int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int kurai(int a,int b){ int m=pow(10,b),n=pow(10,b-1); return (a%m)/n; } int ketawa(int a){ int k=0; rep(i,keta(a)){ k+=kurai(a,i+1); } return k; } int gcd(int a,int b){ if(a%b==0) return b; return gcd(b,a%b); } int lcm(int a,int b){ return a/gcd(a,b)*b; } int mid(int a,int b,int c){ vector<int> k(3); k[0]=a;k[1]=b;k[2]=c; sort(all(k)); return k[1]; } bool sosuu(int a){ bool b=1; if(a<=1) return 0; else{ rep1(i,sqrt(a)-1){ if(a%(i+1)==0) b=0; } return b; } } int modpow(int a,int b,int m=MOD){ if(!b)return 1; if(b&1)return modpow(a,b-1,m)*a%m; int memo = modpow(a,b>>1,m); return memo*memo%m; } int fact_mod(int n) { int f=1; for(int i=2;i<n+1;i++) f=f*(i%MOD)% MOD; return f; } int mod_pow(int x,int n) { int res=1; while(n>0){ if(n&1) res=(res*x)%MOD; x=(x*x)%MOD; n>>=1; } return res; } int c_mod(int n, int r) { if(r>n-r) r=n-r; if(r==0) return 1; int a=1; rep(i,r) a=a*((n-i)%MOD)%MOD; int b=mod_pow(fact_mod(r), MOD-2); return (a%MOD)*(b%MOD)%MOD; } signed main(){ int a,b; cin>>a>>b; vetor<int> c(b),d(b),e(b,0),f(b,0); rep(i,b) cin>>c[i]>>d[i]; rep(i,b){ if(c[i]==1) e[d[i]-1]++; } rep(i,b){ if(d[i]==a){ f[c[i]-1]++; } } bool p=0; rep(i,b){ if(f[i]&&e[i]) p++; } if(p){ out("POSIBLE"); } else out("IMPOSSIBLE"); }
a.cc: In function 'int main()': a.cc:99:3: error: 'vetor' was not declared in this scope 99 | vetor<int> c(b),d(b),e(b,0),f(b,0); | ^~~~~ a.cc:5:13: error: expected primary-expression before 'long' 5 | #define int long long | ^~~~ a.cc:99:9: note: in expansion of macro 'int' 99 | vetor<int> c(b),d(b),e(b,0),f(b,0); | ^~~ a.cc:101:10: error: 'c' was not declared in this scope 101 | cin>>c[i]>>d[i]; | ^ a.cc:101:16: error: 'd' was not declared in this scope 101 | cin>>c[i]>>d[i]; | ^ a.cc:103:6: error: 'c' was not declared in this scope 103 | if(c[i]==1) | ^ a.cc:104:5: error: 'e' was not declared in this scope 104 | e[d[i]-1]++; | ^ a.cc:104:7: error: 'd' was not declared in this scope 104 | e[d[i]-1]++; | ^ a.cc:107:6: error: 'd' was not declared in this scope 107 | if(d[i]==a){ | ^ a.cc:108:5: error: 'f' was not declared in this scope 108 | f[c[i]-1]++; | ^ a.cc:108:7: error: 'c' was not declared in this scope 108 | f[c[i]-1]++; | ^ a.cc:113:6: error: 'f' was not declared in this scope 113 | if(f[i]&&e[i]) | ^ a.cc:113:12: error: 'e' was not declared in this scope 113 | if(f[i]&&e[i]) | ^ a.cc:114:5: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17 114 | p++; | ^
s384894064
p03645
C++
include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define rep(i,n) for(int i=0;i<n;i++) #define pb push_back #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n>> m; set<int> s1, s2; rep(i,m){ int x, y; cin >> x >> y; if(x==1){ s1.insert(y); } else if(y == 1){ s1.insert(x); } else if(x == n){ s2.insert(y); } else if(y == n){ s2.insert(x); } } for(auto it : s1){ if(s2.count(it)){ cout << "POSSIBLE"; return 0; } } cout << "IMPOSSIBLE"; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:12:5: error: 'ios_base' has not been declared 12 | ios_base::sync_with_stdio(false); | ^~~~~~~~ a.cc:13:5: error: 'cin' was not declared in this scope 13 | cin.tie(NULL); | ^~~ a.cc:13:13: error: 'NULL' was not declared in this scope 13 | cin.tie(NULL); | ^~~~ a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | include <bits/stdc++.h> a.cc:16:5: error: 'set' was not declared in this scope 16 | set<int> s1, s2; | ^~~ a.cc:16:9: error: expected primary-expression before 'int' 16 | set<int> s1, s2; | ^~~ a.cc:21:13: error: 's1' was not declared in this scope 21 | s1.insert(y); | ^~ a.cc:24:13: error: 's1' was not declared in this scope 24 | s1.insert(x); | ^~ a.cc:27:13: error: 's2' was not declared in this scope 27 | s2.insert(y); | ^~ a.cc:30:13: error: 's2' was not declared in this scope 30 | s2.insert(x); | ^~ a.cc:33:19: error: 's1' was not declared in this scope 33 | for(auto it : s1){ | ^~ a.cc:34:12: error: 's2' was not declared in this scope 34 | if(s2.count(it)){ | ^~ a.cc:35:13: error: 'cout' was not declared in this scope 35 | cout << "POSSIBLE"; | ^~~~ a.cc:39:5: error: 'cout' was not declared in this scope 39 | cout << "IMPOSSIBLE"; | ^~~~
s494628044
p03645
C++
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define rep(i,n) for(int i=0;i<n;i++) #define pb push_back #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n>> m; set<int> s2, s2; rep(i,m){ int x, y; cin >> x >> y; if(x==1){ s1.insert(y); } else if(y == 1){ s1.insert(x); } else if(x == n){ s2.insert(y); } else if(y == n){ s2.insert(x); } } for(auto it : s1){ if(s2.count(it)){ cout << "POSSIBLE"; return 0; } } cout << "IMPOSSIBLE"; return 0; }
a.cc: In function 'int main()': a.cc:16:18: error: redeclaration of 'std::set<int> s2' 16 | set<int> s2, s2; | ^~ a.cc:16:14: note: 'std::set<int> s2' previously declared here 16 | set<int> s2, s2; | ^~ a.cc:21:13: error: 's1' was not declared in this scope; did you mean 's2'? 21 | s1.insert(y); | ^~ | s2 a.cc:24:13: error: 's1' was not declared in this scope; did you mean 's2'? 24 | s1.insert(x); | ^~ | s2 a.cc:33:19: error: 's1' was not declared in this scope; did you mean 's2'? 33 | for(auto it : s1){ | ^~ | s2
s397747946
p03645
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; using vll = vector<vl>; using Pll = pair<ll, ll>; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) #define all(v) v.begin(), v.end() #define sz(x) ((int) x.size()) #define pb push_back #define mp make_pair #define mt make_tuple #define F first #define S second const int MOD = 1e9+7; const ll INF = 2e15; template<class T> void print(const T& t){ cout << t << endl; } 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; } ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} int main(){ ll n,m; cin >> n >> m; bool possible = false; vl dp1; vl dpn; rep(i,m){ ll a, b; cin >> a >> b; if(a==1){ dp1.pb(b); } else if(b==1){ dp1.pb(a); } if(a==n){ dpn.pb(b); } else if(b==n){ dpn.pb(a); } } sort(all(dpn)); rep(i, sz(dp1)){ if(binary_search(all(dpn),dp1[i])){ possible = true; } } if(possible){ print("POSSIBLE"); } else{ print("IMPOSSIBLE"); } }
a.cc:28:9: error: stray '\16' in program 28 | vl dpn<U+000E>; | ^~~~~~~~
s044431513
p03645
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double ld; typedef vector<ll> vl; typedef vector<string> vs; typedef vector<char> vc; typedef queue<ll> ql; typedef deque<ll> dql; typedef priority_queue<ll/*, vl, greater<ll>*/> pql; //降順(/*昇順*/) typedef set<ll> sl; typedef pair<ll, ll> pl; typedef vector<vl> vvl; typedef vector<pl> vpl; #define rep(i, n) for(ll i = 0; i < ll(n); i++) #define rep2(i, n) for(ll i = 1; i <= ll(n); i++) //#define rep(i, k, n) for(ll i = k-1; i < ll(n); i++) //#define rep2(i, k, n) for(ll i = k; i <= ll(n); i++) #define all(v) (v).begin(), (v).end() bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;} bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;} const ll INF = 1LL << 60; const ll MOD = 1e9 + 7; //const ll MOD = 998244353; const ll MAX = 1e9; const char newl = '\n'; int main() { ios::sync_with_stdio(false); cin.tie(0); ll n, m; cin >> n >> m; vl G(n); ll a, b; rep(_, m) { cin >> a >> b; a--; b--; G[a].push_back(b); G[b].push_back(a); } for(ll i: G[0]) for(ll j: G[i]) { if(j==n-1) {cout << "POSSIBLE" << newl; return 0;} } cout << "IMPOSSIBLE" << newl; return 0; }
a.cc: In function 'int main()': a.cc:40:10: error: request for member 'push_back' in 'G.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)a))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} 40 | G[a].push_back(b); | ^~~~~~~~~ a.cc:41:10: error: request for member 'push_back' in 'G.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)b))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} 41 | G[b].push_back(a); | ^~~~~~~~~ a.cc:44:16: error: 'begin' was not declared in this scope 44 | for(ll i: G[0]) for(ll j: G[i]) { | ^ a.cc:44:16: note: suggested alternatives: In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/valarray:1238:5: note: 'std::begin' 1238 | begin(const valarray<_Tp>& __va) noexcept | ^~~~~ In file included from /usr/include/c++/14/filesystem:53, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200: /usr/include/c++/14/bits/fs_dir.h:608:3: note: 'std::filesystem::__cxx11::begin' 608 | begin(recursive_directory_iterator __iter) noexcept | ^~~~~ a.cc:44:16: error: 'end' was not declared in this scope 44 | for(ll i: G[0]) for(ll j: G[i]) { | ^ a.cc:44:16: note: suggested alternatives: /usr/include/c++/14/valarray:1265:5: note: 'std::end' 1265 | end(const valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/bits/fs_dir.h:613:3: note: 'std::filesystem::__cxx11::end' 613 | end(recursive_directory_iterator) noexcept | ^~~ a.cc:44:32: error: 'begin' was not declared in this scope 44 | for(ll i: G[0]) for(ll j: G[i]) { | ^ a.cc:44:32: note: suggested alternatives: /usr/include/c++/14/valarray:1238:5: note: 'std::begin' 1238 | begin(const valarray<_Tp>& __va) noexcept | ^~~~~ /usr/include/c++/14/bits/fs_dir.h:608:3: note: 'std::filesystem::__cxx11::begin' 608 | begin(recursive_directory_iterator __iter) noexcept | ^~~~~ a.cc:44:32: error: 'end' was not declared in this scope 44 | for(ll i: G[0]) for(ll j: G[i]) { | ^ a.cc:44:32: note: suggested alternatives: /usr/include/c++/14/valarray:1265:5: note: 'std::end' 1265 | end(const valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/bits/fs_dir.h:613:3: note: 'std::filesystem::__cxx11::end' 613 | end(recursive_directory_iterator) noexcept | ^~~
s756311488
p03645
C++
#include<iostream> #include<vector> #include <cmath> #include <map> #include <algorithm> #include <string> using namespace std; int main(void){ int N, M, a, b; cin >> N >> M; vector<set<int>> v(N + 1); for (int i = 0; i != M; ++i) { cin >> a >> b; v[a].insert(b); v[b].insert(a); } cout << (any_of(begin(v[1]), end(v[1]), [&](int s) { return v[s].count(N); }) ? "POSSIBLE" : "IMPOSSIBLE") << endl; }
a.cc: In function 'int main()': a.cc:11:10: error: 'set' was not declared in this scope 11 | vector<set<int>> v(N + 1); | ^~~ a.cc:6:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>' 5 | #include <algorithm> +++ |+#include <set> 6 | #include <string> a.cc:11:17: error: template argument 1 is invalid 11 | vector<set<int>> v(N + 1); | ^~ a.cc:11:17: error: template argument 2 is invalid a.cc:14:6: error: invalid types 'int[int]' for array subscript 14 | v[a].insert(b); | ^ a.cc:15:6: error: invalid types 'int[int]' for array subscript 15 | v[b].insert(a); | ^ a.cc:18:26: error: invalid types 'int[int]' for array subscript 18 | cout << (any_of(begin(v[1]), end(v[1]), [&](int s) { return v[s].count(N); }) | ^ a.cc:18:37: error: invalid types 'int[int]' for array subscript 18 | cout << (any_of(begin(v[1]), end(v[1]), [&](int s) { return v[s].count(N); }) | ^ a.cc: In lambda function: a.cc:18:64: error: invalid types 'int[int]' for array subscript 18 | cout << (any_of(begin(v[1]), end(v[1]), [&](int s) { return v[s].count(N); }) | ^
s771520562
p03645
C++
#include <bits/stdc++.h> using namespace std; using ll = int64_t; ll main() { ll n, m; cin >> n >> m; vector<vector<int>> s(n + 1); for (ll i = 0; i < m; i++) { ll a, b; cin >> a >> b; s[a].push_back(b); s[b].push_back(a); } vector<ll> cost(n + 1, -1); priority_queue<pair<int, int>> q; q.push({0, 1}); cost[1] = 0; while (!q.empty()) { auto c = q.top().first; auto num = q.top().second; q.pop(); for (size_t i = 0; i < s[num].size(); i++) { auto next = s[num][i]; if (cost[next] == -1) { q.push({c + 1, next}); cost[next] = c + 1; } } if (cost[n] != -1) break; } if (cost[n] == 2) { cout << "POSSIBLE" << endl; } else { cout << "IMPOSSIBLE" << endl; } }
a.cc:5:1: error: '::main' must return 'int' 5 | ll main() { | ^~
s855614774
p03645
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i,n) for (int (i)=0; (i) < (n); (i)++) int main() { ll N, M; cin >> N >> M; vector<ll> a(N, 0); vector<ll> b(N, 0); rep(i,M) { ll A, B; cin >> A >> B; if (A == 1) { a[B-1] = 1; } else if (B == 1) { a[A-1] = 1; } if (A == N) { b[B-1] = 1; } else if (B == N) { b[A-1] = 1; } } rep(i,N) { if (a[i] == 1 && b[i] == 1) { cout << "POSSIBLE" << endl; exit(0); } } } cout << "IMPOSSIBLE" << endl; }
a.cc:34:5: error: 'cout' does not name a type 34 | cout << "IMPOSSIBLE" << endl; | ^~~~ a.cc:36:1: error: expected declaration before '}' token 36 | } | ^
s829228434
p03645
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i,n) for (int (i)=0; (i) < (n); (i)++) int main() { ll N, M; cin >> N >> M; vector<ll> a(N, 0); vector<ll> b(N, 0); rep(i,M) { ll A, B; cin >> A >> B; if (A == 1) { a[B-1] = 1; } else if (B == 1) { a[A-1] = 1; } if (A == N) { b[B-1] = 1; } else if (B == N) { b[A-1] = 1; } } rep(i,N)) { if (a[i] == 1 && b[i] == 1) { cout << "POSSIBLE" << endl; exit(0); } } } cout << "IMPOSSIBLE" << endl; }
a.cc: In function 'int main()': a.cc:27:13: error: expected primary-expression before ')' token 27 | rep(i,N)) { | ^ a.cc: At global scope: a.cc:34:5: error: 'cout' does not name a type 34 | cout << "IMPOSSIBLE" << endl; | ^~~~ a.cc:36:1: error: expected declaration before '}' token 36 | } | ^
s728950423
p03645
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; const int MOD=1000000007; int main() { int n,m; cin >> n >> m; vector<vector<int>> data(m, vector<int>(2)); for (int i = 0; i < m; i++) { for (int j = 0; j < 2; j++) { cin >> data.at(i).at(j); } } sort(data.begin(), data.end()) for (int i = 0; i < m; i++) { if(data.at(i).at(0)==1){ for (int j = 0; j < m; j++){ if(data[i][1]==data[j][0] && data[j][1]==n){ cout << "POSSIBLE" << endl; return 0; } } } if(data.at(i).at(0)==2) break; } cout << "IMPOSSIBLE" << endl; }
a.cc: In function 'int main()': a.cc:15:33: error: expected ';' before 'for' 15 | sort(data.begin(), data.end()) | ^ | ; 16 | for (int i = 0; i < m; i++) { | ~~~ a.cc:16:19: error: 'i' was not declared in this scope 16 | for (int i = 0; i < m; i++) { | ^
s769459311
p03645
C++
#include<stdio.h> #include<iostream> #include<vector> #include<math.h> #include<queue> #include<map> #include<algorithm> #include<string.h> #include<functional> #include<limits.h> #include<stdlib.h> #include<string> #include<unordered_map> using namespace std; #define intmax INT_MAX #define lmax LONG_MAX #define uintmax UINT_MAX #define ulmax ULONG_MAX #define llmax LLONG_MAX #define ll long long #define rep(i,a,N) for((i)=(a);(i)<(N);(i)++) #define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--) #define llfor ll i,j,k #define sc(a) cin>>a #define pr(a) cout<<a<<endl #define pY puts("YES") #define pN puts("NO") #define py puts("Yes") #define pn puts("No") #define pnn printf("\n") #define sort(a) sort(a.begin(),a.end()) #define push(a,b) (a).push_back(b) #define llvec vector<vector<ll>> #define charvec vector<vector<char>> #define sizeoof(a,b) (a,vector<ll>(b)) #define llpvec vector<pair<ll,ll>> /*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;} /*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;} /*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;} /*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;} /*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;} /*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);} /*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);} /*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;} ll ans=0;llfor;/////////////////////////////////////////////////////////// int main(){ ll n,m; sc(n);sc(m); ll a,b; llpvec c(m); ll mapb[200010],mapa[200010]; ll memoa=0,memob=0; rep(i,0,m){ sc(a);sc(b); //pr(memo); if((mapa[a]&&b==n)||(a==1&&mapb[b])){ puts("POSSIBLE"); returna 0; } if(a==1)mapa[b]=1; if(b==n)mapb[a]=1; } puts("IMPOSSIBLE"); return 0;}
a.cc: In function 'int main()': a.cc:59:4: error: 'returna' was not declared in this scope 59 | returna 0; | ^~~~~~~
s790150631
p03645
C++
#include<bits/stdc++.h> #define ll long long int using namespace std; int main() { ll n,k,x=-2,y=2000000,m;map<ll,ll>ml; cin>>n>>m; vector<pair<ll,ll>>v; for(int i=1;i<=m;i++){ ll a,b; cin>>a>>b; v.push_back(make_pair(a,b)); } sort(v.begin(),v.end()); for(int i=0;i<v.size();i++){ if(v[i].first==1)m[v[i].second]=1; else if(v[i].second==n&&m[v[i].first]){ cout<<"POSSIBLE";return 0; } } cout<<"IMPOSSIBLE"; return 0; }
a.cc: In function 'int main()': a.cc:19:27: error: invalid types 'long long int[long long int]' for array subscript 19 | if(v[i].first==1)m[v[i].second]=1; | ^ a.cc:20:34: error: invalid types 'long long int[long long int]' for array subscript 20 | else if(v[i].second==n&&m[v[i].first]){ | ^
s638179992
p03645
C++
#include<bits/stdc++.h> #define ll long long int using namespace std; int main() { ll n,k,x=-2,y=2000000; cin>>n>>m; vector<pair<ll,ll>>v; for(int i=1;i<=m;i++){ ll a,b; cin>>a>>b; v.push_back(make_pair(a,b)); } sort(v.begin(),v.end()); for(int i=0;i<v.size();i++){ if(v[i].first==1)x=max(x,v[i].second); else if(v[i].second==n){ y=min(y,v[i].first); } } if(x>=y)cout<<"POSSIBLE"; cout<<"IMPOSSIBLE"; return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: 'm' was not declared in this scope 10 | cin>>n>>m; | ^
s297674234
p03645
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int n,m; cin >>n>>m; vector<pair<int,int>> a(m); vector<bool> c(n,false); rep(i,m){ int a,b; cin >>a>>b; a.at(i)=make_pair(a,b); if(a==1){ c.at(b-1)=true; } } sort(a.begin(),a.end()); for( auto p:a){ int d=a.first; int e=a.second; if(c.at(d-1)==true && e==n){ cout <<"POSSIBLE"; return 0; } } cout << "IMPOSSIBLE"; }
a.cc: In function 'int main()': a.cc:12:7: error: request for member 'at' in 'a', which is of non-class type 'int' 12 | a.at(i)=make_pair(a,b); | ^~ a.cc:19:13: error: 'class std::vector<std::pair<int, int> >' has no member named 'first' 19 | int d=a.first; | ^~~~~ a.cc:20:13: error: 'class std::vector<std::pair<int, int> >' has no member named 'second' 20 | int e=a.second; | ^~~~~~
s033979412
p03645
C++
#include <iostream> #include <vector> #include <utility> #include <algorithm> using namespace std; int main(int argc, char const *argv[]) { int N, M; cin >> N >> M; vector<int> a, b; a.resize(M); b.resize(M); vector<bool> ftoi; vector<bool> itoN; ftoi.resize(N + 1); fill(ftoi.begin(), ftoi.end(), false); itoN.resize(N + 1); fill(itoN.begin(), itoN.end(),false); fill for (int i = 0; i < M; i++) { cin >> a[i]; cin >> b[i]; if (a[i] > b[i]) swap(a[i], b[i]); if (a[i] == 1) { ftoi[b[i]] = true; }else { ftoi[b[i]] = false; } if (b[i] == N) { itoN[a[i]] = true; }else { itoN[a[i]] = false; } } for (int i = 0; i < N; i++) { if (ftoi[i] & itoN[i]) { cout << "POSSIBLE" << endl; return 0; } } cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:21:9: error: expected ';' before 'for' 21 | fill | ^ | ; 22 | for (int i = 0; i < M; i++) | ~~~ a.cc:22:19: error: statement cannot resolve address of overloaded function 22 | for (int i = 0; i < M; i++) | ^ a.cc:22:21: error: 'i' was not declared in this scope 22 | for (int i = 0; i < M; i++) | ^
s031483794
p03645
C++
#include <iostream> #include <vector> #include <utility> #include <algorithm> using namespace std; int main(int argc, char const *argv[]) { int N, M; cin >> N >> M; vector<int> a, b; a.resize(M); b.resize(M); vector<bool> ftoi; vector<bool> itoN; ftoi.resize(N + 1); fill(ftoi.begin(), ftoi.end()); itoN.resize(N + 1); fill(itoN.begin(), itoN.end()); fill for (int i = 0; i < M; i++) { cin >> a[i]; cin >> b[i]; if (a[i] > b[i]) swap(a[i], b[i]); if (a[i] == 1) { ftoi[b[i]] = true; }else { ftoi[b[i]] = false; } if (b[i] == N) { itoN[a[i]] = true; }else { itoN[a[i]] = false; } } for (int i = 0; i < N; i++) { if (ftoi[i] & itoN[i]) { cout << "POSSIBLE" << endl; return 0; } } cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:18:9: error: no matching function for call to 'fill(std::vector<bool>::iterator, std::vector<bool>::iterator)' 18 | fill(ftoi.begin(), ftoi.end()); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:1022:5: note: candidate: 'template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)' 1022 | fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) | ^~~~ /usr/include/c++/14/bits/stl_algobase.h:1022:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:86, from a.cc:4: /usr/include/c++/14/pstl/glue_algorithm_defs.h:191:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::fill(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)' 191 | fill(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:191:1: note: candidate expects 4 arguments, 2 provided a.cc:20:9: error: no matching function for call to 'fill(std::vector<bool>::iterator, std::vector<bool>::iterator)' 20 | fill(itoN.begin(), itoN.end()); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1022:5: note: candidate: 'template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)' 1022 | fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) | ^~~~ /usr/include/c++/14/bits/stl_algobase.h:1022:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:191:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::fill(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)' 191 | fill(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:191:1: note: candidate expects 4 arguments, 2 provided a.cc:21:9: error: expected ';' before 'for' 21 | fill | ^ | ; 22 | for (int i = 0; i < M; i++) | ~~~ a.cc:22:19: error: statement cannot resolve address of overloaded function 22 | for (int i = 0; i < M; i++) | ^ a.cc:22:21: error: 'i' was not declared in this scope 22 | for (int i = 0; i < M; i++) | ^
s667311049
p03645
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long n,m,a[200005],b[200005],c[200005]={}; cin>>n>>m; for(int i=0;i<m;i++){ cin>>a[i]>>b[i]; else if(b[i]==n){ c[a[i]]=1; } } for(int i=0;i<m;i++){ if(a[i]==1){ if(c[b[i]]==1){ cout<<"POSSIBLE"<<endl; return(0); } } } cout<<"IMPOSSIBLE"<<endl; return(0); }
a.cc: In function 'int main()': a.cc:8:33: error: 'else' without a previous 'if' 8 | else if(b[i]==n){ | ^~~~
s520993350
p03645
C++
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, l, r) for (int i = (l); i < (r); i++) #define ALL(x) (x).begin(), (x).end() //昇順 #define RALL(x) (x).rbegin(), (x).rend() // 降順 #define pri(x) cout << (x) << "\n" #define pri2(x, y) cout << (x) << " " << (y) << "\n" #define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n" const long long mod = 1e9 + 7; typedef long long ll; typedef priority_queue<int> PQ; typedef vector<long long> VL; typedef vector<bool> VB; typedef vector<int> VI; // VI a(n); typedef vector<double> VD; typedef vector<string> VS; typedef vector<char> VC; typedef vector<VS> VSS; typedef vector<VC> VCC; typedef vector<VI> VII; // VII a(n,VI(m)) n * m typedef vector<VL> VLL; typedef pair<int, int> PII; typedef map<int, int> MP; // MP a; typedef vector<pair<ll, ll>> PS; template <class T, class U> bool chmax(T &a, U b) { if (a <= b) { a = b; return 1; } return 0; } template <class T, class U> bool chmin(T &a, U b) { if (a > b) { a = b; return 1; } return 0; } template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { os << "{"; rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); } os << "}"; return os; } // g++ -std=c++11 prac.cpp // operator << (cout,a); // chmin(min,a) int main() { ll n, m, k, x, y , z = 0, h, ans=0, w, sum = 0, Max = -1, Min = 3e9+1; string u; bool ok=true; cin >> n >> m; VL a(m),b(m); VB ans(m,false); rep(i,m){ cin >> a[i] >> b[i]; }  // 1 から行ける場所 rep(i,m){ if(a[i]==1){ ans[b[i]]=true; } } //1から行ける場所 からnに行ける場所 rep(i,m){ if(b[i]==n && ans[a[i]]){ pri("POSSIBLE"); return 0; } } pri("IMPOSSIBLE"); return 0; }
a.cc:63:4: error: extended character   is not valid in an identifier 63 | }  | ^ a.cc: In function 'int main()': a.cc:60:20: error: conflicting declaration 'VB ans' 60 | VL a(m),b(m); VB ans(m,false); | ^~~ a.cc:56:32: note: previous declaration as 'll ans' 56 | ll n, m, k, x, y , z = 0, h, ans=0, w, sum = 0, Max = -1, Min = 3e9+1; | ^~~ a.cc:63:4: error: '\U00003000' was not declared in this scope 63 | }  | ^~ a.cc:65:7: error: 'i' was not declared in this scope 65 | rep(i,m){ | ^ a.cc:3:35: note: in definition of macro 'rep' 3 | #define rep(i, n) for (int i = 0; i < n; i++) | ^ a.cc:72:22: error: invalid types 'll {aka long long int}[__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}]' for array subscript 72 | if(b[i]==n && ans[a[i]]){ | ^
s588594324
p03645
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long N,M; cin>>N>>M; vector<set<long long>>G(N); vector<vector<long long>>G2(N); for(int i=0;i<N;i++){ int a,b; cin>>a>>b; a--; b--; G.at(a).insert(b); G.at(b).insert(a); G2.at(a).push_back(b); G2.at(b).push_back(a); } bool flag=false; for(int i=0;i<G2.at(0)size();i++){ if(G.at(N-1).count(G2.at(0).at(i))){ flag=true; } } if(flag){ cout<<"POSSIBLE"<<endl; } else{ cout<<"IMPOSSIBLE"<<endl; } }
a.cc: In function 'int main()': a.cc:19:16: error: no match for 'operator<' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'std::vector<long long int>'}) 19 | for(int i=0;i<G2.at(0)size();i++){ | ~^~~~~~~~~ | | | | int __gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type {aka std::vector<long long int>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:19:24: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'std::vector<long long int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:19:24: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'std::vector<long long int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:19:24: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:19:24: note: 'std::vector<long long int>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 19 | for(int i=0;i<G2.at(0)size();i++){ | ^ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, |