submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s091364695
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int res = 0; while (true) { string a, b; s.erase(s.begin() + s.size() - 1); res++; if (s.size() % 2 != 0) continue; a = s.substr(0, s.size() / 2); b = s.substr(s.size() / 2, s.size()); if (a == b) { break; } } printf(s.size()); return 0; }
a.cc: In function 'int main()': a.cc:21:16: error: invalid conversion from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'const char*' [-fpermissive] 21 | printf(s.size()); | ~~~~~~^~ | | | std::__cxx11::basic_string<char>::size_type {aka long unsigned int} In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, 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, from a.cc:1: /usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)' 363 | extern int printf (const char *__restrict __format, ...); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
s244617534
p03672
C++
#include <bits/stdc++.h> using namespace std; signed main() { string s; cin >> s; int res = 0; while (true) { string a, b; s.erase(s.begin() + s.size() - 1); res++; if (s.size() % 2 != 0) continue; a = s.substr(0, s.size() / 2); b = s.substr(s.size() / 2, s.size()); if (a == b) { break; } } print(s.size()); }
a.cc: In function 'int main()': a.cc:21:3: error: 'print' was not declared in this scope; did you mean 'rint'? 21 | print(s.size()); | ^~~~~ | rint
s059714773
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans =0 ; for(int i = 0 ;i<= (s.size()-1)/2; i++){ bool a = true; for ( int j = i+1 ; j<= s.size()-1 ;j++){ if ( s.at(j)!=a.at(j+i)){ a = false; break ; } } if(!a){ break; }else if(a){ ans = i; } } cout << ans*2 << endl; }
a.cc: In function 'int main()': a.cc:11:23: error: request for member 'at' in 'a', which is of non-class type 'bool' 11 | if ( s.at(j)!=a.at(j+i)){ | ^~
s667400079
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans =0 ; for(int i = 0 ;i<= (s.size()-1)/2; i++){ bool a = true; for ( int j = i+1 ; j<= (s.size()-1)/2 ;j++){ if ( s.at(j)!=a.at(j+i)){ a = false; break ; } } if(!a){ break; }else if(a){ ans = i; } } cout << ans*2 << endl; }
a.cc: In function 'int main()': a.cc:11:23: error: request for member 'at' in 'a', which is of non-class type 'bool' 11 | if ( s.at(j)!=a.at(j+i)){ | ^~
s160734661
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans =0 ; for(int i = 0 ;i< (s.size()-1)/2; i++){ bool a = true; for ( int j = i ; j<i< (s.size()-1)/2 ;j++){ if ( s.at(j)!=a.at(j+i)){ a = false; break ; } } if(!a){ break; }else if(a){ ans = i; } } cout << ans*2 << endl; }
a.cc: In function 'int main()': a.cc:11:23: error: request for member 'at' in 'a', which is of non-class type 'bool' 11 | if ( s.at(j)!=a.at(j+i)){ | ^~
s280111476
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans =0 for(int i = 0 ;i< (s.size()-1)/2; i++){ bool a = true; for ( int j = i ; j<i< (s.size()-1)/2 ;j++){ if ( s.at(j)!=a.at(j+i)){ a = false; break ; } } if(!a){ break; }else if(a){ ans = i; } } cout << ans*2 << endl; }
a.cc: In function 'int main()': a.cc:8:3: error: expected ',' or ';' before 'for' 8 | for(int i = 0 ;i< (s.size()-1)/2; i++){ | ^~~ a.cc:8:18: error: 'i' was not declared in this scope 8 | for(int i = 0 ;i< (s.size()-1)/2; i++){ | ^
s038321130
p03672
C++
#include <bits/stdc++.h> using namespace std; #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数 int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数 int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗 int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗 int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和 int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和? int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和 //以下long long ver long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llnHr(long long a,long long b){return llnCr(a+b-1,b);} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;} long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;} long long llsankaku(long long x){return ((1+x)*x)/2;} //double double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} typedef pair<int, int> ii; typedef long long ll; typedef vector<ll> vll; typedef pair<ll,ll> pll; #define forr(i,a,b) for(int i=(a); i<(b); i++) #define clean(arr,val) memset(arr,val,sizeof(arr)) #define forn(i,n) forr(i,0,n) #define PB push_back typedef vector<int> vi; typedef vector<ii> vii; typedef vector<pll> vpll; /*CODE START HERE*/ int main() { string s; cin >> s; int ans =0 forn(i,(s.size()-1)/2){ bool a = true; forn ( j ,i){ if ( s.at(j)!=a.at(j+i)){ a = false; break ; } } if(!a){ break; }else if(a){ ans = i; } } cout << ans*2 << endl; }
a.cc: In function 'int main()': a.cc:47:21: error: expected ',' or ';' before 'for' 47 | #define forr(i,a,b) for(int i=(a); i<(b); i++) | ^~~ a.cc:49:19: note: in expansion of macro 'forr' 49 | #define forn(i,n) forr(i,0,n) | ^~~~ a.cc:60:3: note: in expansion of macro 'forn' 60 | forn(i,(s.size()-1)/2){ | ^~~~ a.cc:60:8: error: 'i' was not declared in this scope 60 | forn(i,(s.size()-1)/2){ | ^ a.cc:47:36: note: in definition of macro 'forr' 47 | #define forr(i,a,b) for(int i=(a); i<(b); i++) | ^ a.cc:60:3: note: in expansion of macro 'forn' 60 | forn(i,(s.size()-1)/2){ | ^~~~
s141911302
p03672
C++
#include <bits/stdc++.h> using namespace std; #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数 int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数 int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗 int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗 int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和 int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和? int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和 //以下long long ver long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llnHr(long long a,long long b){return llnCr(a+b-1,b);} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;} long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;} long long llsankaku(long long x){return ((1+x)*x)/2;} //double double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} typedef pair<int, int> ii; typedef long long ll; typedef vector<ll> vll; typedef pair<ll,ll> pll; #define forr(i,a,b) for(int i=(a); i<(b); i++) #define clean(arr,val) memset(arr,val,sizeof(arr)) #define forn(i,n) forr(i,0,n) #define PB push_back typedef vector<int> vi; typedef vector<ii> vii; typedef vector<pll> vpll; /*CODE START HERE*/ int main() { string s; cin >> s; int ans =0 forn(i,(s.size()-1)/2){ bool a = true; forn ( j ,i){ if ( s.at(j)!=a.at(j+i)){ a = false; break ; } if(!a){ break; }else if(a){ ans = i; } } cout << ans*2 << endl; }
a.cc: In function 'int main()': a.cc:47:21: error: expected ',' or ';' before 'for' 47 | #define forr(i,a,b) for(int i=(a); i<(b); i++) | ^~~ a.cc:49:19: note: in expansion of macro 'forr' 49 | #define forn(i,n) forr(i,0,n) | ^~~~ a.cc:60:3: note: in expansion of macro 'forn' 60 | forn(i,(s.size()-1)/2){ | ^~~~ a.cc:60:8: error: 'i' was not declared in this scope 60 | forn(i,(s.size()-1)/2){ | ^ a.cc:47:36: note: in definition of macro 'forr' 47 | #define forr(i,a,b) for(int i=(a); i<(b); i++) | ^ a.cc:60:3: note: in expansion of macro 'forn' 60 | forn(i,(s.size()-1)/2){ | ^~~~ a.cc:74:6: error: expected '}' at end of input 74 | } | ^ a.cc:56:12: note: to match this '{' 56 | int main() { | ^
s814257124
p03672
C++
#include <bits/stdc++.h> using namespace std; #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数 int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数 int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗 int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗 int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和 int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和? int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和 //以下long long ver long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llnHr(long long a,long long b){return llnCr(a+b-1,b);} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;} long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;} long long llsankaku(long long x){return ((1+x)*x)/2;} //double double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} typedef pair<int, int> ii; typedef long long ll; typedef vector<ll> vll; typedef pair<ll,ll> pll; #define forr(i,a,b) for(int i=(a); i<(b); i++) #define clean(arr,val) memset(arr,val,sizeof(arr)) #define forn(i,n) forr(i,0,n) #define PB push_back typedef vector<int> vi; typedef vector<ii> vii; typedef vector<pll> vpll; /*CODE START HERE*/ int main() { string s; cin >> s; int ans =0 forn(i,(s,size()-1)/2){ bool a = true; forn ( j ,i){ if ( s.at(j)!=a.at(j+i)){ a = false; break ; } if(!a){ break; }else if(a){ ans = i; } } cout << ans*2 << endl; }
a.cc: In function 'int main()': a.cc:47:21: error: expected ',' or ';' before 'for' 47 | #define forr(i,a,b) for(int i=(a); i<(b); i++) | ^~~ a.cc:49:19: note: in expansion of macro 'forr' 49 | #define forn(i,n) forr(i,0,n) | ^~~~ a.cc:60:3: note: in expansion of macro 'forn' 60 | forn(i,(s,size()-1)/2){ | ^~~~ a.cc:60:8: error: 'i' was not declared in this scope 60 | forn(i,(s,size()-1)/2){ | ^ a.cc:47:36: note: in definition of macro 'forr' 47 | #define forr(i,a,b) for(int i=(a); i<(b); i++) | ^ a.cc:60:3: note: in expansion of macro 'forn' 60 | forn(i,(s,size()-1)/2){ | ^~~~ a.cc:60:17: error: no matching function for call to 'size()' 60 | forn(i,(s,size()-1)/2){ | ~~~~^~ a.cc:47:39: note: in definition of macro 'forr' 47 | #define forr(i,a,b) for(int i=(a); i<(b); i++) | ^ a.cc:60:3: note: in expansion of macro 'forn' 60 | forn(i,(s,size()-1)/2){ | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/range_access.h:262:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:272:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidate expects 1 argument, 0 provided a.cc:74:6: error: expected '}' at end of input 74 | } | ^ a.cc:56:12: note: to match this '{' 56 | int main() { | ^
s366337589
p03672
C++
#include <bits/stdc++.h> using namespace std; bool A(string S){ for(int i=0;i<S.size/2;i++){ if(S.at(i)!=S.at(i+S.size()/2)){ return 1; } } return 0; } int main(){ string N;cin<<N; if(N.size()%2){ N.pop_back(); } while(A(N)){ N.pop_back(); N.pop_back(); } cout<<N.size()<<endl; }
a.cc: In function 'bool A(std::string)': a.cc:5:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 5 | for(int i=0;i<S.size/2;i++){ | ~~^~~~ | () a.cc: In function 'int main()': a.cc:14:15: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 14 | string N;cin<<N; | ~~~^~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | string N;cin<<N; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:14:12: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 14 | string N;cin<<N; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | string N;cin<<N; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | string N;cin<<N; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | string N;cin<<N; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | string N;cin<<N; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | string N;cin<<N; | ^ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | string N;cin<<N; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | string N;cin<<N; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | string N;cin<<N; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | string N;cin<<N; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 14 | string N;cin<<N; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | string N;cin<<N; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:14:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 14 | string N;cin<<N; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits
s801098058
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = s.length()-2; i >= 2; i -= 2) { vector<char> zen(i/2), kou(i/2); for (int j = 0; j < i; j++) { if (j < i/2) zen[j] = s[j]; else kou[j - i/2] = s[j]; } bool check = true; for (int j = 0; j < i/2; j++) { if (zen[j]!=kou[j]) { check = false; break; } } if (check) { cout << i; break } } }
a.cc: In function 'int main()': a.cc:25:12: error: expected ';' before '}' token 25 | break | ^ | ; 26 | } | ~
s382715082
p03672
C++
#include <bits/stdc++.h> using namespace std; using str = string; using ll = long long; int a[26]; int main() { cin.tie(0); ios::sync_with_stdio(0); str s;cin>>s; int ans=s.size(); for(int i=s.size()-1;i>=0;i--) { a[s[i]-'a']++; ans-- bool c=true; for(int j=0;j<26;j++)if(a[j]%2) c=false; if(c)break; } cout<<ans<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:21:14: error: expected ';' before 'bool' 21 | ans-- | ^ | ; 22 | bool c=true; | ~~~~ a.cc:23:41: error: 'c' was not declared in this scope 23 | for(int j=0;j<26;j++)if(a[j]%2) c=false; | ^ a.cc:24:12: error: 'c' was not declared in this scope 24 | if(c)break; | ^
s861723707
p03672
C++
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> #include <boost/xpressive/xpressive_static.hpp> #define FOR(i, a, b) for (int i = (a); i < int(b); ++i) #define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i) #define REP(i, n) FOR(i, 0, n) #define REP1(i, n) FOR(i, 1, int(n) + 1) #define RREP(i, n) RFOR(i, 0, n) #define RREP1(i, n) RFOR(i, 1, int(n) + 1) #define ALL(c) begin(c), end(c) int _ = ( #ifndef LOCAL std::cin.tie(nullptr), std::ios::sync_with_stdio(false), #endif std::cout.precision(10), std::cout.setf(std::ios::fixed)); using ll = long long; using ull = unsigned long long; using ld = long double; template <typename T> using vec = std::vector<T>; using namespace std; using namespace boost::xpressive; int main() { string S; cin >> S; S.pop_back(); boost::xpressive::smatch m; const sregex re = bos >> (s1 = +lower) >> s1; regex_search(S, m, re)); cout << m.str().length() << endl; return 0; }
a.cc:3:10: fatal error: boost/xpressive/xpressive_static.hpp: No such file or directory 3 | #include <boost/xpressive/xpressive_static.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s739681314
p03672
C++
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int n, x, i, y; char s[500]; gets(s); n = strlen(s); x = n; while(1) { x = x - 2; y = strncmp((s), (s+(x/2)), (x/2)); if(y==0) { cout << x << endl; break; } } return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(s); | ^~~~ | getw
s027664633
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; for (int i = n - 2; i >= 0; i--) { string t = s.substr(0, i); if (t.size() % 2 == 0) { bool ok = true; for (int i = 0; i < t.size() / 2; i++) { if (t[i] != t[i + t.size() / 2]) { ok = false; break; } } if (ok) { cout << t << endl; return 0; } } } }
a.cc: In function 'int main()': a.cc:10:18: error: 'n' was not declared in this scope 10 | for (int i = n - 2; i >= 0; i--) { | ^
s840747679
p03672
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int i, j; string s; cin >> s; n = s.size(); int ans=0, r=s.size()-2; for(i=n-2; i; i-=2){ bool ok = 1; for(j=0;j<i/2;j++){ if(s[j]!=s[j+i/2])ok=0; }if(ok){ cout << i; return 0; } }return 0; }
a.cc: In function 'int main()': a.cc:11:9: error: 'n' was not declared in this scope 11 | n = s.size(); | ^
s653295723
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string a; cin >> a; bool f = false; for (int j = a.size(); j >=0; j-=2) { if (j%2 == 1 && f == false) { f = true; a.pop_back(); } if (a.substr(0, a.size()/2); == a.substr(a.size()/2, a.size()-1); && f) { cout << j << endl; break; } a.pop_back(); a.pop_back(); f = true; } }
a.cc: In function 'int main()': a.cc:12:17: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result] 12 | if (a.substr(0, a.size()/2); == a.substr(a.size()/2, a.size()-1); && f) { | ~~~~~~~~^~~~~~~~~~~~~~~ In file included 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, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:3208:7: note: declared here 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ^~~~~~ a.cc:12:34: error: expected primary-expression before '==' token 12 | if (a.substr(0, a.size()/2); == a.substr(a.size()/2, a.size()-1); && f) { | ^~ a.cc:12:69: error: expected ')' before ';' token 12 | if (a.substr(0, a.size()/2); == a.substr(a.size()/2, a.size()-1); && f) { | ~ ^ | ) a.cc:12:75: error: expected ';' before ')' token 12 | if (a.substr(0, a.size()/2); == a.substr(a.size()/2, a.size()-1); && f) { | ^ | ; a.cc:12:74: error: label 'f' used but not defined 12 | if (a.substr(0, a.size()/2); == a.substr(a.size()/2, a.size()-1); && f) { | ^
s325229500
p03672
C++
#include <bits/stdc++.h> using namespace std; bool Check(string input){ if(input.size()%2 == 1){ return false; } else{ int len = input.size() / 2; for(int i=0;i<len;i++){ if(input[i] != input[i+len]) return false; } return true; } } int main(void){ string S; cin >> S; int N = S.size(); for(int i=N-1;i>=0;i--){ if(Check(S.substr(0,i))){cout << S.substr(0,i).size() << endl; return 0;} }
a.cc: In function 'int main()': a.cc:24:3: error: expected '}' at end of input 24 | } | ^ a.cc:16:15: note: to match this '{' 16 | int main(void){ | ^
s512936667
p03672
C++
#include<bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; using ull = unsigned long long; template<class T, class U> using P = pair<T,U>; template<class T> using Heap = priority_queue<T>; template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>; template<class T,class U> using umap = unordered_map<T,U>; template<class T> using uset = unordered_set<T>; template<class T> bool ChangeMax(T&a,const T&b){ if(a >= b) return false; a = b; return true; } template<class T> bool ChangeMin(T&a,const T&b){ if(a <= b) return false; a = b; return true; } template<class T, size_t N, class U> void Fill(T (&a)[N], const U&v){ fill((U*)a,(U*)(a+N),v); } template<class T> istream& operator >> (istream&is, vector<T>&v){ for(auto&e:v)is >> e; return is; } bool Ok(const string&s,int n){ bool f = true; if(n%2==1)return false; for(i = 0; i < n/2; ++i)f &= s[i] == s[i+n]; return f; } int main(){ string s; cin >> s; int n = (int)s.size(); for(int i = n-2; i >= 0; i-=2){ if(Ok(s,i)){ cout << i << endl; return 0; } } }
a.cc: In function 'bool Ok(const std::string&, int)': a.cc:42:7: error: 'i' was not declared in this scope 42 | for(i = 0; i < n/2; ++i)f &= s[i] == s[i+n]; | ^
s339618828
p03672
C++
/* * atcoder/abc089/b.cpp */ // C++ 14 #include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <cstring> // memset #include <cassert> using namespace std; #define ll long long #define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++) void solve(); int main() { solve(); return 0; } #define ull unsigned long long void solve() { string s; cin >> s; for (int count=2; count<n; count += 2) { string s2 = s.substr(0, n-count); if (s2.substr(0, s2.size()) == s2.substr(s2.size())) { cout << count << endl; return; } } cout << -1 << endl; }
a.cc: In function 'void solve()': a.cc:21:27: error: 'n' was not declared in this scope 21 | for (int count=2; count<n; count += 2) { | ^
s693657951
p03672
Java
public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scanner = new Scanner(System.in); String S = scanner.nextLine(); int length = S.length(); while(true) { if ((S.length() -1) % 2 == 0) { String sub1 = S.substring(0, S.length() / 2); // System.out.println("sub1:" + sub1); String sub2 = S.substring(S.length() / 2, S.length() -1); // System.out.println("sub2:" + sub2); if (sub1.equals(sub2)) { System.out.println(S.length()-1); return; } else { S = S.substring(0, (S.length()-1)); } } else { S = S.substring(0, (S.length()-1)); } // System.out.println(S); } } }
Main.java:5: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s157384472
p03672
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; for(int i=s.size()-2;i>0;i-=2){ if(s.substr(0,i/2)==s.substr(i/2,i/2){ cout<<i<<endl; return 0; } } }
a.cc: In function 'int main()': a.cc:8:42: error: expected ')' before '{' token 8 | if(s.substr(0,i/2)==s.substr(i/2,i/2){ | ~ ^ | ) a.cc:12:3: error: expected primary-expression before '}' token 12 | } | ^
s374205601
p03672
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; for(int i=s.size()-2;i>-;i-=2){ if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2)){ cout<<s.size()<<endl; return 0; } } }
a.cc: In function 'int main()': a.cc:7:27: error: expected primary-expression before ';' token 7 | for(int i=s.size()-2;i>-;i-=2){ | ^
s156212805
p03672
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; s.push_back(); int hu=0; for(int i=s.size()-2;i>-;i-=2){ if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2)){ cout<<s.size()<<endl; return 0; } } }
a.cc: In function 'int main()': a.cc:7:14: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()' 7 | s.push_back(); | ~~~~~~~~~~~^~ In file included 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, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:1572:7: note: candidate: 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 1572 | push_back(_CharT __c) | ^~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:1572:7: note: candidate expects 1 argument, 0 provided a.cc:9:27: error: expected primary-expression before ';' token 9 | for(int i=s.size()-2;i>-;i-=2){ | ^
s768293168
p03672
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; s.push_back(); int hu=0; for(int i=0;i<s.size();i++){ if(s.size()%2!=0){ s.push_back(); continue; } if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2)){ cout<<s.size()<<endl; return 0; } else{ s.push_back(); } } }
a.cc: In function 'int main()': a.cc:7:14: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()' 7 | s.push_back(); | ~~~~~~~~~~~^~ In file included 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, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:1572:7: note: candidate: 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 1572 | push_back(_CharT __c) | ^~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:1572:7: note: candidate expects 1 argument, 0 provided a.cc:11:18: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()' 11 | s.push_back(); | ~~~~~~~~~~~^~ /usr/include/c++/14/bits/basic_string.h:1572:7: note: candidate: 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 1572 | push_back(_CharT __c) | ^~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:1572:7: note: candidate expects 1 argument, 0 provided a.cc:19:18: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()' 19 | s.push_back(); | ~~~~~~~~~~~^~ /usr/include/c++/14/bits/basic_string.h:1572:7: note: candidate: 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 1572 | push_back(_CharT __c) | ^~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:1572:7: note: candidate expects 1 argument, 0 provided
s973577363
p03672
C++
#include<bits/stdc++.h> using namespace std; int main(){ vector<string>s; cin>>s; s.push_back(); int hu=0; for(int i=0;i<s.size();i++){ if(s.size()%2!=0){ s.push_back(); continue; } if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2)){ cout<<s.size()<<endl; return 0; } else{ s.push_back(); } } }
a.cc: In function 'int main()': a.cc:6:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 6 | cin>>s; | ~~~^~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char
s197395167
p03672
C++
#include <bits/stdc++.h> #define rep(i,x,n) for(int i=x; i<(int)(n); i++) #define rep_eq(i,x,n) for(int i=x; i<=(int)(n); i++) using namespace std; int main() { string S; cin >>S; vector<char> vec(S.size()); rep(i,0,S.size()) vec[i]=S[i]; while(true) { vec.pop_back(); if (vec.size()%2) continue; else { int count=0; rep(i,0,vec.size()/2) { if (vec[i]==vec[(vec.size()/2)+i)] count++; } if (count==(int)(vec.size())/2) { cout <<vec.size() <<endl; break; } } } return 0; }
a.cc: In function 'int main()': a.cc:16:41: error: expected ']' before ')' token 16 | if (vec[i]==vec[(vec.size()/2)+i)] count++; | ^ | ] a.cc:16:42: error: expected primary-expression before ']' token 16 | if (vec[i]==vec[(vec.size()/2)+i)] count++; | ^
s325085846
p03672
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ string s;cin>>s; int n = s.size(); for(int i=2;i<=s/2;i+=2){ int m = n - i; int cc = 0; rep(j,m/2){ if(s[j]!=s[m/2 + j])cc=1; } if(cc == 1){ int ans = m; break; } } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:21: error: no match for 'operator/' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 11 | for(int i=2;i<=s/2;i+=2){ | ~^~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/complex:430:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator/(const complex<_Tp>&, const complex<_Tp>&)' 430 | operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:430:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 11 | for(int i=2;i<=s/2;i+=2){ | ^ /usr/include/c++/14/complex:439:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator/(const complex<_Tp>&, const _Tp&)' 439 | operator/(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:439:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 11 | for(int i=2;i<=s/2;i+=2){ | ^ /usr/include/c++/14/complex:448:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator/(const _Tp&, const complex<_Tp>&)' 448 | operator/(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:448:5: note: template argument deduction/substitution failed: a.cc:11:22: note: mismatched types 'const std::complex<_Tp>' and 'int' 11 | for(int i=2;i<=s/2;i+=2){ | ^ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:408:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__divides, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__divides, typename _Dom1::value_type>::result_type> std::operator/(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 408 | _DEFINE_EXPR_BINARY_OPERATOR(/, struct std::__divides) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:408:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 11 | for(int i=2;i<=s/2;i+=2){ | ^ /usr/include/c++/14/bits/valarray_after.h:408:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__divides, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__divides, typename _Dom1::value_type>::result_type> std::operator/(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 408 | _DEFINE_EXPR_BINARY_OPERATOR(/, struct std::__divides) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:408:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 11 | for(int i=2;i<=s/2;i+=2){ | ^ /usr/include/c++/14/bits/valarray_after.h:408:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__divides, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__divides, typename _Dom1::value_type>::result_type> std::operator/(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 408 | _DEFINE_EXPR_BINARY_OPERATOR(/, struct std::__divides) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:408:5: note: template argument deduction/substitution failed: a.cc:11:22: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 11 | for(int i=2;i<=s/2;i+=2){ | ^ /usr/include/c++/14/bits/valarray_after.h:408:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__divides, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__divides, typename _Dom1::value_type>::result_type> std::operator/(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 408 | _DEFINE_EXPR_BINARY_OPERATOR(/, struct std::__divides) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:408:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 11 | for(int i=2;i<=s/2;i+=2){ | ^ /usr/include/c++/14/bits/valarray_after.h:408:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__divides, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__divides, typename _Dom1::value_type>::result_type> std::operator/(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 408 | _DEFINE_EXPR_BINARY_OPERATOR(/, struct std::__divides) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:408:5: note: template argument deduction/substitution failed: a.cc:11:22: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 11 | for(int i=2;i<=s/2;i+=2){ | ^ /usr/include/c++/14/valarray:1199:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__divides, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__divides, _Tp>::result_type> std::operator/(const valarray<_Tp>&, const valarray<_Tp>&)' 1199 | _DEFINE_BINARY_OPERATOR(/, __divides) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1199:1: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 11 | for(int i=2;i<=s/2;i+=2){ | ^ /usr/include/c++/14/valarray:1199:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__divides, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__divides, _Tp>::result_type> std::operator/(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1199 | _DEFINE_BINARY_OPERATOR(/, __divides) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1199:1: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 11 | for(int i=2;i<=s/2;i+=2){ | ^ /usr/include/c++/14/valarray:1199:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__divides, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__divides, _Tp>::result_type> std::operator/(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1199 | _DEFINE_BINARY_OPERATOR(/, __divides) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1199:1: note: template argument deduction/substitution failed: a.cc:11:22: note: mismatched types 'const std::valarray<_Tp>' and 'int' 11 | for(int i=2;i<=s/2;i+=2){ | ^ a.cc:22:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 22 | cout<<ans<<endl; | ^~~ | abs
s183688031
p03672
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s=sc.next(); int n=s.length(); for(int i=0;i<s.length();i+=2){ String a=s.substring(0,2/n),b=s.substring(2/n,n); if(a.equals(b)){ Systen.out.println(n); break; } s=s.substring(0,n-2); n=s.length(); } } }
Main.java:12: error: package Systen does not exist Systen.out.println(n); ^ 1 error
s114230436
p03672
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s=sc.next(); int n=s.length() for(int i=0;i<s.length();i+=2){ String a=s.substring(0,2/n),b=s.substring(2/n,n); if(a.equals(b)){ Systen.out.println(n); break; } s=s.substring(0,n-2); n=s.length(); } } }
Main.java:8: error: ';' expected int n=s.length() ^ 1 error
s438372780
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.
s995757031
p03672
C++
# include < stdio .h > # include < string .h > int main(){ string ani; cin>>ani; int n = ani.length(); for(int i = n-2;i>=0;i-=2){ if(strncmp(str,str+i/2,i/2) == 0){ cout<<i<<endl; return 0; } } return 0; }
a.cc:1:11: fatal error: stdio .h : No such file or directory 1 | # include < stdio .h > | ^~~~~~~~~~~~ compilation terminated.
s152785347
p03672
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; s.pop_back(); while(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size())){ s.pop_back; } cout<<s.size()<<endl; }
a.cc: In function 'int main()': a.cc:9:7: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 9 | s.pop_back; | ~~^~~~~~~~ In file included 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, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~
s342656403
p03672
C++
#include<bits/stdc++.h> using namespace std; int main(){ vector<string>s; cin>>s; while(s.substr(0,s.size()/2)!=s.substr(s.size()/2,s.size()/2)){ s.pop_back(); } cout<<s.size()<<endl; }
a.cc: In function 'int main()': a.cc:6:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 6 | cin>>s; | ~~~^~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char
s441010431
p03672
C++
#include <iostream> #include <string> #include <algorithm> #include <ctime> #include <functional> #include <vector> #include <stack> #include <queue> #include <map> #include <set> #include <cassert> #include <bitset> #include <list> #include <cstdio> #include <stdio.h> #include <string.h> #include <limits.h> #include <math.h> #include <cmath> #include <tuple> #include <cassert> #include <array> #include <iomanip> using namespace std; using pii = pair<int, int>; using ti = tuple<int, int, int>; const double eps=1e-14; const int mod = 1e9 + 7; const int inf = ((1<<30)); const long long linf = (1LL<<60); int main() { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int ans = 0; s = s.substr(0, tmp-2); while(true) { int tmp = s.size(); if(s.substr(0,tmp/2) == s.substr(tmp/2, tmp/2)) { ans = tmp; break; } s = s.substr(0, tmp-2); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:41:21: error: 'tmp' was not declared in this scope; did you mean 'tm'? 41 | s = s.substr(0, tmp-2); | ^~~ | tm
s392428336
p03672
C++
#include <iostream> #include <string> #include <algorithm> #include <ctime> #include <functional> #include <vector> #include <stack> #include <queue> #include <map> #include <set> #include <cassert> #include <bitset> #include <list> #include <cstdio> #include <stdio.h> #include <string.h> #include <limits.h> #include <math.h> #include <cmath> #include <tuple> #include <cassert> #include <array> #include <iomanip> using namespace std; using pii = pair<int, int>; using ti = tuple<int, int, int>; const double eps=1e-14; const int mod = 1e9 + 7; const int inf = ((1<<30)); const long long linf = (1LL<<60); int main() { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int ans = 0; for(int i=0; i<n; i++) { int tmp = s.size(); if(s.substr(0,tmp/2) == s.substr(tmp/2)) { ans = tmp; break; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:41:20: error: 'n' was not declared in this scope 41 | for(int i=0; i<n; i++) | ^
s245495506
p03672
C++
#include <iostream> #include <string> using namespace std; int main(int argc, char const *argv[]) { string S; cin >> S; string str1, str2; for (int i = 0; i < S.size(); i++) { S.pop_back(); if (S.size() % != 0) continue; str1 = S.substr(0, (S.size() / 2)); str2 = S.substr((S.size() / 2), (S.size() / 2)); if (str1 == str2) break; } cout << S.size() / 2 << endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:15:24: error: expected primary-expression before '!=' token 15 | if (S.size() % != 0) continue; | ^~
s877373715
p03672
C++
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; typedef long long ll; int main() { string S; cin >> S; if(S.size() == 2) { cout << 0; return 0; } for(int i = 0; i < S.size() - 2; i++) { S.pop_back(); int N = S.size(); if(S.substr(0, N / 2) == S.substr(N / 2, N / 2)) { cout << S.size() - 1;1 return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:14:29: error: expected ';' before 'return' 14 | cout << S.size() - 1;1 | ^ | ; 15 | return 0; | ~~~~~~
s028283626
p03672
C++
#include <bits/stdc++.h> #include <boost/multiprecision/cpp_int.hpp> using namespace std; typedef long long ll; namespace mp = boost::multiprecision; using Mint = mp::cpp_int; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i,a,b) for(int i = int(a); i < int(b); i++) #define all(v) v.begin(), v.end() #define uni(v) v.erase(unique(all(v)), v.end()) #define sort_g(v) sort(all(v), greater<int>()) #define dump(x) cerr << #x << ' ' << '=' << ' ' << x << endl bool is_even(string S) { int l = S.size() / 2; string sub_1 = S.substr(0, l); string sub_2 = S.substr(l, l); if(sub_1 == sub_2) return true; else return false; } int main() { string S; cin >> S; int l = 0; for(int i = S.size() - 2; i >= 1; i -= 2) { string sub = S.substr(0, i); dump(sub); if(is_even(sub)) { l = sub.size(); break; } } cout << l << endl; }
a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory 2 | #include <boost/multiprecision/cpp_int.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s890794152
p03672
C++
#include <iostream> #include <string> using namespace std; int main(){ int count=0; string data,data1,data2; cin>>data; if(data.size()%2==0){ count+=2 data1=data.substr(0,data.size()/2-1); data2=data.substr(data.size()/2-1,data.size()/2-1); } else if(data.size()%2!=0){ count+=1; data1=data.substr(0,(int)data.size()/2); data2=data.substr((int)data.size()/2,(int)data.size()/2); } while(data1==data2){ count+=1; data1=data.substr(0,(int)(data.size()-count)/2); data2=data.substr((int)(data.size()-count)/2,(int)(data.size()-count)/2); } cout<<count<<endl; }
a.cc: In function 'int main()': a.cc:10:13: error: expected ';' before 'data1' 10 | count+=2 | ^ | ; 11 | data1=data.substr(0,data.size()/2-1); | ~~~~~
s425615739
p03672
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; for(int i=s.size()-2;i>=0;i-=2){ s=s.substr(0,s.size-2); if(s.substr(0,i/2)==s.substr(i/2+1,i)){ cout << i; return 0; } } }
a.cc: In function 'int main()': a.cc:7:20: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 7 | s=s.substr(0,s.size-2); | ~~^~~~ | ()
s788058030
p03672
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int ctoi(const char c) { if ('0' <= c && c <= '9') return (c - '0'); return -1; } vector<int> input(int n) { vector<int> vec(n); for (int i = 0; i < n; i++) { cin >> vec.at(i); } return vec; } void output(vector<int> vec) { for (int i = 0; i < vec.size(); i++) { cout << vec[i] << " "; } return; } vector<vector<int>> input(int n, int m) { vector<vector<int>> table(n, vector<int>(m)); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> table. at(i).at(j); } } return table; } void output(vector<vector<int>> table) { for (int i = 0; i < table.size(); i++) { for (int j = 0; j < table.at(0).size(); j++) { cout << table.at(i).at(j) << " "; } cout << endl; } } long long perm(int n, int r) { if (n < r) { cout << "error" << endl; return 0; } long long perm = 1; for (int i = n; i > n - r; i--) { perm *= i; } return perm; } long long comb(int n, int r) { if (n < r) { cout << "error" << endl; return 0; } long long comb = perm(n,r); for (int i = r; i > 0; i--) { comb /= i; } return comb; } long long homo(int n, int r) { return comb(n + r - 1, n - 1); } long long fact(int n) { long long fact = 1; for (int i = n; i > 0; i--) { fact *= i; } return fact; } int gcd(int a, int b) { if (a % b == 0) { return(b); } else { return(gcd(b, a % b)); } } int lcm(int a, int b) { return a * b / gcd(a, b); } int main() { int n,k; cin >> n >> k; vector<int> l=input(n); sort#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int ctoi(const char c) { if ('0' <= c && c <= '9') return (c - '0'); return -1; } vector<int> input(int n) { vector<int> vec(n); for (int i = 0; i < n; i++) { cin >> vec.at(i); } return vec; } void output(vector<int> vec) { for (int i = 0; i < vec.size(); i++) { cout << vec[i] << " "; } return; } vector<vector<int>> input(int n, int m) { vector<vector<int>> table(n, vector<int>(m)); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> table. at(i).at(j); } } return table; } void output(vector<vector<int>> table) { for (int i = 0; i < table.size(); i++) { for (int j = 0; j < table.at(0).size(); j++) { cout << table.at(i).at(j) << " "; } cout << endl; } } long long perm(int n, int r) { if (n < r) { cout << "error" << endl; return 0; } long long perm = 1; for (int i = n; i > n - r; i--) { perm *= i; } return perm; } long long comb(int n, int r) { if (n < r) { cout << "error" << endl; return 0; } long long comb = perm(n,r); for (int i = r; i > 0; i--) { comb /= i; } return comb; } long long homo(int n, int r) { return comb(n + r - 1, n - 1); } long long fact(int n) { long long fact = 1; for (int i = n; i > 0; i--) { fact *= i; } return fact; } int gcd(int a, int b) { if (a % b == 0) { return(b); } else { return(gcd(b, a % b)); } } int lcm(int a, int b) { return a * b / gcd(a, b); } int main() { string s; cin >> s; for(int i=0;i<s.size();i++){ s.pop_back(); s.pop_back(); string s1=s.substr(0,s.size()/2); string s2=s.substr(s.size()/2+1); if(s1==s2){ cout << s.size() << endl; break; } } }
a.cc:88:7: error: stray '#' in program 88 | sort#include <bits/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:88:7: error: expected ';' before 'include' 88 | sort#include <bits/stdc++.h> | ^~~~~~~~ | ; a.cc:89:20: error: statement cannot resolve address of overloaded function 89 | using namespace std; | ^ a.cc:91:24: error: a function-definition is not allowed here before '{' token 91 | int ctoi(const char c) { | ^ a.cc:95:26: error: a function-definition is not allowed here before '{' token 95 | vector<int> input(int n) { | ^ a.cc:102:30: error: a function-definition is not allowed here before '{' token 102 | void output(vector<int> vec) { | ^ a.cc:108:41: error: a function-definition is not allowed here before '{' token 108 | vector<vector<int>> input(int n, int m) { | ^ a.cc:117:40: error: a function-definition is not allowed here before '{' token 117 | void output(vector<vector<int>> table) { | ^ a.cc:125:30: error: a function-definition is not allowed here before '{' token 125 | long long perm(int n, int r) { | ^ a.cc:136:30: error: a function-definition is not allowed here before '{' token 136 | long long comb(int n, int r) { | ^ a.cc:147:30: error: a function-definition is not allowed here before '{' token 147 | long long homo(int n, int r) { | ^ a.cc:150:23: error: a function-definition is not allowed here before '{' token 150 | long long fact(int n) { | ^ a.cc:158:1: error: a function-definition is not allowed here before '{' token 158 | { | ^ a.cc:168:23: error: a function-definition is not allowed here before '{' token 168 | int lcm(int a, int b) { | ^ a.cc:171:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 171 | int main() { | ^~ a.cc:171:9: note: remove parentheses to default-initialize a variable 171 | int main() { | ^~ | -- a.cc:171:9: note: or replace parentheses with braces to value-initialize a variable a.cc:171:12: error: a function-definition is not allowed here before '{' token 171 | int main() { | ^ a.cc:184:2: error: expected '}' at end of input 184 | } | ^ a.cc:84:12: note: to match this '{' 84 | int main() { | ^
s901712696
p03672
C++
#include<iostream> #include<vector> #include<string> using namespace std; int main(){ string s; cin>>s; int n=s.size(); for(int i=n-2;i;i-=2){ if(strncmp(s,s+n/2,n/2)==0){ cout<<i<<endl; return 0; } } }
a.cc: In function 'int main()': a.cc:10:19: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 10 | if(strncmp(s,s+n/2,n/2)==0){ | ~^~~~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/string:48, 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_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ In file included from /usr/include/c++/14/string:54: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const _CharT*' and 'int' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:10:22: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const _CharT*' and 'int' 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:10:22: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^ a.cc:10:8: error: 'strncmp' was not declared in this scope 10 | if(strncmp(s,s+n/2,n/2)==0){ | ^~~~~~~ a.cc:3:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<vector> +++ |+#include <cstring> 3 | #include<string>
s960629066
p03672
C++
#include<iostream> #include<vector> #include<string> using namespace std; int main(){ string s; cin>>s; int n=s.size(); for(int i=n-2;i;i-=2){ if(strncmp(s,s+n/2,n/2)){ cout<<i<<endl; return 0; } } }
a.cc: In function 'int main()': a.cc:10:19: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 10 | if(strncmp(s,s+n/2,n/2)){ | ~^~~~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/string:48, 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_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ In file included from /usr/include/c++/14/string:54: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const _CharT*' and 'int' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:10:22: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const _CharT*' and 'int' 10 | if(strncmp(s,s+n/2,n/2)){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:10:22: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 10 | if(strncmp(s,s+n/2,n/2)){ | ^ a.cc:10:8: error: 'strncmp' was not declared in this scope 10 | if(strncmp(s,s+n/2,n/2)){ | ^~~~~~~ a.cc:3:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<vector> +++ |+#include <cstring> 3 | #include<string>
s826384206
p03672
C++
#include <iostream> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main() { string s; int cnt=0; getline(cin,s); for(int i=s/2;i>=0;i--){ for(int j=1;j<=i;i++){ if(s[j-1]==s[j-1+i])cnt++; } if(cnt==i){ cout<<i; break; } } return 0; }
a.cc: In function 'int main()': a.cc:9:20: error: no match for 'operator/' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 9 | for(int i=s/2;i>=0;i--){ | ~^~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>}
s283687126
p03672
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define ll long long #define vecll vector<long long> #define vec2ll vector<vector<long long>> #define vecbool vector<bool> #define vecpairll vector<pair<long long,long long>> #define forll(s,a,b) for(long long s = a;s < b;s++) #define forllde(s,a) for(long long s = a;s > 0;s--) bool evenStr(string s){ forll(i, 0, s.size() / 2){ if(s[i] != s[i + s.size/2]) return false; } return true; } int main() { string s; cin >> s; forll(i, 0, s.size() / 2){ s.pop_back(); s.pop_back(); if (evenStr(s)) break; } cout << s.size() << endl; }
a.cc: In function 'bool evenStr(std::string)': a.cc:16:28: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 16 | if(s[i] != s[i + s.size/2]) | ~~^~~~ | ()
s834404258
p03672
C++
#include<bits/stdc++.h> using namespace std; bool gu(string S){ int N=S.size(); bool flag=true; for(int i=0;i<N/2;i++){ if(S.at(i)!=S.at(i+N/2)){ flag=false; } } return flag; } int main(){ string T; cin>>T; for(int i=0;i<N/2;i++){ T.pop_back(); T.pop_back(); if(gu(T)){ cout<<T.size()<<endl; break; } } }
a.cc: In function 'int main()': a.cc:17:17: error: 'N' was not declared in this scope 17 | for(int i=0;i<N/2;i++){ | ^
s294989017
p03672
C++
# include < stdio .h > 2 # include < string .h > 3 4 int main () { 5 char str [222]; 6 scanf ("%s", str ) ; 7 int n= strlen (str ) ; 8 for (int i=n -2; i; i -=2) { 9 if( strncmp (str , str +i/2 , i/2) ==0) { 10 printf ("%d\n" ,i) ; 11 return 0; 12 } 13 } 14 return 0; 15 } #include<stdio.h> #include<string.h> int main(void){ char str[222]; scanf("%s",str); int n=strlen(str); for(int loop=n-2;loop;loop-=2){ if(strncmp(str,str+loop/2,loop/2)==0){ printf("%d\n",loop); return 0; } } return 0; }
a.cc:1:11: fatal error: stdio .h : No such file or directory 1 | # include < stdio .h > | ^~~~~~~~~~~~ compilation terminated.
s525807482
p03672
C++
#include <iostream> #include <algorithm> #include <string> #include <queue> #include <cmath> using namespace std; using ll = long long; string str; ll ans = 0; int main() { cin >> str; for (ll i = 0; i < str.length / 2; i++) { if (str.substr(0, (size_t)i + 1) == str.substr((size_t)i + 1, (size_t)i + 1)) { ans = max(ans, i); } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:32: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 17 | for (ll i = 0; i < str.length / 2; i++) | ~~~~^~~~~~ | ()
s517145845
p03672
C
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) const long long MODNUM = 7; int main() { string s; cin >> s; // 最初に1文字必ず消す必要がある string tmp = s.substr(0, s.size()-1); while(tmp.size() >= 2) { if(tmp.size() % 2 == 0) { string prev = tmp.substr(0, tmp.size()/2); string post = tmp.substr(tmp.size()/2, tmp.size()/2); if(prev == post) { // 長い順に見てるので、できた時点でそれが最長 cout << tmp.size() << endl; return 0; } } tmp = tmp.substr(0, tmp.size()-1); } cout << 1 << endl; return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s593274100
p03672
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define double long double #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) #define fi first #define se second #define sz size() #define bgn begin() #define en end() #define pb push_back #define pp() pop_back() #define V vector #define P pair #define yuko(a) setprecision(a) #define uni(a) a.erase(unique(a.begin(),a.end()),a.end()) #define Q queue #define pri priority_queue #define Pri priority_queue<int,vector<int>,greater<int>> #define PriP priority_queue<P<int,int>,vector<P<int,int>>,greater<P<int,int>>> #define ff first.first #define fs first.second #define sf second.first #define ss second.second #define all(a) (a).begin(),(a).end() #define elif else if int low(V<int> &a,int b){ auto c=lower_bound(a.begin(),a.end(),b); int d=c-a.bgn; return d; } int upp(V<int> &a,int b){ auto c=upper_bound(a.begin(),a.end(),b); int d=c-a.bgn; return d; } template<class T> void cou(vector<vector<T>> a){ int b=a.size(); int c=a[0].size(); fo(i,b){ fo(j,c){ cout<<a[i][j]; if(j==c-1) cout<<endl; else cout<<' '; } } } int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int a){ return a*(a+1)/2; } int gcm(int a,int b){ if(a%b==0) return b; return gcm(b,a%b); } bool prime(int a){ if(a<2) return false; else if(a==2) return true; else if(a%2==0) return false; for(int i=3;i<=sqrt(a)+1;i+=2){ if (a%i==0) return false; } return true; } struct Union{ vector<int> par; Union(int a){ par=vector<int>(a,-1); } int find(int a){ if(par[a]<0) return a; else return par[a]=find(par[a]); } bool same(int a,int b){ return find(a)==find(b); } int Size(int a){ return -par[find(a)]; } void unite(int a,int b){ a=find(a); b=find(b); if(a==b) return; if(Size(b)>Size(a)) swap<int>(a,b); par[a]+=par[b]; par[b]=a; } }; int ketas(int a){ string b=to_string(a); int c=0; fo(i,keta(a)){ c+=b[i]-'0'; } return c; } bool fe(int a,int b){ a%=10; b%=10; if(a==0) a=10; if(b==0) b=10; if(a>b) return true; else return false; } int INF=1000000007; struct edge{int s,t,d; }; V<int> mojisyu(string a){ V<int> b(26,0); fo(i,a.sz){ b[a[i]-'a']++; } return b; } int wa2(int a){ if(a%2==1) return a/2; return a/2-1; } /*signed main(){ int a,b,c; cin>>a>>b>>c; V<V<edge>> d(a); fo(i,b){ edge e; cin>>e.s>>e.t>>e.d; d[e.s].pb(e); } V<int> e(a,INF); e[c]=0; priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f; f.push({0,c}); int h=INF; while(!f.empty()){ P<int,int> g; g=f.top(); f.pop(); int v = g.second, i = g.first; for(edge l : d[v]){ if(e[l.t] > i + l.d){ e[l.t] = i + l.d; f.push({i+l.d , l.t}); } } } fo(i,a){ if(e[i]==INF) cout<<"INF"<<endl; else cout<<e[i]<<endl; } } ?*/ int nCr(int n,int r){ int a=1; r=min(r,n-r); for(int i=n;i>n-r;i--){ a*=i; a/=n-i+1; } return a; } /*void sea(int x,int y){ if(x<0||a<=x||y<0||b<=y||c[x][y]=='#') return; if(d[x][y]) return; d[x][y]++; sea(x+1,y); sea(x-1,y); sea(x,y+1); sea(x,y-1); }*/ int kaijou(int a){ int b=1; fo(i,a) b*=i+1; return b; } int nPr(int a,int b){ if(a<b) return 0; if(b==0) return 1; int c=1; for(int i=a;i>a-b;i--){ c*=i; c%=INF; } return c; } long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } // a^{-1} mod を計算する long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); } int lcm(int a,int b){ int c=modinv(gcm(a,b),INF); return ((a*c)%INF)*(b%INF)%INF; } int MOD=INF; int fac[1000010], finv[1000010], inv[1000010]; // テーブルを作る前処理 //先にCOMinit()で前処理をする //ABC145D void COMinit() { fac[0]=fac[1]=1; finv[0]=finv[1]=1; inv[1]=1; for(int i=2;i<1000010;i++){ fac[i]=fac[i-1]*i%MOD; inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD; finv[i]=finv[i-1]*inv[i]%MOD; } } // 二項係数計算 int COM(int n,int k){ if(n<k) return 0; if(n<0||k<0) return 0; return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD; } bool naka(int a,int b,V<V<char>> c){ return (a>=0&&b>=0&&a<c.sz&&b<c[0].sz); } V<P<int,int>> mawari8={{0,-1},{0,1},{1,0},{-1,0},{-1,-1},{1,1},{1,-1},{-1,-1}}; int inf=1000000000000000007; /* signed main(){ int a,b,c; cin>>a>>b>>c; V<V<edge>> d(a); fo(i,b){ edge e; cin>>e.s>>e.t>>e.d; d[e.s].pb(e); } V<int> e(a,INF); e[c]=0; priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f; f.push({0,c}); int h=INF; while(!f.empty()){ P<int,int> g; g=f.top(); f.pop(); int v = g.second, i = g.first; for(edge l : d[v]){ if(e[l.t] > i + l.d){ e[l.t] = i + l.d; f.push({i+l.d , l.t}); } } } fo(i,a){ if(e[i]==INF) cout<<"INF"<<endl; else cout<<e[i]<<endl; } }*/ V<P<int,int>> mawari4={{0,-1},{0,1},{1,0},{-1,0}}; //最短経路の表 a(全部INFで初期化) //縦横 x,y //迷路 f //スタートsx,sy //ゴールgx,gy //文字はgから使おうね /*int bfs_haba(){ Q<P<int,int>> b; a[sx][sy]=0; b.push({sx,sy}); while(!b.empty()){ P<int,int> c=b.front(); b.pop(); if(c.fi==gx&&c.se==gy){ break; } fo(i,4){ int d=c.fi+mawari4[i].fi; int e=c.se+mawari4[i].se; if(0<=d&&0<=e&&d<x&&e<y&&f[d][e]!='#'&&a[d][e]==INF){ b.push({d,e}); a[d][e]=1+a[c.fi][c.se]; } } } return a[gx][gy]; }*/ V<int> onajibubun(string a){ V<int> b(a.sz); for(int i=1,j=0;i<a.sz;i++){ if(i+b[i-j]<j+b[j]) b[i]=b[i-j]; else{ int c=max<int>(0,j+b[j]-i); while(i+c<a.sz&&a[c]==a[i+c]) c++; b[i]=c; j=i; } } b[0]=a.sz; return b; } //各頂点ごとにどこに辺が出てるかの表がc //各頂点ごとの色を表すV<int>(頂点数max)のcolorを用意する //aはどこ塗るか、bは何で塗るかなので、(0,1,c)でよぶとおけ V<int> color(205); bool nibu_hantei(int a,int b,V<V<int>> c){ color[a]=b; fo(i,c[a].sz){ if(b==color[c[a][i]]) return false; if(color[c[a][i]]==0&&!nibu_hantei(c[a][i],-b,c)) return false; } return true; } //aは頂点数 //nibu_hanteiの上にcolorを用意する //各頂点ごとにどこに辺が出てるかの表がc bool renketujanai_nibu_hantei(int a,V<V<int>> c){ fo(i,a){ if(color[i]==0){ if(!nibu_hantei(i,1,c)) return false; } } return true; } struct segmin{ vector<int> seg; int b; segmin(V<int> a){ b=1; while(b<a.sz) b*=2; seg=vector<int>(2*b-1,inf); fo(i,a.sz){ seg[i+b-1]=a[i]; } for(int i=b-2;i>=0;i--){ seg[i]=min(seg[2*i+1],seg[2*i+2]); } } void update(int i,int a){ i+=b-1; seg[i]=a; while(i){ i=(i-1)/2; seg[i]=min(seg[2*i+1],seg[2*i+2]); } } //最初呼び出すときは要求区間x,y+1(yは添え字+1)とa=0,l=0,r=INFで //l,rは探すところ int getmin(int x,int y,int a,int l,int r){ if(r==INF) r=b; if(r<=x||y<=l) return INF; if(x<=l&&r<=y) return seg[a]; int a1=getmin(x,y,2*a+1,l,(l+r)/2); int a2=getmin(x,y,2*a+2,(l+r)/2,r); return min(a1,a2); } }; struct segadd{ vector<int> seg; int b; segadd(V<int> a){ b=1; while(b<a.sz) b*=2; seg=vector<int>(2*b-1,0); fo(i,a.sz){ seg[i+b-1]=a[i]; } for(int i=b-2;i>=0;i--){ seg[i]=seg[2*i+1]+seg[2*i+2]; } } void update(int i,int a){ i+=b-1; seg[i]=a; while(i){ i=(i-1)/2; seg[i]=seg[2*i+1]+seg[2*i+2]; } } //最初呼び出すときは要求区間x,y+1(yは添え字+1)とa=0,l=0,r=INFで //l,rは探すところ int getadd(int x,int y,int a,int l,int r){ if(r==INF) r=b; if(r<=x||y<=l) return 0; if(x<=l&&r<=y) return seg[a]; int a1=getadd(x,y,2*a+1,l,(l+r)/2); int a2=getadd(x,y,2*a+2,(l+r)/2,r); return a1+a2; } }; int pow_kai(int a, int b){ int c=1; while(b>0){//bit全部捨てるまで if(b%2){//一番右のbitが1 c=c*a; } a=a*a; b>>=1;//全体右に1つシフト } return c; } V<P<int,int>> factorize(int n){ V<P<int,int>> res; for(int i=2; i*i<=n; i++){ if(n%i) continue; res.emplace_back(i,0); while(n%i==0){ n/=i; res.back().second++; } } if(n!=1) res.emplace_back(n,1); return res; } const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; signed main(){ string s; cin>>s; int ans=0; for(int i=2; i<n-1; i+=2){ if(s.substr(0,i/2)==s.substr(i/2,i/2)) ans=max(ans,i); } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:481:18: error: 'n' was not declared in this scope 481 | for(int i=2; i<n-1; i+=2){ | ^
s804781669
p03672
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <math.h> #include <functional> using namespace std; int main(){ string s; cin >> s; bool f = true; for(int i = 0; i < s.size() / 2; i++){ s.pop_back(); s.pop_back(); //cout << s << endl; for(int j = 0; j < s.size() / 2; j++){ if(s[j] != s[j + s.size() / 2]){ break; } if(j == s.size() / 2 - 1){ cout << s.size() << endl; f = false; break; } } if(f == false){ break; } }
a.cc: In function 'int main()': a.cc:29:4: error: expected '}' at end of input 29 | } | ^ a.cc:9:11: note: to match this '{' 9 | int main(){ | ^
s671992332
p03672
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;++i) #include<string> #include<vector> using namespace std; typedef long long ll; typedef pair<int, int>P; 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; } //max=({}); //条件式が真ならwhileの中身を回し続ける //printf("%d\n", ans); //pairの入力 //vector<pair<ll, ll>>work(n); //rep(i, n) { // ll a, b; // cin >> a >> b; // work[i] = make_pair(a, b); //for(auto p:mp)(mapの探索) //printf("%.10f\n",なんちゃら) int g[15][15]; const int INF = 1001001001; const int dx[4] = { -1,0,1,0 }; const int dy[4] = { 0,-1,0,1 }; //最大公約数 ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll x, ll y) { if (x == 0 || y == 0)return 0; return (x / gcd(x, y) * y); } //素因数分解 vector<pair<ll, int>>factorize(ll n) { vector<pair<ll, int>>res; for (ll i = 2;i * i <= n;++i) { if (n % i)continue; res.emplace_back(i, 0); while (n % i == 0) { n /= i; res.back().second++; } } if (n != 1)res.emplace_back(n, 1); return res; } int bingo[3][3]; bool flag[3][3]; int cnt[2][105]; int h, w; int choco[1010][1010]; int s[11][11]; int main() { string s; cin >> s; int n = s.length(); int ans = 0; for(i = n - 3;i >= 0;i-=2) { bool flag = true; for (j = 0;j <(i+1)/2;++j) { if (s[j] != s[(i + 1) / 2 + j])flag = false; } if (flag)break; ans += 2; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:65:13: error: 'i' was not declared in this scope 65 | for(i = n - 3;i >= 0;i-=2) { | ^ a.cc:67:22: error: 'j' was not declared in this scope 67 | for (j = 0;j <(i+1)/2;++j) { | ^
s953790370
p03672
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;++i) #include<string> #include<vector> using namespace std; typedef long long ll; typedef pair<int, int>P; 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; } //max=({}); //条件式が真ならwhileの中身を回し続ける //printf("%d\n", ans); //pairの入力 //vector<pair<ll, ll>>work(n); //rep(i, n) { // ll a, b; // cin >> a >> b; // work[i] = make_pair(a, b); //for(auto p:mp)(mapの探索) //printf("%.10f\n",なんちゃら) int g[15][15]; const int INF = 1001001001; const int dx[4] = { -1,0,1,0 }; const int dy[4] = { 0,-1,0,1 }; //最大公約数 ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll x, ll y) { if (x == 0 || y == 0)return 0; return (x / gcd(x, y) * y); } //素因数分解 vector<pair<ll, int>>factorize(ll n) { vector<pair<ll, int>>res; for (ll i = 2;i * i <= n;++i) { if (n % i)continue; res.emplace_back(i, 0); while (n % i == 0) { n /= i; res.back().second++; } } if (n != 1)res.emplace_back(n, 1); return res; } int bingo[3][3]; bool flag[3][3]; int cnt[2][105]; int h, w; int choco[1010][1010]; int s[11][11]; int main() { string s; cin >> s; int n = s.length(); int ans = 0; rep(i = n - 3;i >= 0;i-=2) { bool flag = true; for (j = 0;j <(i+1)/2;++j) { if (s[j] != s[(i + 1) / 2 + j])flag = false; } if (flag)break; ans += 2; } cout << ans << endl; return 0; }
a.cc:65:34: error: macro "rep" requires 2 arguments, but only 1 given 65 | rep(i = n - 3;i >= 0;i-=2) { | ^ a.cc:2:9: note: macro "rep" defined here 2 | #define rep(i,n)for(int i=0;i<n;++i) | ^~~ a.cc: In function 'int main()': a.cc:65:9: error: 'rep' was not declared in this scope 65 | rep(i = n - 3;i >= 0;i-=2) { | ^~~
s788778465
p03672
C++
#include <iostream> #include <algorithm> #include <cstring> #include <string> #include <vector> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.size(); i++) { s.pop_back(); if (s.size() == 2) { if (s[0] == s[1]) { cout << s.size() << endl; } } else (s.size() == 1) { cout << s.size() << endl; } if (s.size() % 2 == 0) { int num = s.size() / 2; if (s.substr(0, num) == s.substr(num, s.size())) { cout << s.size() << endl; } } } return 0; }
a.cc: In function 'int main()': a.cc:20:31: error: expected ';' before '{' token 20 | } else (s.size() == 1) { | ^~ | ;
s412650360
p03672
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { string s;cin>>s; while (s.size()>0) { s.pop_back(); if (s.size()%2!=0) continue; rep(i,n/2) if (s[i]!=s[i+n/2]) continue; cout << s.size(); return 0; } }
a.cc: In function 'int main()': a.cc:10:11: error: 'n' was not declared in this scope 10 | rep(i,n/2) if (s[i]!=s[i+n/2]) continue; | ^ a.cc:3:45: note: in definition of macro 'rep' 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^
s464434053
p03672
C++
#include<iostream> #include<vector> #include <cmath> #include <map> #include <algorithm> #include <string.h> using namespace std; int main(void){ 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;
a.cc: In function 'int main()': a.cc:19:11: error: expected '}' at end of input 19 | return 0; | ^ a.cc:8:15: note: to match this '{' 8 | int main(void){ | ^
s716960180
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int ans = 0; if (S.size() % 2 == 1) { S.erase(S.size() - 1); } for (int i = S.size(); i >= 0; i-=2) { bool judge = true; for (int j = 0; j < i / 2 j++) { if (S[j] != S[j + (i / 2)]) judge = false; } if (judge) ans = i; break; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:30: error: expected ';' before 'j' 12 | for (int j = 0; j < i / 2 j++) { | ^~ | ;
s796287197
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int ans = 0; if (S % 2 == 1) { S.erase(S.size() - 1); } for (int i = S.size(); i >= 0; i-=2) { bool judge = true; for (int j = 0; j < i / 2 j++) { if (S[j] != S[j + (i / 2)]) judge = false; } if (judge) ans = i; break; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 7 | if (S % 2 == 1) { | ~ ^ ~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 7 | if (S % 2 == 1) { | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 7 | if (S % 2 == 1) { | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:7:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 7 | if (S % 2 == 1) { | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 7 | if (S % 2 == 1) { | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:7:11: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 7 | if (S % 2 == 1) { | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const valarray<_Tp>&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 7 | if (S % 2 == 1) { | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:7:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 7 | if (S % 2 == 1) { | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:7:11: note: mismatched types 'const std::valarray<_Tp>' and 'int' 7 | if (S % 2 == 1) { | ^ a.cc:12:30: error: expected ';' before 'j' 12 | for (int j = 0; j < i / 2 j++) { | ^~ | ;
s864412948
p03672
C++
#define _USE_MATH_DEFINES #include <bits/stdc++.h> #define dump(x) cout << x << '\n' typedef int64_t Int; const double pi = M_PI; using namespace std; int main() { string n; cin >> n; string a, b; for (int i = 0; i < n.size(); i++) { if (n.size() - i % 2 == 0) { a = n.substr(0, (n.size() - i) / 2); b = n.substr((n.size() - i) / 2, n.size()); if (a == b) { cout << n.size() - i << endl; break } } } cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:22:22: error: expected ';' before '}' token 22 | break | ^ | ; 23 | } | ~
s196289780
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans=0; for(int i=s.size()-3;i>0;i-=2){ int count=0; for(int j=0;j<=(i/2);j++){ if(s.at(j)==s.at(j+((i+1)/2)) count++; } if(count==((i+1)/2)){ ans=i+1; break; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:11:42: error: expected ';' before 'count' 11 | if(s.at(j)==s.at(j+((i+1)/2)) count++; | ^~~~~~ | ; a.cc:12:9: error: expected primary-expression before '}' token 12 | } | ^ a.cc:11:51: error: expected ')' before '}' token 11 | if(s.at(j)==s.at(j+((i+1)/2)) count++; | ~ ^ | ) 12 | } | ~ a.cc:12:9: error: expected primary-expression before '}' token 12 | } | ^
s401039695
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans=0; for(int i=s.size()-3;s>0;s-=2){ int count=0; for(int j=0;j<=(i/2);j++){ if(s.at(j)==s.at(j+((i+1)/2)) count++; } if(count==((i+1)/2)){ ans=i+1; break; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:27: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 8 | for(int i=s.size()-3;s>0;s-=2){ | ~^~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} 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:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed: a.cc:8:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/bits/regex.h:1236: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>&)' 1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed: a.cc:8:28: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/bits/regex.h:1329: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>&)' 1329 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed: a.cc:8:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed: a.cc:8:28: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1497 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed: a.cc:8:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed: a.cc:8:28: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1673 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed: a.cc:8:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ 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:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed: a.cc:8:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 462 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: a.cc:8:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 507 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: a.cc:8:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1714 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed: a.cc:8:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1774 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed: a.cc:8:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ 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:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 695 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed: a.cc:8:28: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/string_view:702: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> >)' 702 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed: a.cc:8:28: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/string_view:710: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>)' 710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed: a.cc:8:28: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 8 | for(int i=s.size()-3;s>0;s-=2){ | ^ /usr/include/c++/14/bits/basic_string.h:3915: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>&)' 3915 | operator>(const basic_str
s593391921
p03672
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int c=0; for(int i=s.length()-2;i>=0;i--){ if(s[i]==s[s.length()-1]){if((s.length()-i)%2==0)cout<<s.length()-i;break;else continue ;} } }
a.cc: In function 'int main()': a.cc:6:76: error: expected '}' before 'else' 6 | if(s[i]==s[s.length()-1]){if((s.length()-i)%2==0)cout<<s.length()-i;break;else continue ;} | ~ ^~~~ a.cc: At global scope: a.cc:9:1: error: expected declaration before '}' token 9 | } | ^
s990279795
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int sl = s.size(); for(int i = 1;i < s.size()/2;i++) { sl - = 2; if(s.substr(0,sl/2) == s.substr(sl/2,sl/2)) { break; } } cout << sl << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:22: error: expected primary-expression before '=' token 10 | sl - = 2; | ^
s238703371
p03672
C++
#include <bits/stdc++.h> using namespace std; int main(){ string S;cin>>S; while(1){ S.erase(S.size()-2,2); for(int i=0;i<S.size()/2;i++)if(S.at(i)!=S.at(i+S.size()/2))break; if(i==S.size()/2)break; } cout<<S<<endl; }
a.cc: In function 'int main()': a.cc:8:8: error: 'i' was not declared in this scope 8 | if(i==S.size()/2)break; | ^
s382944537
p03672
C++
#include <bits/stdc++.h> using namespace std; int main(){ string S; cin >> S; if(S.length==4){ cout<<2<<endl: return 0; } for(int i=2;i<S.length()+1;i=i+2){ S=S.erase(S.length()-2); if(S.substr(S.length()/2)==S.substr(0,S.length()/2)){ cout<<S.length()<<endl; return 0; } } return 0; }
a.cc: In function 'int main()': a.cc:7:8: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 7 | if(S.length==4){ | ~~^~~~~~ | () a.cc:8:18: error: expected ';' before ':' token 8 | cout<<2<<endl: | ^ | ;
s936811035
p03672
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; template<typename T> void out(T x) { cout << x << endl; exit(0); } #define watch(x) cout << (#x) << " is " << (x) << endl const int maxn = 1e6 + 5; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string s; cin>>s; s.pop_back() s.pop_back(); while (1) { int n = s.length(); if (s.substr(0,n/2) == s.substr(n/2)) out(n); s.pop_back(); s.pop_back(); } assert(0); return 0; }
a.cc: In function 'int main()': a.cc:15:15: error: expected ';' before 's' 15 | s.pop_back() s.pop_back(); | ^~ | ;
s115978886
p03672
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; template<typename T> void out(T x) { cout << x << endl; exit(0); } #define watch(x) cout << (#x) << " is " << (x) << endl const int maxn = 1e6 + 5; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string s; cin>>s; s.pop_back() s.pop_back(); while (1) { int n = s.length(); if (s.substr(0,n/2) == s.substr(n/2)) out(n); s.pop_back() s.pop_back(); } assert(0); return 0; }
a.cc: In function 'int main()': a.cc:15:15: error: expected ';' before 's' 15 | s.pop_back() s.pop_back(); | ^~ | ; a.cc:19:17: error: expected ';' before 's' 19 | s.pop_back() s.pop_back(); | ^~ | ;
s763977265
p03672
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; template<typename T> void out(T x) { cout << x << endl; exit(0); } #define watch(x) cout << (#x) << " is " << (x) << endl const int maxn = 1e6 + 5; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); stirng s; cin>>s; s.pop_back() s.pop_back(); while (1) { int n = s.length(); if (s.substr(0,n/2) == s.substr(n/2)) out(n); s.pop_back() s.pop_back(); } assert(0); return 0; }
a.cc: In function 'int main()': a.cc:14:3: error: 'stirng' was not declared in this scope 14 | stirng s; cin>>s; | ^~~~~~ a.cc:14:18: error: 's' was not declared in this scope 14 | stirng s; cin>>s; | ^
s154005042
p03672
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; for(int i=1;i<=s.length();i++){ if(s.length()%2==0){ string str = s.substr(0,s.length()/2-1-(i-1)); if(equal(str.begin(), str.end(), s.substr(s.length()/2,s.length()/2-1-(i-1)))){ cout << s.length()-i; break; } } } }
In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'static bool std::__equal<_BoolType>::equal(_II1, _II1, _II2) [with _II1 = char*; _II2 = std::__cxx11::basic_string<char>; bool _BoolType = false]': /usr/include/c++/14/bits/stl_algobase.h:1245:43: required from 'bool std::__equal_aux1(_II1, _II1, _II2) [with _II1 = char*; _II2 = __cxx11::basic_string<char>]' 1245 | return std::__equal<__simple>::equal(__first1, __last1, __first2); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1253:31: required from 'bool std::__equal_aux(_II1, _II1, _II2) [with _II1 = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _II2 = __cxx11::basic_string<char>]' 1253 | return std::__equal_aux1(std::__niter_base(__first1), | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1254 | std::__niter_base(__last1), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1255 | std::__niter_base(__first2)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1592:30: required from 'bool std::equal(_II1, _II1, _II2) [with _II1 = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _II2 = __cxx11::basic_string<char>]' 1592 | return std::__equal_aux(__first1, __last1, __first2); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:10:15: required from here 10 | if(equal(str.begin(), str.end(), s.substr(s.length()/2,s.length()/2-1-(i-1)))){ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1195:58: error: no match for 'operator++' (operand type is 'std::__cxx11::basic_string<char>') 1195 | for (; __first1 != __last1; ++__first1, (void) ++__first2) | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1196:32: error: no match for 'operator*' (operand type is 'std::__cxx11::basic_string<char>') 1196 | if (!(*__first1 == *__first2)) | ^~~~~~~~~ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)' 400 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:400:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)' 409 | operator*(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:409:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)' 418 | operator*(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:418:5: note: candidate expects 2 arguments, 1 provided In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: candidate expects 2 arguments, 1 provided
s094873440
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; }
a.cc:1:9: fatal error: stdio .h: No such file or directory 1 | #include<stdio .h> | ^~~~~~~~~~ compilation terminated.
s155577606
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.
s418247904
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string a; cin>>a; for(int i=1;i<=a.length()/2;i++){ a.pop_back();a.pop_back(); for(int j=0;j<a.length()/2;j++){ if(a.at(i)!=a.at(i+a.length()/2))break; else{cout<<i*2<<endl;}} }
a.cc: In function 'int main()': a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s261006350
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string a; cin>>a; for(int i=1;i<=a.length()/2;i++){ a.pop_back();a.pop_back(); for(int j=0;j<a.length()/2;j++){ if(a.at(i)!=a.at(i+a.length()/2))break;} else{cout<<i*2<<endl;} }
a.cc: In function 'int main()': a.cc:13:5: error: 'else' without a previous 'if' 13 | else{cout<<i*2<<endl;} | ^~~~ a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s964177387
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string a; cin>>a; for(int i=1;i<=a.length()/2;i++;){ a.pop_back();a.pop_back(); for(int j=0;j<a.length()/2;j++){ if(a.at(i)!=a.at(i+a.length()/2))break;} else{cout<<i*2<<endl;} }
a.cc: In function 'int main()': a.cc:9:34: error: expected ')' before ';' token 9 | for(int i=1;i<=a.length()/2;i++;){ | ~ ^ | ) a.cc:9:35: error: expected primary-expression before ')' token 9 | for(int i=1;i<=a.length()/2;i++;){ | ^ a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s278530287
p03672
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); char[] c = sc.next().toCharArray(); int N = c.length; boolean b = true; boolean dame = false; int ans ; for(int i = 2;i<N;i+=2) { dame = false; for(int k = 0;k<(N-i)/2;k++) { if(c[k]!=c[k+(N-i)/2]) { dame=true; break; } } if(!dame) ans = N-i; } System.out.println(ans); } }
Main.java:23: error: variable ans might not have been initialized System.out.println(ans); ^ 1 error
s554192218
p03672
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); char[] c = sc.next().toCharArray(); boolean b = true; boolean dame = false; int ans ; for(int i = 2;i<N;i+=2) { dame = false; for(int k = 0;k<(N-i)/2;k++) { if(c[k]!=c[k+(N-i)/2]) { dame=true; break; } } if(!dame) ans = N-i; } System.out.println(ans); } }
Main.java:9: error: cannot find symbol for(int i = 2;i<N;i+=2) ^ symbol: variable N location: class Main Main.java:12: error: cannot find symbol for(int k = 0;k<(N-i)/2;k++) ^ symbol: variable N location: class Main Main.java:14: error: cannot find symbol if(c[k]!=c[k+(N-i)/2]) ^ symbol: variable N location: class Main Main.java:20: error: cannot find symbol if(!dame) ans = N-i; ^ symbol: variable N location: class Main 4 errors
s002723477
p03672
C++
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int frr[28]={0}; int arr[28]={0}; for(int i=0;i<s.size();i++) { frr[s[i]-'a']++; } for(int i=s.size()-1;i>=0;i--) { frr[s[i]-'a']--; arr[s[i]-'a']++; int counter=0; for(int i=0;i<28;i++) { if(frr[i]%2==1) { counter++; break; } } if(counter==0&&i%2==0) { int flag=0; for(int i=0;i<28;i++) { if(arr[i]%2==1) { flag++; break; } } if(flag==0) { cout<<max(i,s.size()-i)<<endl; return 0; } } } }
a.cc: In function 'int main()': a.cc:40:26: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)' 40 | cout<<max(i,s.size()-i)<<endl; | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:40:26: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}) 40 | cout<<max(i,s.size()-i)<<endl; | ~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:40:26: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 40 | cout<<max(i,s.size()-i)<<endl; | ~~~^~~~~~~~~~~~~~
s731977750
p03672
C++
#include <bits/stdc++.h> using namespace std; signed main(){ string a,b,c; int b; cin>>a; for(int i=0;i<a.size();i++){ if((a.size()-i)%2==0){ for(int j=0;j<(a.size()-i)/2;j++){ b+=a[j]; } for(int j=(a.size()-i)/2;j<a.size()-i;j++){ c+=a[j]; } if(b==c){ d=b.size(); break; } string b,c; } } cout<<d<<"\n"; }
a.cc: In function 'int main()': a.cc:5:7: error: conflicting declaration 'int b' 5 | int b; | ^ a.cc:4:12: note: previous declaration as 'std::string b' 4 | string a,b,c; | ^ a.cc:16:9: error: 'd' was not declared in this scope 16 | d=b.size(); | ^ a.cc:22:9: error: 'd' was not declared in this scope 22 | cout<<d<<"\n"; | ^
s796120620
p03672
Java
import org.assertj.core.util.Strings; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println(execute(sc.nextLine())); } public static int execute(String base) { EvenString evenString = new EvenString(base); do{ evenString.cut(); }while (!evenString.isEvenString()); return evenString.length(); } public static List<String> splitByLength(String s, int length) { List<String> list = new ArrayList<>(); if (!Strings.isNullOrEmpty(s)) { Matcher m = Pattern.compile("[\\s\\S]{1," + length + "}").matcher(s); while (m.find()) { list.add(m.group()); } } return list; } private static class EvenString { String base; String first; String second; public EvenString(String base){ this.split(base); } private void split(String base){ this.base = base; int length = base.length() / 2; List<String> separated = splitByLength(base,length); this.first = separated.get(0); this.second = separated.get(1); } public boolean isEvenString(){ return first.equals(second); } public int length(){ return base.length(); } public void cut() { String newBase = base.substring(0,base.length()-2); this.split(newBase); } } }
Main.java:1: error: package org.assertj.core.util does not exist import org.assertj.core.util.Strings; ^ Main.java:28: error: cannot find symbol if (!Strings.isNullOrEmpty(s)) { ^ symbol: variable Strings location: class Main 2 errors
s285774172
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; }
a.cc:1:11: fatal error: stdio .h : No such file or directory 1 | # include < stdio .h > | ^~~~~~~~~~~~ compilation terminated.
s401578884
p03672
C++
#include<bits/stdc++.h> 3 4 int main () { 5 char str [222]; 6 scanf ("%s", str ) ; 7 int n= strlen (str ) ; 8 for (int i=n -2; i; i -=2) { 9 if( strncmp (str , str +i/2 , i/2) ==0) { 10 printf ("%d\n" ,i) ; 11 return 0; 12 } 13 } 14 return 0; 15 }
a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 3 | ^
s756067757
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; }
a.cc:1:11: fatal error: stdio .h : No such file or directory 1 | # include < stdio .h > | ^~~~~~~~~~~~ compilation terminated.
s209211860
p03672
C++
#include<bits/stdc++.h> using namespace std; int isEvenstr(string s){ if(s.size()%2!=0)return 0; if(s.substr(0,s.size()/2)+s.substr(0,s.size()/2)==s)return 1; return 0; } int main(){ string s; cin>>s; for(i=s.size();0<i;i--){ if(isEvenstr(s.substr(0,i))==1){ cout<<i; return 0; } } }
a.cc: In function 'int main()': a.cc:13:7: error: 'i' was not declared in this scope 13 | for(i=s.size();0<i;i--){ | ^
s115636926
p03672
C++
#include<bits/stdc++.h> using namespace std; int isEvenstr(string s){ if(s.size()%2!=0)return 0; if(s.substr(0,s.size/2)+s.substr(0,s.size/2)==s)return 1; return 0; } int main(){ string s; cin>>s; for(i=s.size;0<i;i--){ if(isEvenstr(s.substr(0,i))==1){ cout<<i; return 0; } } }
a.cc: In function 'int isEvenstr(std::string)': a.cc:6:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 6 | if(s.substr(0,s.size/2)+s.substr(0,s.size/2)==s)return 1; | ~~^~~~ | () a.cc:6:40: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 6 | if(s.substr(0,s.size/2)+s.substr(0,s.size/2)==s)return 1; | ~~^~~~ | () a.cc: In function 'int main()': a.cc:13:7: error: 'i' was not declared in this scope 13 | for(i=s.size;0<i;i--){ | ^
s842124057
p03672
C++
#include<bits/stdc++.h> using namespace std; main(){ string s; cin>>s; int n=s.size(); int ans=0; for(int i=0;i<n;++i){ int len=n-i; if(len%2!=0)continue; int half=len/2; string ss=s.substr(0,half); string tt=s.substr(half,falf); if(ss==tt){ cout<<ss.size()<<endl; return 0; } } cout<<0<<endl; }
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:13:29: error: 'falf' was not declared in this scope; did you mean 'half'? 13 | string tt=s.substr(half,falf); | ^~~~ | half
s695193743
p03672
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define double long double #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) #define fi first #define se second #define co(a) cout<<a<<endl #define sz size() #define bgn begin() #define en end() #define pb(a) push_back(a) #define pp() pop_back() #define V vector #define P pair #define V2(a,b,c) V<V<int>> a(b,V<int>(c)) #define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d)) #define incin(a) int a; cin>>a #define yuko(a) setprecision(a) #define uni(a) a.erase(unique(a.begin(),a.end()),a.end()) #define pri priority_queue #define syo <int,V<int> #define ff fi.fi #define fs fi.se #define sf se.fi #define ss se.se #define all(a) (a).begin(),(a).end() #define Pi P<int,int> #define elif else if //#define min min<int> //#define max max<int> int low(V<int> a,int b){ decltype(a)::iterator c=lower_bound(a.begin(),a.end(),b); int d=c-a.bgn; return d; } int upp(V<int> a,int b){ decltype(a)::iterator c=upper_bound(a.begin(),a.end(),b); int d=c-a.bgn; return d; } template<class T> void cou(vector<vector<T>> a){ int b=a.size(); int c=a[0].size(); fo(i,b){ fo(j,c){ cout<<a[i][j]; if(j==c-1) cout<<endl; else cout<<' '; } } } /*template<> void cou(vector<vector<char>> a){ int b=a.size(); int c=a[0].size(); fo(i,b){ fo(j,c){ cout<<a[i][j]; if(j==c-1) cout<<endl; else cout<<' '; } } }*/ int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int a){ return a*(a+1)/2; } /*int lcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return d*e/f; } */ int gcm(int a,int b){ if(a%b==0) return b; return gcm(b,a%b); } bool prime(int a){ if(a<2) return false; else if(a==2) return true; else if(a%2==0) return false; double b=sqrt(a); for(int i=3;i<=b;i+=2){ if(a%i==0){ return false; } } return true; } struct Union{ vector<int> par; Union(int a){ par= vector<int>(a,-1); } int find(int a){ if(par[a]<0) return a; else return par[a]=find(par[a]); } bool same(int a,int b){ return find(a)==find(b); } int Size(int a){ return -par[find(a)]; } void unite(int a,int b){ a=find(a); b=find(b); if(a==b) return; if(Size(b)>Size(a)) swap<int>(a,b); par[a]+=par[b]; par[b]=a; } }; int ketas(int a){ string b=to_string(a); int c=0; fo(i,keta(a)){ c+=b[i]-'0'; } return c; } /*int gcm(int a,int b){ if(b==0) return a; return gcm(b,a%b); }*/ int lcm(int a,int b){ return a/gcm(a,b)*b; } /*struct aa{ vector<int> gt; aa(int n){ gt= vector<int>(n, 1); } void c(V<int> d,int b){ if(d[b]==0){ gt[d[b]-1]++; gt[gt.sz-1]++; } else{ gt[d[b]-1]++; c(d,d[d[b]]-1); } } void cok(int a){ cout<<gt[a-1]<<endl; fo(i,a-1) cout<<gt[i]<<endl; } }; */ /*struct dfs(){ }*/ bool fe(int a,int b){ a%=10; b%=10; if(a==0) a=10; if(b==0) b=10; if(a>b) return true; else return false; } int INF=1000000007; struct edge{int s,t,d; }; V<int> mojisyu(string a){ V<int> b(26,0); fo(i,a.sz){ b[a[i]-'a']++; } return b; } int wa2(int a){ if(a%2==1) return a/2; return a/2-1; } /*signed main(){ int a,b,c; cin>>a>>b>>c; V<V<edge>> d(a); fo(i,b){ edge e; cin>>e.s>>e.t>>e.d; d[e.s].pb(e); } V<int> e(a,INF); e[c]=0; priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f; f.push({0,c}); int h=INF; while(!f.empty()){ P<int,int> g; g=f.top(); f.pop(); int v = g.second, i = g.first; for(edge l : d[v]){ if(e[l.t] > i + l.d){ e[l.t] = i + l.d; f.push({i+l.d , l.t}); } } } fo(i,a){ if(e[i]==INF) cout<<"INF"<<endl; else cout<<e[i]<<endl; } } ?*/ signed main(){ string a,b,c; cin>>a; int d=2; fo(i,a.sz){ a.back(); if(a.sz%2==1) continue; b=a.substr(a.bgn,a.sz/2); c=a.substr(a.bgn+a.sz/2); if(b==c){ d=a.sz; break; } } cout<<d<<endl; }
a.cc: In function 'int main()': a.cc:260:11: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&]', declared with attribute 'nodiscard' [-Wunused-result] 260 | a.back(); | ~~~~~~^~ In file included 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, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:1350:7: note: declared here 1350 | back() noexcept | ^~~~ a.cc:12:18: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 12 | #define bgn begin() | ^ | | | std::__cxx11::basic_string<char>::iterator a.cc:263:18: note: in expansion of macro 'bgn' 263 | b=a.substr(a.bgn,a.sz/2); | ^~~ /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:264:21: error: cannot convert '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 264 | c=a.substr(a.bgn+a.sz/2); | ~~~~~^~~~~~~ | | | __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> > /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~
s969356068
p03672
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define double long double #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) #define fi first #define se second #define co(a) cout<<a<<endl #define sz size() #define bgn begin() #define en end() #define pb(a) push_back(a) #define pp() pop_back() #define V vector #define P pair #define V2(a,b,c) V<V<int>> a(b,V<int>(c)) #define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d)) #define incin(a) int a; cin>>a #define yuko(a) setprecision(a) #define uni(a) a.erase(unique(a.begin(),a.end()),a.end()) #define pri priority_queue #define syo <int,V<int> #define ff fi.fi #define fs fi.se #define sf se.fi #define ss se.se #define all(a) (a).begin(),(a).end() #define Pi P<int,int> #define elif else if //#define min min<int> //#define max max<int> int low(V<int> a,int b){ decltype(a)::iterator c=lower_bound(a.begin(),a.end(),b); int d=c-a.bgn; return d; } int upp(V<int> a,int b){ decltype(a)::iterator c=upper_bound(a.begin(),a.end(),b); int d=c-a.bgn; return d; } template<class T> void cou(vector<vector<T>> a){ int b=a.size(); int c=a[0].size(); fo(i,b){ fo(j,c){ cout<<a[i][j]; if(j==c-1) cout<<endl; else cout<<' '; } } } /*template<> void cou(vector<vector<char>> a){ int b=a.size(); int c=a[0].size(); fo(i,b){ fo(j,c){ cout<<a[i][j]; if(j==c-1) cout<<endl; else cout<<' '; } } }*/ int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int a){ return a*(a+1)/2; } /*int lcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return d*e/f; } */ int gcm(int a,int b){ if(a%b==0) return b; return gcm(b,a%b); } bool prime(int a){ if(a<2) return false; else if(a==2) return true; else if(a%2==0) return false; double b=sqrt(a); for(int i=3;i<=b;i+=2){ if(a%i==0){ return false; } } return true; } struct Union{ vector<int> par; Union(int a){ par= vector<int>(a,-1); } int find(int a){ if(par[a]<0) return a; else return par[a]=find(par[a]); } bool same(int a,int b){ return find(a)==find(b); } int Size(int a){ return -par[find(a)]; } void unite(int a,int b){ a=find(a); b=find(b); if(a==b) return; if(Size(b)>Size(a)) swap<int>(a,b); par[a]+=par[b]; par[b]=a; } }; int ketas(int a){ string b=to_string(a); int c=0; fo(i,keta(a)){ c+=b[i]-'0'; } return c; } /*int gcm(int a,int b){ if(b==0) return a; return gcm(b,a%b); }*/ int lcm(int a,int b){ return a/gcm(a,b)*b; } /*struct aa{ vector<int> gt; aa(int n){ gt= vector<int>(n, 1); } void c(V<int> d,int b){ if(d[b]==0){ gt[d[b]-1]++; gt[gt.sz-1]++; } else{ gt[d[b]-1]++; c(d,d[d[b]]-1); } } void cok(int a){ cout<<gt[a-1]<<endl; fo(i,a-1) cout<<gt[i]<<endl; } }; */ /*struct dfs(){ }*/ bool fe(int a,int b){ a%=10; b%=10; if(a==0) a=10; if(b==0) b=10; if(a>b) return true; else return false; } int INF=1000000007; struct edge{int s,t,d; }; V<int> mojisyu(string a){ V<int> b(26,0); fo(i,a.sz){ b[a[i]-'a']++; } return b; } int wa2(int a){ if(a%2==1) return a/2; return a/2-1; } /*signed main(){ int a,b,c; cin>>a>>b>>c; V<V<edge>> d(a); fo(i,b){ edge e; cin>>e.s>>e.t>>e.d; d[e.s].pb(e); } V<int> e(a,INF); e[c]=0; priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f; f.push({0,c}); int h=INF; while(!f.empty()){ P<int,int> g; g=f.top(); f.pop(); int v = g.second, i = g.first; for(edge l : d[v]){ if(e[l.t] > i + l.d){ e[l.t] = i + l.d; f.push({i+l.d , l.t}); } } } fo(i,a){ if(e[i]==INF) cout<<"INF"<<endl; else cout<<e[i]<<endl; } } ?*/ signed main(){ string a,b,c; cin>>a; int d=2; fo(i,a.sz){ a.back(); if(a%2==1) continue; b=a.substr(a.bgn,a.sz/2); c=a.substr(a.bgn+a.sz/2); if(b==c){ d=a.sz; break; } } cout<<d<<endl; }
a.cc: In function 'int main()': a.cc:260:11: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&]', declared with attribute 'nodiscard' [-Wunused-result] 260 | a.back(); | ~~~~~~^~ In file included 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, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:1350:7: note: declared here 1350 | back() noexcept | ^~~~ a.cc:261:9: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 261 | if(a%2==1) | ~^~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:261:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 261 | if(a%2==1) | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:261:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 261 | if(a%2==1) | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:261:10: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 261 | if(a%2==1) | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:261:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 261 | if(a%2==1) | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:261:10: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 261 | if(a%2==1) | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const valarray<_Tp>&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:261:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 261 | if(a%2==1) | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:261:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 261 | if(a%2==1) | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:261:10: note: mismatched types 'const std::valarray<_Tp>' and 'int' 261 | if(a%2==1) | ^ a.cc:12:18: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 12 | #define bgn begin() | ^ | | | std::__cxx11::basic_string<char>::iterator a.cc:263:18: note: in expansion of macro 'bgn' 263 | b=a.substr(a.bgn,a.sz/2); | ^~~ /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:264:21: error: cannot convert '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 264 | c=a.substr(a.bgn+a.sz/2); | ~~~~~^~~~~~~ | | | __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> > /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~
s396312846
p03672
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define double long double #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) #define fi first #define se second #define co(a) cout<<a<<endl #define sz size() #define bgn begin() #define en end() #define pb(a) push_back(a) #define pp() pop_back() #define V vector #define P pair #define V2(a,b,c) V<V<int>> a(b,V<int>(c)) #define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d)) #define incin(a) int a; cin>>a #define yuko(a) setprecision(a) #define uni(a) a.erase(unique(a.begin(),a.end()),a.end()) #define pri priority_queue #define syo <int,V<int> #define ff fi.fi #define fs fi.se #define sf se.fi #define ss se.se #define all(a) (a).begin(),(a).end() #define Pi P<int,int> #define elif else if //#define min min<int> //#define max max<int> int low(V<int> a,int b){ decltype(a)::iterator c=lower_bound(a.begin(),a.end(),b); int d=c-a.bgn; return d; } int upp(V<int> a,int b){ decltype(a)::iterator c=upper_bound(a.begin(),a.end(),b); int d=c-a.bgn; return d; } template<class T> void cou(vector<vector<T>> a){ int b=a.size(); int c=a[0].size(); fo(i,b){ fo(j,c){ cout<<a[i][j]; if(j==c-1) cout<<endl; else cout<<' '; } } } /*template<> void cou(vector<vector<char>> a){ int b=a.size(); int c=a[0].size(); fo(i,b){ fo(j,c){ cout<<a[i][j]; if(j==c-1) cout<<endl; else cout<<' '; } } }*/ int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int a){ return a*(a+1)/2; } /*int lcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return d*e/f; } */ int gcm(int a,int b){ if(a%b==0) return b; return gcm(b,a%b); } bool prime(int a){ if(a<2) return false; else if(a==2) return true; else if(a%2==0) return false; double b=sqrt(a); for(int i=3;i<=b;i+=2){ if(a%i==0){ return false; } } return true; } struct Union{ vector<int> par; Union(int a){ par= vector<int>(a,-1); } int find(int a){ if(par[a]<0) return a; else return par[a]=find(par[a]); } bool same(int a,int b){ return find(a)==find(b); } int Size(int a){ return -par[find(a)]; } void unite(int a,int b){ a=find(a); b=find(b); if(a==b) return; if(Size(b)>Size(a)) swap<int>(a,b); par[a]+=par[b]; par[b]=a; } }; int ketas(int a){ string b=to_string(a); int c=0; fo(i,keta(a)){ c+=b[i]-'0'; } return c; } /*int gcm(int a,int b){ if(b==0) return a; return gcm(b,a%b); }*/ int lcm(int a,int b){ return a/gcm(a,b)*b; } /*struct aa{ vector<int> gt; aa(int n){ gt= vector<int>(n, 1); } void c(V<int> d,int b){ if(d[b]==0){ gt[d[b]-1]++; gt[gt.sz-1]++; } else{ gt[d[b]-1]++; c(d,d[d[b]]-1); } } void cok(int a){ cout<<gt[a-1]<<endl; fo(i,a-1) cout<<gt[i]<<endl; } }; */ /*struct dfs(){ }*/ bool fe(int a,int b){ a%=10; b%=10; if(a==0) a=10; if(b==0) b=10; if(a>b) return true; else return false; } int INF=1000000007; struct edge{int s,t,d; }; V<int> mojisyu(string a){ V<int> b(26,0); fo(i,a.sz){ b[a[i]-'a']++; } return b; } int wa2(int a){ if(a%2==1) return a/2; return a/2-1; } /*signed main(){ int a,b,c; cin>>a>>b>>c; V<V<edge>> d(a); fo(i,b){ edge e; cin>>e.s>>e.t>>e.d; d[e.s].pb(e); } V<int> e(a,INF); e[c]=0; priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f; f.push({0,c}); int h=INF; while(!f.empty()){ P<int,int> g; g=f.top(); f.pop(); int v = g.second, i = g.first; for(edge l : d[v]){ if(e[l.t] > i + l.d){ e[l.t] = i + l.d; f.push({i+l.d , l.t}); } } } fo(i,a){ if(e[i]==INF) cout<<"INF"<<endl; else cout<<e[i]<<endl; } } ?*/ signed main(){ string a,b,c; cin>>a; int d=2; fo(i,a.sz){ a.back(); if(a%2) continue; b=a.substr(a.bgn,a.sz/2); c=a.substr(a.bgn+a.sz/2); if(b==c){ d=a.sz; break; } } cout<<d<<endl; }
a.cc: In function 'int main()': a.cc:260:11: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&]', declared with attribute 'nodiscard' [-Wunused-result] 260 | a.back(); | ~~~~~~^~ In file included 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, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:1350:7: note: declared here 1350 | back() noexcept | ^~~~ a.cc:261:9: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 261 | if(a%2) | ~^~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:261:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 261 | if(a%2) | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:261:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 261 | if(a%2) | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:261:10: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 261 | if(a%2) | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:261:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 261 | if(a%2) | ^ /usr/include/c++/14/bits/valarray_after.h:409:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 409 | _DEFINE_EXPR_BINARY_OPERATOR(%, struct std::__modulus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed: a.cc:261:10: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 261 | if(a%2) | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const valarray<_Tp>&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:261:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 261 | if(a%2) | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:261:10: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 261 | if(a%2) | ^ /usr/include/c++/14/valarray:1200:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__modulus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__modulus, _Tp>::result_type> std::operator%(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1200 | _DEFINE_BINARY_OPERATOR(%, __modulus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1200:1: note: template argument deduction/substitution failed: a.cc:261:10: note: mismatched types 'const std::valarray<_Tp>' and 'int' 261 | if(a%2) | ^ a.cc:12:18: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 12 | #define bgn begin() | ^ | | | std::__cxx11::basic_string<char>::iterator a.cc:263:18: note: in expansion of macro 'bgn' 263 | b=a.substr(a.bgn,a.sz/2); | ^~~ /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~ a.cc:264:21: error: cannot convert '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 264 | c=a.substr(a.bgn+a.sz/2); | ~~~~~^~~~~~~ | | | __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> > /usr/include/c++/14/bits/basic_string.h:3208:24: note: initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 3208 | substr(size_type __pos = 0, size_type __n = npos) const | ~~~~~~~~~~^~~~~~~~~
s805253024
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string w; cin >> w; for (int i = w.size()-3; i >= 0; i-=2){ if(w[i] == w[(i/2)] ){ cout << i << endl; } return 0; } } }
a.cc:20:1: error: expected declaration before '}' token 20 | } | ^
s707616314
p03672
C++
#include <bits/stdc++.h> using namespace std; int main() { string w; cin >> w; for (int i = w.size()-2; i >= 0; i-=2){ if(w[i] == w[(i/2)] ){ cout << i << endl; } return 0; } } }
a.cc:20:1: error: expected declaration before '}' token 20 | } | ^
s269232723
p03672
Java
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner kbd = new Scanner(System.in); String s = sc.next(); int x = 0; for(int i = s.length()-1 ; i>0 ; i--){ s = s.substring(0,i); String s1 = s.substring(0,i/2); String s2 = s.substring(i/2,i); if(s1.epuals(s2)){ x = i; break; } } } }
Main.java:6: error: cannot find symbol String s = sc.next(); ^ symbol: variable sc location: class Main Main.java:15: error: cannot find symbol if(s1.epuals(s2)){ ^ symbol: method epuals(String) location: variable s1 of type String 2 errors
s638165403
p03672
Java
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner kbd = new Scanner(System.in); String s = sc.next(); int x = 0; for(int i = s.length()-1 ; i>0 ; i--){ s = s.substring(0,i); String s1 = s.substring(0,i/2); String s2 = s.substring(i/2,i); if(s1.epuals(s2)){ x = i; break; } } } }
Main.java:6: error: cannot find symbol String s = sc.next(); ^ symbol: variable sc location: class Main Main.java:15: error: cannot find symbol if(s1.epuals(s2)){ ^ symbol: method epuals(String) location: variable s1 of type String 2 errors
s598172246
p03672
C++
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { string S; cin >> S; bool flag = true; for (int i = 1; i < (S.length()-1); i++){ flag = true; for (int j = 0; j < (S.length()-i); j++){ if ((S.length()-i) % 2 == 0){ for (int k = 0; k < ((S.length()-i) / 2); k++){ if (S[k] != S[((S.length()-i) / 2) + k]){ flag = false; break; } } } if (flag){ cout << S.length()-i << endl; break; } } if (flag){ break; } } if (flag == false) { cout << 1 << endl; } }
a.cc: In function 'int main()': a.cc:5:5: error: 'string' was not declared in this scope 5 | string S; | ^~~~~~ a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin >> S; | ^~~ a.cc:6:12: error: 'S' was not declared in this scope 6 | cin >> S; | ^ a.cc:20:17: error: 'cout' was not declared in this scope 20 | cout << S.length()-i << endl; | ^~~~ a.cc:20:41: error: 'endl' was not declared in this scope 20 | cout << S.length()-i << endl; | ^~~~ a.cc:29:9: error: 'cout' was not declared in this scope 29 | cout << 1 << endl; | ^~~~ a.cc:29:22: error: 'endl' was not declared in this scope 29 | cout << 1 << endl; | ^~~~
s423013740
p03672
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { string S; cin >> S; for (int i = 1; i < (S.length()-1); i++){ bool flag = true; for (int j = 0; j < (S.length()-i); j++){ if ((S.length()-i) % 2 == 0){ for (int k = 0; k < ((S.length()-i) / 2); k++){ if (S[k] != S[((S.length()-i) / 2) + k]){ flag = false; break; } } } if (flag){ cout << S.length()-i << endl; break; } } if (flag){ break; } } if (flag == false) { cout << 1 << endl; } }
a.cc: In function 'int main()': a.cc:30:9: error: 'flag' was not declared in this scope 30 | if (flag == false) { | ^~~~
s046820885
p03672
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { string S; cin >> S; for (int i = 1; i < (S.length()-1); i++){ bool flag = true; for (int j = 0; j < (S.length()-i); j++){ if ((S.lenght()-i) % 2 == 0){ for (int k = 0; k < ((S.lenght()-i) / 2); k++){ if (S[k] != S[((S.lenght()-i) / 2) + k]){ flag = false; break; } } } if (flag){ cout << S.lenght()-i << endl; break; } } if (flag){ break; } } if (flag == false;) { cout << 1 << endl; } }
a.cc: In function 'int main()': a.cc:13:20: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 13 | if ((S.lenght()-i) % 2 == 0){ | ^~~~~~ | length a.cc:14:41: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 14 | for (int k = 0; k < ((S.lenght()-i) / 2); k++){ | ^~~~~~ | length a.cc:15:39: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 15 | if (S[k] != S[((S.lenght()-i) / 2) + k]){ | ^~~~~~ | length a.cc:22:27: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 22 | cout << S.lenght()-i << endl; | ^~~~~~ | length a.cc:30:9: error: 'flag' was not declared in this scope 30 | if (flag == false;) { | ^~~~ a.cc:30:23: error: expected primary-expression before ')' token 30 | if (flag == false;) { | ^
s378470750
p03672
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { string S; cin >> S; bool flag = true; for (int i = 1; i < (S.length()-1); i++){ for (int j = 0; j < (S.length()-i), j++){ if ((S.lenght()-i) % 2 == 0){ for (int k = 0; k < ((S.lenght()-i) / 2; k++){ if (S[k] != S[(S.lenght()-i) / 2 + k]){ flag = false; cout << S.lenght()-i << endl; break; } } } if (flag == false){ break; } } if (flag == false){ break; } } if (flag) { cout << 1 << endl; } }
a.cc: In function 'int main()': a.cc:12:48: error: expected ';' before ')' token 12 | for (int j = 0; j < (S.length()-i), j++){ | ^ | ; a.cc:13:20: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 13 | if ((S.lenght()-i) % 2 == 0){ | ^~~~~~ | length a.cc:14:41: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 14 | for (int k = 0; k < ((S.lenght()-i) / 2; k++){ | ^~~~~~ | length a.cc:14:56: error: expected ')' before ';' token 14 | for (int k = 0; k < ((S.lenght()-i) / 2; k++){ | ~ ^ | ) a.cc:15:38: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 15 | if (S[k] != S[(S.lenght()-i) / 2 + k]){ | ^~~~~~ | length a.cc:17:35: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 17 | cout << S.lenght()-i << endl; | ^~~~~~ | length
s921512466
p03672
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { string S; cin >> S; bool flag = true; for (int i = 1; i < S.length()-1; i++){ for (int j = 0; j < S.length()-i, j++){ if ((S.lenght()-i) % 2 == 0){ for (int k = 0; k < (S.lenght()-i) / 2; k++){ if (S[k] != S[(S.lenght()-i) / 2 + k]){ flag = false; cout << S.lenght()-i << endl; break; } } } if (flag == false){ break; } } if (flag == false){ break; } } if (flag) { cout << 1 << endl; } }
a.cc: In function 'int main()': a.cc:12:46: error: expected ';' before ')' token 12 | for (int j = 0; j < S.length()-i, j++){ | ^ | ; a.cc:13:20: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 13 | if ((S.lenght()-i) % 2 == 0){ | ^~~~~~ | length a.cc:14:40: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 14 | for (int k = 0; k < (S.lenght()-i) / 2; k++){ | ^~~~~~ | length a.cc:15:38: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 15 | if (S[k] != S[(S.lenght()-i) / 2 + k]){ | ^~~~~~ | length a.cc:17:35: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'? 17 | cout << S.lenght()-i << endl; | ^~~~~~ | length
s987030603
p03672
C++
#include <bits/stdc++.h> using namespace std; bool func(string s) { for(int i = 0;i < s.size() / 2;i++) { if(s.at(i) != s.at(i + s.size() / 2)) { return false; } } return true; } int main() { string s; cin >> s; while() { s.pop_back(); s.pop_back(); if(func(s)) { cout << s.size() << endl; return 0; } } }
a.cc: In function 'int main()': a.cc:14:9: error: expected primary-expression before ')' token 14 | while() { | ^
s540622854
p03672
C++
#include <bits/stdc++.h> using namespace std; bool func(string s) { for(int i = 0;i < n / 2;i++) { if(s.at(i) != s.at(i + n / 2)) { return false; } } return true; } int main() { string s; cin >> s; while() { s.pop_back(); s.pop_back(); if(func(s)) { cout << s.size() << endl; return 0; } } }
a.cc: In function 'bool func(std::string)': a.cc:4:21: error: 'n' was not declared in this scope 4 | for(int i = 0;i < n / 2;i++) { | ^ a.cc: In function 'int main()': a.cc:14:9: error: expected primary-expression before ')' token 14 | while() { | ^