submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s213747543
p03672
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <cmath> using namespace std; char str[233]; int main() { while(~scanf("%s", str)) { int ln = strlen(str); int res; for(int i = ln-1; i >= 0; i--) { if(i & 1) { bool flg=1; for(int j = 0, k=(i-1)/2 + 1; j <= (i-1)/2, k <= i; j++, k++)...
a.cc: In function 'int main()': a.cc:17:20: error: expected ')' before '{' token 17 | if(str[i] != str[j] { | ~ ^~ | ) a.cc:21:1: error: expected primary-expression before '}' token 21 | } | ^
s216068310
p03672
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <cmath> using namespace std; char str[233]; int main() { while(~scanf("%s", str)) { int ln = strlen(str); int res; for(int i = ln-1; i >= 0; i--) { if(i & 1) { bool flg=1; for(int j = 0, k=(i-1)/2 + 1; j <= (i-1)/2, k <= i; j++, k++)...
a.cc: In function 'int main()': a.cc:17:20: error: expected ')' before '{' token 17 | if(str[i] != str[j] { | ~ ^~ | ) a.cc:21:1: error: expected primary-expression before '}' token 21 | } | ^
s794500651
p03672
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <cmath> using namespace std; char str[233]; int main() { while(~scanf("%s", str)) { int ln = strlen(str); int res; for(int i = ln-1; i >= 0; i--) { if(i & 1) { bool flg=1; for(int j = 0, k=(i-1)/2 + 1; j <= (i-1)/2, k <= i; j++, k++)...
a.cc: In function 'int main()': a.cc:17:20: error: expected ')' before '{' token 17 | if(str[i] != str[j] { | ~ ^~ | ) a.cc:21:1: error: expected primary-expression before '}' token 21 | } | ^ a.cc:26:16: error: 'i' was not declared in this scope 26 | print...
s681178948
p03672
C++
#include <iostream> #include <vector> #include <limits> #include <string> #include <boost/range/irange.hpp> #include <boost/range/adaptors.hpp> using namespace std; using namespace boost; using uint = unsigned int; using ll = long long int; using ull = unsigned long long int; bool is_ok(const string & s){ if (s.s...
a.cc:5:10: fatal error: boost/range/irange.hpp: No such file or directory 5 | #include <boost/range/irange.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s439213168
p03672
C++
#include <iostream> using namespace std; int main(void){ int len,i,cnt; vector<int> a; scanf("%s",a); for(i=a.size()/2;--i;){ cnt=0; for(int j=0;j<i;j++)if(a[j]==a[j+i])cnt++; if(cnt==i)break; } printf("%d\n",i*2); }
a.cc: In function 'int main()': a.cc:5:5: error: 'vector' was not declared in this scope 5 | vector<int> a; | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | using...
s760570902
p03672
C++
#include<stdio.h> #include<string.h> #include<conio.h> main() { int i,j,k,l,sum=0,count=0; char a[200]; gets(a); l=strlen(a)-1; for(i=0;i<l/2;i++) { // printf("c%dc",l); if(l%2==0){ for(j=0;j<l;j++) { if(a[i]==a[j]) { count++; } } // printf("%c=%d\n",a[i],count); if(count%2!=0) { l--...
a.cc:3:9: fatal error: conio.h: No such file or directory 3 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s151111837
p03672
C++
#include<stdio.h> #include<string.h> main() { int i,j,k,l,sum=0,count=0; char a[200]; gets(a); l=strlen(a)-1; for(i=0;i<l/2;i++) { // printf("c%dc",l); if(l%2==0){ for(j=0;j<l;j++) { if(a[i]==a[j]) { count++; } } // printf("%c=%d\n",a[i],count); if(count%2!=0) { l--; count=0; i...
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main() | ^~~~ a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(a); | ^~~~ | getw
s679928012
p03672
C++
#include <iostream> #include <algorithm> #include <string> #include <string.h> #include <vector> #include <cstdio> #include <cmath> using namespace std; int main(){ string s; cin>>s; int size=s.length(); for(int i=size+1;i>=2;i=i-2){ int k=i/2; string sub=s.substr(0,k-1); string test=sub+sub; ...
a.cc: In function 'int main()': a.cc:19:29: error: expected ')' before '{' token 19 | if(test==s.substr(0,i-1){ | ~ ^ | ) a.cc:23:3: error: expected primary-expression before '}' token 23 | } | ^
s782802707
p03672
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); int O = S.length()-1; int ans = 1; char[] C = S.toCharArray(); if (O% 2 == 1) { O = O - 1; ans++; } lavel:f...
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s836498539
p03672
C++
#include<iostream> #include<stdio.h> #include<string> #include<algorithm> #include<vector> using namespace std; int main() { char s[200]; cin >> s; int len = strlen(s); for (int i = len - 2; i; i -= 2) { if (strncmp(s, s + i / 2, i / 2) == 0) { cout << i << endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:12:19: error: 'strlen' was not declared in this scope 12 | int len = strlen(s); | ^~~~~~ a.cc:6:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include<vector> +++ |+#include <c...
s872364017
p03672
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> using namespace std; int main() { char s[200]; cin >> s; int len = strlen(s); for (int i = len - 2; i; i -= 2) { if (strncmp(s, s + i / 2, i / 2) == 0) { cout << i << endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:11:19: error: 'strlen' was not declared in this scope 11 | int len = strlen(s); | ^~~~~~ a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<vector> +++ |+#include <c...
s087352545
p03672
C++
#include <iostream> #include <climits> #include <string> #include <stdlib.h> #include <algorithm> using namespace std; int ascSort(const void* v1, const void* v2) { const int _v1 = *((const int*)v1); const int _v2 = *((const int*)v2); if ( _v1 < _v2 ) { return 1; } else if ( _v1 > _v2 ) { ...
a.cc: In function 'int main()': a.cc:28:13: error: 'strlen' was not declared in this scope 28 | n = strlen(s); | ^~~~~~ a.cc:6:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <algorithm> +++ |+#include <cstring> ...
s946226125
p03672
C++
#include <bits/stdc++.h> #include<iostream> #include<cstdio> #include<vector> #include<queue> ...
a.cc: In function 'int main()': a.cc:52:36: error: expected ')' before ';' token 52 | while(int i=(l-2)/2;i=0;i++){ | ~ ^ | ) a.cc:52:37: error: 'i' was not declared in this scope 52 | while(int i=(l-2)...
s123774570
p03672
C++
#include <iostream> #include <string> using namespace std; int main(void) { int a, b, c = INT_MAX; string n, x, y; cin >> n; a = size(n); for (int i = 1; i < a; i++) { b = a - i; if ((b % 2) == 0) { x = n.substr(0, (b / 2)); y = n.substr((b / 2), (b / 2)); if (x.compare(y) == 0) { ...
a.cc: In function 'int main()': a.cc:6:17: error: 'INT_MAX' was not declared in this scope 6 | int a, b, c = INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#include <cl...
s683458425
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int size = s.size(); for (int i = 0; i < size; i++) { s.pop_back(); itn ss = s.size(); if (s.substr(0, ss/2) == s.substr(ss/2, ss/2)) { cout << ss - 1 << endl; return 0; ...
a.cc: In function 'int main()': a.cc:11:9: error: 'itn' was not declared in this scope; did you mean 'int'? 11 | itn ss = s.size(); | ^~~ | int a.cc:12:25: error: 'ss' was not declared in this scope; did you mean 's'? 12 | if (s.substr(0, ss/2) == s.substr(ss/2, ss/2)) ...
s008386488
p03672
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; typedef pair<ll, P> PP; static const double EPS = 1e-8; static const double PI = 4.0 * atan(1.0); static const ll INF = 1023456789; #define REP(i,n) for(int i=0;i<n;++i) #define REPR(i,n) for(...
a.cc: In function 'int main(int, char**)': a.cc:28:44: error: expected ';' before ')' token 28 | for (int i = s.length() - 2; i -= 2) { | ^ | ;
s348906219
p03672
C++
#include <iostream> #include <math.h> #include <algorithm> #include <vector> #include <numeric> using namespace std; const double PI = acos(-1.0); const string ALP = "abcdefghijklmnopqrstuvwxyz"; #define PB push_back #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define FOR(i,a...
a.cc: In function 'int main()': a.cc:17:16: error: expected ';' before '<' token 17 | for(int i=1,i<s.length(),i++){ | ^ | ; a.cc:17:16: error: expected primary-expression before '<' token a.cc:17:31: error: expected ';' before ')' token 17 | for(int i=1,i<s.length(),...
s098798399
p03672
C++
//abc066_b ss #include <bits/stdc++.h> using namespace std; namespace { bool Chk( const char *S, const int iNum ) { int i; char C; for( i = 0; i < iNum; i++ ) { C = S[ i ]; if( C == '\0' || C != S[ i + iNum ] ) return false; } return true; } } int main() { int i; int iLen; char S[ 210 ]; cin >> S; iL...
a.cc: In function 'int main()': a.cc:36:26: error: invalid conversion from 'int' to 'const char*' [-fpermissive] 36 | if( Chk( i ) ) | ^ | | | int a.cc:36:24: error: too few arguments to function 'bool {anony...
s085868187
p03672
C++
//abc066_b ss #include <bits/stdc++.h> using namespace std; namespace { bool Chk( const char *S, const int iNum ) { int i; char C; for( i = 0; i < iNum; i++ ) { C = S[ i ]; if( C == '\0' || C != S[ i + iNum ]; ) return false; } return true; } } int main() { int i; int iLen; char S[ 210 ]; cin >> S; i...
a.cc: In function 'bool {anonymous}::Chk(const char*, int)': a.cc:17:54: error: expected primary-expression before ')' token 17 | if( C == '\0' || C != S[ i + iNum ]; ) return false; | ^ a.cc: In function 'int main()': a.cc:36:26: error: inva...
s312373678
p03672
C++
include<bits/stdc++.h> using namespace std; int main(){ string S, s; cin>>S; int res=0; for(int i=0;i<(int)S.size();i+=2){ s+=S[i]; s+=S[i+1]; if(s.substr(0, i/2)==s.substr(i/2, i/2)){ res=i; } ...
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:6:9: error: 'string' was not declared in this scope 6 | string S, s; | ^~~~~~ a.cc:7:9: error: 'cin' was not declared in this scope 7 | cin>>S; ...
s193121403
p03672
C
#include<stdio.h> int main() { char s; scanf("%e",&s); /* 文字数をカウント */ for(i=0; moji[i]!='\0'; ++i); i = i-2 /* 文字数を出力 */ printf("%d\n",i); // 出力 return 0; }
main.c: In function 'main': main.c:7:7: error: 'i' undeclared (first use in this function) 7 | for(i=0; moji[i]!='\0'; ++i); | ^ main.c:7:7: note: each undeclared identifier is reported only once for each function it appears in main.c:7:12: error: 'moji' undeclared (first use in this function) 7 |...
s130430994
p03672
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; cin >> s; if(s.length() % 2 == 1) s.insert(-1,"a"); while(1){ int ans, i=0; s.erase(s.end()-1); if(s.substr(0,s.length()/2) == s.substr(s.length()/2)){ ans = s.length() / 2; ...
a.cc: In function 'int main()': a.cc:19:14: error: 'ans' was not declared in this scope; did you mean 'abs'? 19 | cout << &ans << endl; | ^~~ | abs
s820008534
p03672
C++
#include <iostream> #include<sstream> #include<vector> #include<iterator> using namespace std; int main(void) { string S; cin >> S; string rs(S); reverse(rs.begin(), rs.end()); int ret; for(int i=(S.size()%2==0 ? 2 : 1); i<S.size(); i+=2) { string l, r; int length = (S.size() - i) / 2; int size = length...
a.cc: In function 'int main()': a.cc:13:9: error: 'reverse' was not declared in this scope 13 | reverse(rs.begin(), rs.end()); | ^~~~~~~
s220453303
p03672
Java
import java.util.*; import org.apache.tools.ant.taskdefs.Exit; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); isOddString(s.substring(0, s.length() - 1)); } public static void isOddString(String s) { if (s.le...
Main.java:3: error: package org.apache.tools.ant.taskdefs does not exist import org.apache.tools.ant.taskdefs.Exit; ^ 1 error
s438512203
p03672
Java
import java.util.Scanner; public class Main2 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str = scan.nextLine(); String ans; String ans2; int answer = 0; for(int i = 1; i < str.length()+1; i++){ ans = str.substring(0, str.length()-i); if(ans.length() % 2 =...
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java public class Main2 { ^ 1 error
s743690693
p03672
C++
#include <iostream> #include <vector> #include <string> #include <limits.h> using namespace std; int main(void) { string s; cin >> s; while (true) { string s1; string s2; s.pop_back(); int size = static_cast<int>(s.size()); int m...
a.cc: In function 'int main()': a.cc:41:13: error: 's1' was not declared in this scope; did you mean 's'? 41 | cout << s1.size() << endl; | ^~ | s
s964064786
p03672
C++
int main() { string str; cin >> str; int l = str.length() -1; l /= 2; for (int i = l ; i >= 0; i--) { string A, B; A = str.substr(0, i); B = str.substr(i, i); if (A == B) { cout << i * 2 << endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:3:9: error: 'string' was not declared in this scope 3 | string str; | ^~~~~~ a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> str; | ^~~ a.cc:5:16: error: 'str' was not declared in this scope; did you mean 'std'? ...
s794569201
p03672
C++
#include<stdio.h> #include<string.h> char a[220]; int main(){ gets(a); int s=strlen(a),head,end,sum,i,ans=0,j; for(i=0;i<s;i++){ if(a[i]==a[i+1]){ sum=0; head=i,end=i+1; while(a[head]==a[end]&&head>0&&end<s-1){ sum+=2; head--;end++; } if(ans<sum) ans=sum; } } for(i=0;i<s;i++){ for(...
a.cc: In function 'int main()': a.cc:5:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 5 | gets(a); | ^~~~ | getw
s661211237
p03672
C++
#include <iostream> #include <string> using namespace std; int main (void) { char input[201]; char a[100], b[100]; int i,j,l; int check; int ans; cin >> input ; l = strlen(input); while(1){ j = 0; //aにコピー for(i = 0; i <= (l-2)/2; l++){ a[j] = input[...
a.cc: In function 'int main()': a.cc:14:9: error: 'strlen' was not declared in this scope 14 | l = strlen(input); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 ...
s945756597
p03672
C
#include<stdio.h> #include<string.h> int main(){ char str[222]; scanf("%s",str); int n= strlen (str); for (int i=n-2; i ; i-=2){ if(strncmp (str , str+i/2,i/2) ==0){ printf("%d\n",i); return0; } } return = 0; }
main.c:3:4: error: stray '\343' in program 3 | int<U+3000>main(){ | ^~~~~~~~ main.c: In function 'main': main.c:10:1: error: 'return0' undeclared (first use in this function) 10 | return0; | ^~~~~~~ main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in...
s995899026
p03672
C++
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; while(!s.empty()){ int len=strlen(s); if(s.substr(0,len/2)==s.substr(len/2,len) and len%2==0)break; s.pop_back(); } cout<<s.length()<<endl; }
a.cc: In function 'int main()': a.cc:9:32: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 9 | int len=strlen(s); | ^ | | | std::string {aka st...
s456874489
p03672
C++
#include <iostream> using namespace std; int main() { string s; cin >> s; for (int deleted { 1 }; i < s.length(); ++deleted) { const int len { s.length() - deleted }; if (len % 2 != 0) continue; const int half { len / 2 }; int iterator { 0 }; while (iterator < half...
a.cc: In function 'int main()': a.cc:8:29: error: 'i' was not declared in this scope 8 | for (int deleted { 1 }; i < s.length(); ++deleted) { | ^ a.cc:9:36: warning: narrowing conversion of '(s.std::__cxx11::basic_string<char>::length() - ((std::__cxx11::basic_string<char>::siz...
s546357166
p03672
Java
import java.io.PrintWriter; import java.util.Scanner; public class Main { static Scanner in; static PrintWriter out; static void solve() { String S = in.next(); if (S.length() == 2) { System.out.println(0); return; } for(int i = 0; i < S.length(); i++) { S = S.substring(0, S.length() ...
Main.java:30: error: reached end of file while parsing } ^ 1 error
s038529909
p03672
C
# include < stdio .h > # include < string .h > int main () { char str [222]; scanf ("%s", str ) ; int n= strlen (str ) ; for (int i=n -2; i; i -=2) { if( strncmp (str , str +i/2 , i/2) ==0) { printf ("%d\n" ,i) ; return 0; } } return 0; }
main.c:1:11: fatal error: stdio .h : No such file or directory 1 | # include < stdio .h > | ^~~~~~~~~~~~ compilation terminated.
s315813387
p03672
C++
#include <bits/stdc++.h> using namespace std; int main(void) { string s; cin >> s; int sz, size = s.size(); for (int i = 2; i <= size; i += 2) { s = s.substr(0, s.size() - 2); sz = s.size() / 2; if (s.substr(0, sz) == s.substr(sz, sz)) { cout << size - i << endl; return 0; } } ...
a.cc:20:2: error: stray '#' in program 20 | }#include <bits/stdc++.h> | ^ a.cc:20:3: error: 'include' does not name a type 20 | }#include <bits/stdc++.h> | ^~~~~~~ a.cc:24:5: error: redefinition of 'int main()' 24 | int main(void) { | ^~~~ a.cc:5:5: note: 'int main()' previously define...
s164511526
p03672
C++
#include <iostream> using namespace std; int main() { char str[222]; cin >> str; int n = strlen(str); for (int i = n - 2; i; i -= 2) { if (strncmp(str, str + i / 2, i / 2) == 0) { cout << i << endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: 'strlen' was not declared in this scope 9 | int n = strlen(str); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <c...
s028696770
p03672
C++
#include <iostream> using namespace std; int main() { char str[222]; cin >> str; int n = strlen(str); for (int i = n - 2; i; i -= 2) { if (strncmp(str, str + i / 2, i / 2) == 0) { cout << i << endl; break; } } return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: 'strlen' was not declared in this scope 9 | int n = strlen(str); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <c...
s240192850
p03672
C++
#include <iostream> using namespace std; int main() { char str[222]; cin >> str; int n = strlen(str); for (int i = n - 2; i; i -= 2) { if (strncmp(str, str + i / 2, i / 2) == 0) { cout << i << endl; break; } } return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: 'strlen' was not declared in this scope 9 | int n = strlen(str); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <c...
s609601057
p03672
C++
a, b, c = [int(i) for i in input().split()] if a > b: a, b = b, a if b > c: b, c = c, b if a > b: a, b = b, a print(a+b)
a.cc:1:1: error: 'a' does not name a type 1 | a, b, c = [int(i) for i in input().split()] | ^
s077048176
p03672
C++
#include <iostream> #include <algorithm> #include <string> using namespace std; int main() { int a,b,c; int i,j,k,n; string s; cin>>s; int panjang=s.length()-1; int jumlah=1; for (i=0;i<=199;i++) { string potong; potong=s; potong.erase(panjang-i,jumlah;) if (potong.length()%2==0) { int panjangpoto...
a.cc: In function 'int main()': a.cc:17:46: error: expected ')' before ';' token 17 | potong.erase(panjang-i,jumlah;) | ~ ^ | ) a.cc:17:47: error: expected primary-expression before ')' token 17 | ...
s427902220
p03672
C++
#include <string> using namespace std; int main(void){ string S; int ans = 0; cin >> S; while(!S.empty()){ S.pop_back(); S.pop_back(); int half_size = S.size()/2; // cout <<"half_size:"<< half_size << endl; for(int i=0;i<half_size;++i){ // cout << S[i] << ' ' << S[half_size + i] << endl; if(S[i] ...
a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope 6 | cin >> S; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <string> +++ |+#include <iostream> 2 | using n...
s698203286
p03672
C++
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int,int> pii; typedef pair<int,string> pis; double pi=3.1415926535898; #define speed ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL); #define lop(i,n) for(int i=0;i<in...
a.cc: In function 'int main()': a.cc:43:15: error: 'breake' was not declared in this scope 43 | if ( ok ) breake; | ^~~~~~
s318005930
p03672
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; cin>>s; s=s.substr(0,s.size()-1); int len; for(len=s.size()/2;len>=0;len--){ if(s.substr(0,len) == s.substr(len,len)){ break; } } cout<< len * 2<,endl; return 0; }
a.cc: In function 'int main()': a.cc:15:17: error: expected primary-expression before ',' token 15 | cout<< len * 2<,endl; | ^
s838960379
p03672
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; cin>>s; s=s.substr(0,s.size()-1); int len for(len=s.size()/2;len>=0;len--){ if(s.substr(0,len) == s.substr(len,len)){ break; } } cout<< len * 2<,endl; return 0; }
a.cc: In function 'int main()': a.cc:10:2: error: expected initializer before 'for' 10 | for(len=s.size()/2;len>=0;len--){ | ^~~ a.cc:10:21: error: 'len' was not declared in this scope; did you mean 'mblen'? 10 | for(len=s.size()/2;len>=0;len--){ | ^~~ | ...
s374541686
p03672
C
#include<stdio.h> #include<string.h> int main(){ int len,n,sp=1,s=0; char in[201]; scanf("%s",in); while(1){ len = strlen(in); len--; in[len] = '\0'; if(len%2 == 1){ len--; in[len] = '\0'; } for(i=0;i<len/2;i++){ if(in[i] != in[i+len/2]){ break; } if(i == len/2 - 1){ printf(...
main.c: In function 'main': main.c:19:21: error: 'i' undeclared (first use in this function); did you mean 'in'? 19 | for(i=0;i<len/2;i++){ | ^ | in main.c:19:21: note: each undeclared identifier is reported only once for each function it appears in...
s169280796
p03672
C
#include<stdio.h> #include<string.h> int main(){ int len,n,sp=1,s=0; char in[201]; scanf("%s",in) while(1){ len = strlen(in); len--; in[len] = '\0'; if(len%2 == 1){ len--; in[len] = '\0'; } for(i=0;i<len/2;i++){ if(in[i] != in[i+len/2]){ break; } if(i == len/2 - 1){ printf("...
main.c: In function 'main': main.c:8:23: error: expected ';' before 'while' 8 | scanf("%s",in) | ^ | ; 9 | 10 | while(1){ | ~~~~~
s345071524
p03672
C
#include<stdio.h> #include<strlib.h> int main(){ int len,n,sp=1,s=0; char in[201]; scanf("%s",in) while(1){ len = strlen(in); len--; in[len] = '\0'; if(len%2 == 1){ len--; in[len] = '\0'; } for(i=0;i<len/2;i++){ if(in[i] != in[i+len/2]){ break; } if(i == len/2 - 1){ printf("...
main.c:2:9: fatal error: strlib.h: No such file or directory 2 | #include<strlib.h> | ^~~~~~~~~~ compilation terminated.
s402256553
p03672
C++
#include <cstdlib> #include <iostream> #include <queue> #include <vector> #include <cmath> #include <string> using namespace std; typedef unsigned long long u64; typedef signed long long l64; u64 over = 1000000007; int main(void) { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int n = s.size()...
a.cc: In function 'int main()': a.cc:20:5: error: 'is' was not declared in this scope; did you mean 'i'? 20 | is (s.substr(0, i) == s.substr(i, i)) { | ^~ | i
s423017677
p03672
C++
#include <iostream> #include <algorithm> #include <cmath> #include <string> #include <array> #include <vector> #include <functional> #include <unordered_map> #include <map> #include <numeric> #include <limits> #include <utility> #include <queue> using namespace std; typedef long long LL; int main(void) { string s;...
a.cc: In function 'int main()': a.cc:34:2: error: expected '}' at end of input 34 | } | ^ a.cc:17:16: note: to match this '{' 17 | int main(void) { | ^
s739298625
p03672
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int main(){ string s,a,b; cin>>s; int i =1; if(s.size()%2==0){} i++; else i+=2; for(;i<s.size();i+=2){ for(int j=0;j<(s.size()-i)/2;j++) a[j]=s[j]; for(int j=(s.size()-i)/2;j<s.size()-i;j++) b[j-(s.size()-i)/2]=s[j]; if(a==b){ cout<<s.size()...
a.cc: In function 'int main()': a.cc:13:1: error: 'else' without a previous 'if' 13 | else | ^~~~
s606464846
p03672
C++
#include <iostream> #include<string> using namespace std; int main(void){ string s,a="",b="",str=""; cin>>s; for(int i=0;;i++){ for(int j=0;j<s.size();j++){ s[s.size()-1-j]=''; for(int l=0;l<s.size()/2;l++){ a=a+str[l]; } for(int l=s.siz...
a.cc:9:28: error: empty character constant 9 | s[s.size()-1-j]=''; | ^~
s776278675
p03672
Java
import java.util.Scanner; public class Main { public static void main(String args[]){ //B問題 Scanner scan = new Scanner(System.in); //文字列格納用 String S; S = scan.next(); while(S.length() >= 2){ //1文字削除 if(S != null && S.length() > 0){ S = S.sub...
Main.java:30: error: reached end of file while parsing } ^ 1 error
s946935888
p03672
Java
import java.util.Scanner; public class Main { public static void main(String args[]){ //B問題 Scanner scan = new Scanner(System.in); //文字列格納用 String S; S = scan.next(); while(S.length() >= 2){ //1文字削除 if(S != null && S.length() > 0){ S = S.sub...
Main.java:32: error: reached end of file while parsing } ^ 1 error
s364303137
p03672
Java
package atcoder0701; import java.util.Scanner; public class main { public static void main(String args[]){ //B問題 Scanner scan = new Scanner(System.in); //文字列格納用 String S; S = scan.next(); while(S.length() >= 2){ //1文字削除 if(S != null && S.length() > 0){ ...
Main.java:5: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s606532557
p03672
Java
import java.util.Scanner; public class Main { public static void main(String args[]){ //B問題 Scanner scan = new Scanner(System.in); //文字列格納用 String S; S = scan.next(); while(S.length() >= 2){ //1文字削除 if(S != null && S.length() > 0){ S = S.substring(...
Main.java:31: error: reached end of file while parsing } ^ 1 error
s343010918
p03672
C++
#include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; char s[205], t1[205], t2[205]; int main() { gets(s); int len = strlen(s); int w = len; for (int j = 1; j <= 200; j++){ int tot = -1; for (int i = 0; i <= (len - 3) / 2; i++) t1[i] = s[i]; for (int i = (len - 3) /...
a.cc: In function 'int main()': a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(s); | ^~~~ | getw
s781753839
p03672
C++
#include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; char s[205], t1[205], t2[205]; int main() { gets(s); int len = strlen(s); int w = len; for (int j = 1; j <= 200; j++){ int tot = -1; for (int i = 0; i <= (len - 3) / 2; i++) t1[i] = s[i]; for (int i = (len - 3) /...
a.cc: In function 'int main()': a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(s); | ^~~~ | getw
s177743806
p03672
C++
#include <string> #include <iostream> using namespace std; bool iseven(string& str) { if (str.length() % 2 != 0)return false; else { if (string(str.begin(), str.begin() + str.length() / 2) == string(str.begin() + str.length() / 2, str.end())) return true; else return false; } } int main(void) { string str...
a.cc: In function 'int main()': a.cc:24:36: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'} 24 | if (iseven(string(str.begin() + j, str.begin() + j + i)))...
s079643218
p03672
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int main(){ string s,a,b; cin>>s; for(int i =0;i<s.size();i+=2){ if(s.size()%2==1) i++; for(int j=0;j<(s.size()-i)/2;j++) a[j]=s[j]; for(int j=(s.size()-i)/2;j<s.size())-i;j++) b[j]=s[j]; if(a==b){ cout<<s.size()<<endl; break; } } return 0; ...
a.cc: In function 'int main()': a.cc:15:36: error: expected ';' before ')' token 15 | for(int j=(s.size()-i)/2;j<s.size())-i;j++) | ^ | ; a.cc:15:40: error: 'j' was not declared in this scope 15 | for(int j=(s.size()-i)/2;j<s.size()...
s740374332
p03672
C++
We will call a string that can be obtained by concatenating two equal strings an even string. For example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not. You are given an even string S consisting of lowercase English letters. Find the length of the longest even string that can be obtained by deleting one ...
a.cc:6:1: error: extended character ≤ is not valid in an identifier 6 | 2≤|S|≤200 | ^ a.cc:6:6: error: extended character ≤ is not valid in an identifier 6 | 2≤|S|≤200 | ^ a.cc:1:1: error: 'We' does not name a type 1 | We will call a string that can be obtained by concatenating two equal st...
s476839829
p03672
Java
import java.util.Scanner; public class SS{ public static void Main(String[] args){ Scanner sc = new Scanner(System.in); String str = sc.nextLine(); sc.close(); for(int i = 1; i < str.length(); i++) { if(isEven(str.substring(0, str.length()-i))) { System.out.println(str.length() - i); break; ...
Main.java:3: error: class SS is public, should be declared in a file named SS.java public class SS{ ^ 1 error
s540013017
p03672
C++
#include<stdio.h> #include<string.h> int main () { char s[250]; while(gets(s)) { int i,len,n; len=strlen(s); n=len/2-1; while(n) { int k=0; for(i=0;i<n;i++) if(s[i]!=s[i+n]) k++; n--; if(k==0){ printf("%d\n",n*2-2); break; } } } }
a.cc: In function 'int main()': a.cc:6:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | while(gets(s)) | ^~~~ | getw
s135967834
p03672
C++
#include<stdio.h> #include<string.h> char s[250]; int main () { while(scanf("%s",s)!=EOF) { int i,len,n,; len=strlen(s); n=len/2-1; while(n) { int k=0; for(i=0;i<n;i++) if(s[i]!=s[i+n]) k++; n--; if(k==0){ printf("%d\n",n*2+2); break; } } } }
a.cc: In function 'int main()': a.cc:8:29: error: expected unqualified-id before ';' token 8 | int i,len,n,; | ^
s889114609
p03672
C++
#include<stdio.h> #include<string.h> int main () { char s[250]; while(scanf("%s",s)!=EOF) { int i,len,n,; len=strlen(s); n=len/2-1; while(n) { int k=0; for(i=0;i<n;i++) if(s[i]!=s[i+n]) k++; n--; if(k==0){ printf("%d\n",n*2+2); break; } } } }
a.cc: In function 'int main()': a.cc:8:29: error: expected unqualified-id before ';' token 8 | int i,len,n,; | ^
s790141931
p03672
C++
#include<stdio.h> #include<string.h> int main () { char s[250]; while(gets(s)) { int i,len,n,; len=strlen(s); n=len/2-1; while(n) { int k=0; for(i=0;i<n;i++) if(s[i]!=s[i+n]) k++; n--; if(k==0){ printf("%d\n",n*2+2); break; } } } }
a.cc: In function 'int main()': a.cc:6:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | while(gets(s)) | ^~~~ | getw a.cc:8:29: error: expected unqualified-id before ';' token 8 | int i,len,n,; | ...
s271723892
p03672
Java
import java.util.Scanner; public class B { private static boolean is_even(String s) { if (0 == s.length() % 2) { return true; } else { return false; } } private static boolean is_even_string(String s) { int length = s.length(); if (s.substring(0, length / 2).equals(s.substrin...
Main.java:3: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s011448028
p03672
C++
#include<stdio.h> #include<string.h> int main () { char s[250]; while(gets(s)) { int i,len,n,; len=strlen(s); n=len/2-1; while(n) { int k=0; for(i=0;i<n;i++) if(s[i]!=s[i+n]) k++; n--; if(k==0){ printf("%d\n",n*2+2); break; } } } }
a.cc: In function 'int main()': a.cc:6:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | while(gets(s)) | ^~~~ | getw a.cc:8:29: error: expected unqualified-id before ';' token 8 | int i,len,n,; | ...
s231251228
p03672
C
#define _CRT_SECURE_NO_WARNINGS //#define DEBUG #include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> //後ろから2文字ずつ削って判定してく関数 //配列をポインタで渡す場合長さも渡しておく int mojikezuri(char* str, int length) { int flag = 0; int l2=length/2; char str1[101]; char str2[101]; int i; int ans; strcpy(str1, str, l2); st...
main.c: In function 'mojikezuri': main.c:18:9: error: too many arguments to function 'strcpy' 18 | strcpy(str1, str, l2); | ^~~~~~ In file included from main.c:4: /usr/include/string.h:141:14: note: declared here 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src...
s612305050
p03672
C++
#include <iostream> #include<string> using namespace std; int main(void){ string s,a,b; cin>>s; for(int i=0;;i++){ for(int j=0;j<s.size();j++){ s=s-s[s.size()-j-1]; for(int l=0;l<s.size()/2;l++){ a=a+a[l]; } for(int l=s.size()/2;l<s.siz...
a.cc: In function 'int main()': a.cc:9:16: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}) 9 | s=s-s[s.size()-j-1]; In file included from /usr/include/c++/14/st...
s086801612
p03672
C
#include <stdio.h> #include <string.h> #include <stdlib.h> int Main(void){ int i=0,j,k,count=0,s=0; char list[200][200]; while(scanf("%s",list[i])!=EOF){ i++; if(i==1) break; } for (k = strlen(list[0])-1; k>1; k--) { s=0; if(k%2==0) { for(j=0;j<k/2;j++){ if(list[0][j]!=list[0][j+k/2]) s=1; ...
/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
s470739360
p03672
C++
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int main (){ char s[300] = {0}; int ans = 0; int i,j; scanf("%s",s); ans = strlen(s); while(1){ ans -= 2; j = ans / 2; int z = ans /2; for(i=0;i<j;i++){ if(s[i] != s[...
a.cc: In function 'int main()': a.cc:13:11: error: 'strlen' was not declared in this scope 13 | ans = strlen(s); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> ...
s335366090
p03672
C++
#include <iostream> #include <numeric> #include <algorithm> #include <string> int main(void) { std::string S; std::cin >> S; std::vector<std::string> checker; size_t pos = 0; for(size_t i = 2, end = S.size(); i < end; i+=2, pos+=1){ checker.push_back(S.substr(0, i)); } for(auto it = checker.rbegin...
a.cc: In function 'int main()': a.cc:11:8: error: 'vector' is not a member of 'std' 11 | std::vector<std::string> checker; | ^~~~~~ a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 3 | #include <algorithm> +++ |+#include <vecto...
s920151757
p03672
C++
s = input() s = s[:len(s) - 1] if len(s) % 2 != 0: s = s[:len(s) - 1] while True: mid = int(len(s) / 2) if s[:mid] == s[mid:]: print(len(s)) break else: s = s[:len(s) - 1]
a.cc:1:1: error: 's' does not name a type 1 | s = input() | ^
s611727582
p03672
C
#include<stdio.h> #include<stdlib.h> #include<string.h> int main() { char s[201]; scanf("%s",s); int len=strlen(s); int i,j; for(i=1;i<len/2;i++){ int k=len-i*2; int count=0; for(j=0;j<k/2;j++){ if(s[j]==s[j+k/2])count++; } if(count==k/2){ printf("%d\n",count*2); break; } } return 0;
main.c: In function 'main': main.c:24:9: error: expected declaration or statement at end of input 24 | return 0; | ^~~~~~
s076340814
p03672
C++
#include<stdio.h> #include<stdlib.h> #include<string.h> int main() { char s[201]; scanf("%s",s); int len=strlen(s); int i,j; for(i=1;i<len/2;i++){ int k=len-i*2; int count=0; for(j=0;j<k/2;j++){ if(s[j]==s[j+k/2])count++; } if(count==k/2){ printf("%d\n",count*2); break; } } return 0;
a.cc: In function 'int main()': a.cc:24:18: error: expected '}' at end of input 24 | return 0; | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s248945815
p03672
C++
#include<iostream> #include<vector#include<string> using namespace std; int main(){ string s; cin >> s; int n = s.size() - 2; for(int i=0; i<n/2; i++){ if(s[i]!=s[i+n/2]){ n -= 2; } else { cout << n << endl; break; } } return 0; }
a.cc:2:9: fatal error: vector#include<string: No such file or directory 2 | #include<vector#include<string> | ^~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s137127922
p03672
C++
#include <iostream> #include <string> using namespace std; int main(int argc, char* argv[]) { char p[201]; string S; cin>>S; int SLen=S.size(); char *pStr=(char*)S.c_str(); string s; int i=0; int maxNum=0; int maxLen=0; for (int len=1;len<=SLen;len++){ memset(p,0,201); strncpy(p,pStr,len); int num=0; ...
a.cc: In function 'int main(int, char**)': a.cc:17:17: error: 'memset' was not declared in this scope 17 | memset(p,0,201); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +...
s567649402
p03672
C++
#include <vector> #include <algorithm> #include <cmath> using namespace std; typedef long long ll; int main() { string s; cin >> s; int sz = s.size(); int ans = 0; for(int i=sz-2;i>=0;i-=2) { int c = i/2; bool ok = true;; for(int j=0;j<c;j++) { if(s[j] != s[j+c]...
a.cc: In function 'int main()': a.cc:9:5: error: 'string' was not declared in this scope 9 | string s; | ^~~~~~ a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' 3 | #include <cmath> +++ |+#include <string> 4 | a.cc:10:5: e...
s495149564
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { char s[200]; gets(s); int len = strlen(s); for(int i=(len-2)/2;i>0;--i) { int x = 0; for(int j=0;j<i;++j) { if(s[j] == s[j+i]) x++; } if(x==i) { cout<<2*i<<endl; ...
a.cc: In function 'int main()': a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(s); | ^~~~ | getw
s881383049
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { char s[200]; gets(s); int len = strlen(s); for(int i=(len-2)/2;i>0;--i) { int x = 0; for(int j=0;j<i;++j) { if(s[j] == s[j+i]) x++; } if(x==i) { cout<<2*i<<endl; ...
a.cc: In function 'int main()': a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(s); | ^~~~ | getw
s942803615
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { char s[200]; gets(s); int len = strlen(s); for(int i=(len-2)/2;i>0;--i) { int x = 0; for(int j=0;j<i;++j) { if(s[j] == s[j+i]) x++; } if(x==i) { cout<<2*i<<endl; ...
a.cc: In function 'int main()': a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(s); | ^~~~ | getw
s894281457
p03672
C++
h#include <bits/stdc++.h> using namespace std; int main(void){ string s; cin >> s; char c[201] = {'\0'}; bool sw = false; s.copy(c, s.size()); for(int i = s.size() - 2; i > 0; i--){ if(i %2 == 0) continue; for (int j = 0; j <= i / 2; j++){ if(c[j] != c[i / 2 + 1 + j]) break; if (j == ...
a.cc:1:2: error: stray '#' in program 1 | h#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'h' does not name a type 1 | h#include <bits/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:6:3: error: 'string' was not declared in this scope 6 | string s; | ^~~~~~ a.cc:7:3: error: 'cin' wa...
s664738960
p03672
C
akasakaakasakasakaakas
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input 2 | akasakaakasakasakaakas | ^~~~~~~~~~~~~~~~~~~~~~
s811477844
p03672
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; cout<<s.len()<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'len' 6 | cout<<s.len()<<endl; | ^~~
s330965639
p03673
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] a = new int[N]; for(int i=0; i<N; i++){ a[i] = sc.nextInt(); } for(int i=N-1;i>=0...
Main.java:17: error: cannot find symbol for(int j=n%2;j<N;j+=2){ ^ symbol: variable n location: class Main 1 error
s611503440
p03673
C++
#include<iostream> #include<vector> using namespace std; int main(){ int n,m; cin>>n; vector<int>a(); for(int i=0;i<n;i++){ cin>>m; a.push_back(m); reverse(a.begin(),a.end()); } for(int i=0;i<a.size();i++)cout<<a[i]<<" "; return 0; }
a.cc: In function 'int main()': a.cc:7:17: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 7 | vector<int>a(); | ^~ a.cc:10:11: error: request for member 'push_back' in 'a', which is of non-class type 'std::vector<int>()' 10 | a.push_back...
s621627583
p03673
C++
#include<iostream> #include<vector> using namespace std; int main(){ int n,m; cin>>n; vector<int>a(0); for(int i=0;i<n;i++){ cin>>m; a.push_back(m); reverse(a.begin(),a.end()); } for(int i=0;i<a.size();i++)cout<<a[i]<<" "; return 0; }
a.cc: In function 'int main()': a.cc:11:9: error: 'reverse' was not declared in this scope 11 | reverse(a.begin(),a.end()); | ^~~~~~~
s167088267
p03673
C++
#include<bits\stdc++.h> using namespace std; typedef long long ll; const int Max=1e5+5; const int Mod=1e9+7; int lst[Max]; int main() { int n; cin>>n; for(int i=1;i<=n;i++) { scanf("%d",&lst[i]); reverse(lst+1,lst+i+1); } for(int i=1;i<=n;i++) { printf("%d ",lst[i]); } }
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory 1 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s039983427
p03673
C++
#include <bits/stdc++.h> using namespace std;
/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
s240816191
p03673
C++
#include <iostream> #include <deque> #include <string> using namespace std; typedef false LEFT; typedef true RIGHT; int main() { long long n; cin >> n; long long a[n] = {0}; for (int i = 0; i < n; i++) { cin >> a[i]; } deque<long long> b; bool insert; if (n % 2 == 0) { //start insert from lef...
a.cc:7:9: error: expected unqualified-id before 'false' 7 | typedef false LEFT; | ^~~~~ a.cc:8:9: error: expected unqualified-id before 'true' 8 | typedef true RIGHT; | ^~~~ a.cc: In function 'int main()': a.cc:21:14: error: 'LEFT' was not declared in this scope 21 | insert = ...
s594277067
p03673
C++
n = int(input()) a = list(map(int, input().split())) pushpush = [] for i in range(n): if (i%2 == (n-1)%2): pushpush.insert(0, a[i]) else: pushpush.append(a[i]) print(*pushpush)
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s988284468
p03673
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int n = scn.nextInt(); String[] a = new String[n]; for(int i=0; i<a.length; i++){ a[i] = scn.next(); } ArrayList<String> list = new ArrayList<>(); for(int i...
Main.java:14: error: cannot find symbol Collection.reverse(list); ^ symbol: method reverse(ArrayList<String>) location: interface Collection 1 error
s308930483
p03673
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int n = scn.nextInt(); String[] a = new String[n]; for(int i=0; i<a.length; i++){ a[i] = scn.next(); } ArrayList<string> list = new ArrayList<>(); for(int i...
Main.java:11: error: cannot find symbol ArrayList<string> list = new ArrayList<>(); ^ symbol: class string location: class Main 1 error
s826526470
p03673
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, c) for (int i = 0; i < (int)c; i++) int main() { int n; scanf("%d", &n); vector<ll> a(n); rep(i, n) scanf("%lld", &a[i]); deque<ll> ans; int temp = 1; if(n % 2) temp = 0; //nが奇数なら0、偶数なら1 rep(i, n) { if(i % 2 == temp) an...
a.cc: In function 'int main()': a.cc:7:12: error: 'll' was not declared in this scope 7 | vector<ll> a(n); | ^~ a.cc:7:14: error: template argument 1 is invalid 7 | vector<ll> a(n); | ^ a.cc:7:14: error: template argument 2 is invalid a.cc:8:31: error: invalid types '...
s043627370
p03673
C++
#include <iostream> #include <iomanip> #include <string> #include <stack> #include <vector> #include <complex> #include <math.h> #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <iterator> #include <map> #include <set> #include <queue> #include <list> #include <regex> #include <...
a.cc:176:9: warning: "rrep" redefined 176 | #define rrep(i,n) for(int i=n-1;i>=0;i--) | ^~~~ a.cc:36:9: note: this is the location of the previous definition 36 | #define rrep(i,n) for(ll i=n-1;i>=0;i--) | ^~~~ a.cc:177:9: warning: "rRep" redefined 177 | #define rRep(i,a,b) for(int i=...
s116743710
p03673
C++
#include <bits/stdc++.h> #include <math.h> #define ALL(a) a.begin(), a.end() #define rep(i, K, N) for(int i = K; i < N; i++) #define ll long long int using namespace std; int main() { ll N, A;cin >> N; vector<ll> B; rep(i, 0, N){ cin >> A; if(i%2 == 0)B.push_back(A); else B.insert(B.begin(), A); } if(N%2 != ...
a.cc: In function 'int main()': a.cc:21:28: error: expected ';' before ':' token 21 | if(N%2 != 0)reverse(ALL(B)): | ^ | ; a.cc:23:5: error: 'i' was not declared in this scope 23 | rep(i, 0, B.size())cout << B[i] << " "; | ^ a.cc:4:38: no...
s685938724
p03673
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; veector<int> vec (n); for(int i=0;i<n;++i) cin>>vec[i]; vector<int> kara(0); for(int i=0;i<n;++i){ kara.push_back(vec[i]); reverse(kara.begin(),kara.end()); } for(int i=0;i<n;++i){ cout<<kara[i]; if(i+1==0) break; ...
a.cc: In function 'int main()': a.cc:7:3: error: 'veector' was not declared in this scope 7 | veector<int> vec (n); | ^~~~~~~ a.cc:7:11: error: expected primary-expression before 'int' 7 | veector<int> vec (n); | ^~~ a.cc:8:29: error: 'vec' was not declared in this scope 8 | fo...
s204837524
p03673
C++
#intclude <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; veector<int> vec (n); for(int i=0;i<n;++i) cin>>vec[i]; vector<int> kara(0); for(int i=0;i<n;++i){ kara.push_back(vec[i]); reverse(kara.begin(),kara.end()); } for(int i=0;i<n;++i){ cout<<kara[i]; if(i+1==0) break;...
a.cc:1:2: error: invalid preprocessing directive #intclude; did you mean #include? 1 | #intclude <bits/stdc++.h> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin>>n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<...
s032405130
p03673
Java
import java.io.*; import java.math.*; import java.util.*; public class PushPush { public static void main(String[] args) { //Ball out dawg FastScanner I = new FastScanner(); //Input OutPut O = new OutPut(); //Output int N =I.nextInt(); long[] a = new long[N]; for (int i = 0; i < N; i++) a[i] =I.nextLong...
Main.java:4: error: class PushPush is public, should be declared in a file named PushPush.java public class PushPush { ^ 1 error
s177105891
p03673
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { long long n; cin >> n; vector<long long> res; for (long long i=0;i<n;i++) { long long a; cin >> a; res.push_back(a); sort(res.end(), res.begin()); } for (long long i=0;i<n-1;i++) {...
a.cc: In function 'int main()': a.cc:20:18: error: expected ']' at end of input 20 | cout << res[n-1 | ^ | ] a.cc:20:18: error: expected ';' at end of input 20 | cout << res[n-1 | ^ | ; a.cc:20:18: error: expected '}' ...