submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s500985070 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
bool func(stirng 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:3:11: error: 'stirng' was not declared in this scope
3 | bool func(stirng s) {
| ^~~~~~
a.cc: In function 'int main()':
a.cc:14:9: error: expected primary-expression before ')' token
14 | while() {
| ^
a.cc:17:12: error: 'func' cannot be used as a function
17 | if(func(s)) {
| ~~~~^~~
|
s994296003 | p03672 | Java | import java.util.*;
public class Main{
public static void main(Stirng[] args){
Scanner sc = new Scanner(System.in);
String s = sc.next();
boolean p = true;
int n = 0;
s = s.substring(0,s.length()-1);
while(p){
s = s.substring(0,n-1);
n = s.length();
if(n%2==0 && s.substring(0,n/2).equals(s.substring(n/2,n)) ) p = false;
}
System.out.println(s.length());
}
} | Main.java:3: error: cannot find symbol
public static void main(Stirng[] args){
^
symbol: class Stirng
location: class Main
1 error
|
s010534226 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int s=S.size();
int ans;
for (int i=s/2;i>0;i--){
bool a=true
for (int j=0;j<i;j++){
if (S[j]!=S[j+i]){
a=false;
}
}
if (a){
ans=i*2;
break;
}
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'for'
11 | for (int j=0;j<i;j++){
| ^~~
a.cc:11:18: error: 'j' was not declared in this scope
11 | for (int j=0;j<i;j++){
| ^
|
s934785988 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int s=S.size();
int ans;
for (i=s/2;i>0;i--){
bool a=true
for (int j=0;j<i;j++){
if (S[j]!=S[j+i]){
a=false;
}
}
if (a){
ans=i*2;
break;
}
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
9 | for (i=s/2;i>0;i--){
| ^
a.cc:11:5: error: expected ',' or ';' before 'for'
11 | for (int j=0;j<i;j++){
| ^~~
a.cc:11:18: error: 'j' was not declared in this scope
11 | for (int j=0;j<i;j++){
| ^
|
s422856294 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
// マクロ
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
// 型エイリアス
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vvs = vector<vs>;
int main() {
string s;
cin >> s;
int ans = 0;
int stlen = s.size();
for (int i = stlen -3; i > 0; i-= 2){
if (i < 0) break;
if (s.substr(0, i/2) == s.substr(i/2+1, i/2)){
cout << i + 1 << endl;
break;
}
} | a.cc: In function 'int main()':
a.cc:24:6: error: expected '}' at end of input
24 | }
| ^
a.cc:12:12: note: to match this '{'
12 | int main() {
| ^
|
s654865017 | p03672 | C | #include<stdio.h>
#include<string.h>
int main(){
char s[201];
char t[100];
char u[100];
int i,ans;
scanf("%s",s);
int len=strlen(s);
for(i=1; i<=(len/2); i++){
len=len-2*i;
strncpy(t,s+0,len/2);
strncpy(u,s+(len/2)-1,len/2);
if(strncmp(t,u)==0){
ans=len;
break;
}
}
printf("%d\n",ans);
return 0;
} | main.c: In function 'main':
main.c:14:8: error: too few arguments to function 'strncmp'
14 | if(strncmp(t,u)==0){
| ^~~~~~~
In file included from main.c:2:
/usr/include/string.h:159:12: note: declared here
159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
| ^~~~~~~
|
s680815507 | 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++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main(){
string s;
cin>>s;
while(1){
s.push_back;
s.push_back;
if(s.substr(0,s.size()/2)==s.substr(s.size()/2)) break;
}
cout<<s.size()<<endl;
} | a.cc: In function 'int main()':
a.cc:17:7: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
17 | 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: declared here
1572 | push_back(_CharT __c)
| ^~~~~~~~~
a.cc:18:7: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
18 | s.push_back;
| ~~^~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:1572:7: note: declared here
1572 | push_back(_CharT __c)
| ^~~~~~~~~
|
s998029973 | 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++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main(){
string s
cin>>s;
while(1){
s.push_back;
s.push_back;
if(s.substr(0,s.size()/2)==s.substr(s.size()/2)) break;
}
cout<<s.size()<<endl;
} | a.cc: In function 'int main()':
a.cc:15:3: error: expected initializer before 'cin'
15 | cin>>s;
| ^~~
a.cc:17:5: error: 's' was not declared in this scope; did you mean 'sc'?
17 | s.push_back;
| ^
| sc
a.cc:21:9: error: 's' was not declared in this scope; did you mean 'sc'?
21 | cout<<s.size()<<endl;
| ^
| sc
|
s228842772 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
for(;;){
pop_back(s);
pop_back(s);
for(int j=0;;j++){
if(s[j]!=s[j+s.size()/2]) break;
if(j==s.size()/2-1){
cout<<s.size()<<endl;
return 0;
}
}
}
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'pop_back' was not declared in this scope
8 | pop_back(s);
| ^~~~~~~~
|
s652257604 | p03672 | C++ | // template
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<long long, long long> LP;
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define REP_AB(i, a, b) for (int i = int(a); i <= int(b); ++i)
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)), v.end());
#define SIZE(x) ((ll)(x).size())
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a / gcd(a, b)) * b;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
#define out cout
#define in cin
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
// template end
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
string s;
in >> s;
ll ans = 0;
REP(i, s.size()){
if(i % 2 == 1) continue;
if(i < 2) continue;
bool even = true;
REP(j, i / 2){
if s[j] != s[i/2 + j]{
even = false;
}
}
if(even){
ans = max(ans, i);
}
}
out << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:38:16: error: expected '(' before 's'
38 | if s[j] != s[i/2 + j]{
| ^
| (
a.cc:43:22: error: no matching function for call to 'max(ll&, int&)'
43 | ans = max(ans, i);
| ~~~^~~~~~~~
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:2:
/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:43:22: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
43 | ans = max(ans, i);
| ~~~^~~~~~~~
/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:43:22: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
43 | ans = max(ans, i);
| ~~~^~~~~~~~
|
s515469964 | p03672 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define debug(x) cout << #x << " = " << (x) << endl;
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
int main() {
string S; cin >> S;
int n = S.size();
for(int i=n-2; i; i-=2) {
if(strncmp(str; str+i/2; i/2)==0) {
cout << i << endl;
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:26:16: error: 'str' was not declared in this scope; did you mean 'std'?
26 | if(strncmp(str; str+i/2; i/2)==0) {
| ^~~
| std
a.cc:26:19: error: expected ')' before ';' token
26 | if(strncmp(str; str+i/2; i/2)==0) {
| ~ ^
| )
a.cc:26:21: error: 'str' was not declared in this scope; did you mean 'std'?
26 | if(strncmp(str; str+i/2; i/2)==0) {
| ^~~
| std
a.cc:26:33: error: expected ';' before ')' token
26 | if(strncmp(str; str+i/2; i/2)==0) {
| ^
| ;
|
s973329055 | p03672 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define debug(x) cout << #x << " = " << (x) << endl;
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
int main() {
string S; cin >> S;
int n = S.size();
for(int i=n-2; i; i-=2) {
if(strncmp(str, str+i/2, i/2)==0) {
cout << i << endl;
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:26:16: error: 'str' was not declared in this scope; did you mean 'std'?
26 | if(strncmp(str, str+i/2, i/2)==0) {
| ^~~
| std
|
s986389942 | p03672 | C | #include <stdio.h>
#include <string.h>
int main(){
char s[201];
scanf("%s",s);
int n=strlen(s);
int m=n;
for(int i=n-2;i;i-2){
if((strncmp(s,s+i/2,i/2)=0){
printf("%d",i);
return 0;
}
}
} | main.c: In function 'main':
main.c:9:29: error: lvalue required as left operand of assignment
9 | if((strncmp(s,s+i/2,i/2)=0){
| ^
main.c:9:32: error: expected ')' before '{' token
9 | if((strncmp(s,s+i/2,i/2)=0){
| ~ ^
| )
main.c:13:3: error: expected expression before '}' token
13 | }
| ^
|
s880396157 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s; cin>>s;
if(s.size()=2) cout<<1<<endl;
else{
if(s.size()%2!=0) s=s.substr(0,s.size()-1);
else s=s.substr(0,s.size()-2);
int size=s.size();
for(int i=0; i<size/2;i++){
string s1,s2;
s1=s.substr(0,size/2);
s2=s.substr(size/2);
if(s1==s2){
cout<<size<<endl;
break;
}
else{
s=s.substr(0,s.size()-2);
size=s.size();
}
}
}
}
| a.cc: In function 'int main()':
a.cc:6:12: error: lvalue required as left operand of assignment
6 | if(s.size()=2) cout<<1<<endl;
| ~~~~~~^~
|
s883886062 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s,t;
cin >> s;
int ans;
t=s
for (int i=0;i<t.size()/2;i++){
s=s.substr(0,s.size()-2);
if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2)){
break;
}
}
cout << s.size() << endl;
} | a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'for'
7 | t=s
| ^
| ;
8 | for (int i=0;i<t.size()/2;i++){
| ~~~
a.cc:8:16: error: 'i' was not declared in this scope
8 | for (int i=0;i<t.size()/2;i++){
| ^
|
s213818367 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
for(int i=S.size()-2;i>=0;i--){
if(i%2==0){
continue;
}
else{
string T;
for(int j=0;j<i+1;j++){
T.at(j)=S.at(j);
}
string U=T;
revers(T.begin(),T.end());
if(U==T){
cout<<T.size()<<endl;
break;
}
}
}
}
| a.cc: In function 'int main()':
a.cc:18:6: error: 'revers' was not declared in this scope
18 | revers(T.begin(),T.end());
| ^~~~~~
|
s997352985 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
for(int i=S.size()-2;i>=0;i--){
if(i%2==0){
continue;
}
else{
string T(i);
for(int j=0;j<i+1;j++){
T.at(j)=S.at(j);
}
string U=T;
revers(T.begin(),T.end());
if(U==T){
cout<<T.size()<<endl;
break;
}
}
}
}
| a.cc: In function 'int main()':
a.cc:12:11: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)'
12 | string T(i);
| ^
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:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
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/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:12:10: note: cannot convert 'i' (type 'int') to type 'const char*'
12 | string T(i);
| ^
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&'
682 | basic_string(basic_string&& __str) noexcept
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
552 | basic_string(const basic_string& __str)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
552 | basic_string(const basic_string& __str)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:527:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _Traits = std::char_tra |
s051694143 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
for(int i==S.size()-2;i>=0;i--){
if(i%2==0){
continue;
}
else{
string T(i);
for(int j=0;j<i+1;j++){
T.at(j)=S.at(j);
}
string U=T;
revers(T.begin(),T.end());
if(U==T){
cout<<T.size()<<endl;
break;
}
}
}
}
| a.cc: In function 'int main()':
a.cc:7:12: error: expected ';' before '==' token
7 | for(int i==S.size()-2;i>=0;i--){
| ^~
| ;
a.cc:7:12: error: expected primary-expression before '==' token
7 | for(int i==S.size()-2;i>=0;i--){
| ^~
a.cc:7:29: error: expected ')' before ';' token
7 | for(int i==S.size()-2;i>=0;i--){
| ~ ^
| )
a.cc:7:30: error: 'i' was not declared in this scope
7 | for(int i==S.size()-2;i>=0;i--){
| ^
|
s811339255 | p03672 | C++ |
#include<bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
for(int i=S.size()-2;i>=0;i--){
int X=0;
vector<int>vec(26);
for(int s=0;s<26;s++){
vec.at(s)=0;
}
for(int j=0;j<i+1;j++){
int Y=S.at(j)-'a';
vec.at(Y)++;
}
for(int k=0;k<26;k++){
if(vec.at(k)%2==0){
X++;
}
}
if(X==26){
cout<<i+1<<endl;
break;
}
}
| a.cc: In function 'int main()':
a.cc:31:4: error: expected '}' at end of input
31 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s503197939 | p03672 | C++ | using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
bool f(string s){
bool ans=true;
rep(i,s.size()/2){
if(s[i]!=s[s.size()/2+i]){
ans=false;
break;
}
}
return ans;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin>>s;
int ans=0;
for(int i=0;i<s.size()/2;i++){
s.erase( s.size()-1, 1 );
if(s.size%2==0){
if(f(s)){
ans=s.size();
break;
}
}
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:38:10: 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 '()' ?)
38 | if(s.size%2==0){
| ~~^~~~
| ()
|
s674540905 | p03672 | C++ | using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
bool f(string s){
bool ans=true;
rep(i,s.size()/2){
if(s[i]!=s[s.size()-1-i]){
ans=false;
break;
}
}
return ans;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin>>s;
ans=0;
for(int i=0;i<s.size()/2;i++){
s.erase( 0, 2 );
if(f(s)){
ans=s.size();
break;
}
}
cout<<ans<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:35:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
35 | ans=0;
| ^~~
| abs
a.cc: At global scope:
a.cc:51:1: error: expected declaration before '}' token
51 | }
| ^
|
s968712208 | p03672 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
st s;
ci(s);
ll a=s.sz;
for(ll k=(a-2);k>0;k-=2){
FOR(i,0,k/2){
ll count=0;
if(s[i]!=s[k/2+i]){
break;
}
else count++;
}
if(count==(k/2)){
co(k)
break;
}
}
}
| a.cc: In function 'int main()':
a.cc:88:13: error: invalid operands of types '<unresolved overloaded function type>' and 'll' {aka 'long long int'} to binary 'operator=='
88 | if(count==(k/2)){
| ~~~~~^~~~~~~
|
s030636989 | p03672 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
st s;
ci(s);
ll a=s.sz;
for(ll k=(a-2);k>0;k-=2){
FOR(i,0,k/2){
ll count=0;
if(s[i]!=s[k/2+i]){
break;
}
else count++;
}
if(count==k/2){
co(k)
break;
}
}
}
| a.cc: In function 'int main()':
a.cc:87:13: error: invalid operands of types '<unresolved overloaded function type>' and 'll' {aka 'long long int'} to binary 'operator=='
87 | if(count==k/2){
| ~~~~~^~~~~
|
s995214551 | p03672 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
st s;
ci(s);
ll a=s.sz;
for(ll k=(a-2);k>0;k-=2){
FOR(i,0,k/2){
ll count=0;
if(s[i]!=s[i/2+i]){
break;
}
else count++;
}
if(count==k/2){
co(k)
break;
}
}
}
| a.cc: In function 'int main()':
a.cc:87:13: error: invalid operands of types '<unresolved overloaded function type>' and 'll' {aka 'long long int'} to binary 'operator=='
87 | if(count==k/2){
| ~~~~~^~~~~
|
s881095341 | p03672 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
st s;
ci(s);
ll a=s.sz;
for(ll k=(a-2);k>0;k-=2){
FOR(i,0,k/2){
ll count=0
if(s[i]!=s[i/2+i]){
break;
}
else count++;
}
if(count==k/2){
co(k)
break;
}
}
}
| a.cc: In function 'int main()':
a.cc:82:7: error: expected ',' or ';' before 'if'
82 | if(s[i]!=s[i/2+i]){
| ^~
a.cc:85:7: error: 'else' without a previous 'if'
85 | else count++;
| ^~~~
a.cc:87:13: error: invalid operands of types '<unresolved overloaded function type>' and 'll' {aka 'long long int'} to binary 'operator=='
87 | if(count==k/2){
| ~~~~~^~~~~
|
s718254267 | p03672 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
st s;
ci(s);
ll a=s.sz;
for(ll k=(a-2),k>0,k+=2){
FOR(i,0,i/2){
if(s[i]==s[i/2+i]){
co(k)
break
}
}
}
}
| a.cc: In function 'int main()':
a.cc:79:19: error: expected ';' before '>' token
79 | for(ll k=(a-2),k>0,k+=2){
| ^
| ;
a.cc:79:19: error: expected primary-expression before '>' token
a.cc:79:26: error: expected ';' before ')' token
79 | for(ll k=(a-2),k>0,k+=2){
| ^
| ;
a.cc:83:16: error: expected ';' before '}' token
83 | break
| ^
| ;
84 | }
| ~
|
s434143447 | p03672 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
st s;
ci(s);
ll a=s.sz;
for(ll k=(a-2),k>0,i+=2){
FOR(i,0,i/2){
if(s[i]==s[i/2+i]){
co(k)
break
}
}
}
}
| a.cc: In function 'int main()':
a.cc:79:19: error: expected ';' before '>' token
79 | for(ll k=(a-2),k>0,i+=2){
| ^
| ;
a.cc:79:19: error: expected primary-expression before '>' token
a.cc:79:22: error: 'i' was not declared in this scope
79 | for(ll k=(a-2),k>0,i+=2){
| ^
a.cc:79:26: error: expected ';' before ')' token
79 | for(ll k=(a-2),k>0,i+=2){
| ^
| ;
a.cc:83:16: error: expected ';' before '}' token
83 | break
| ^
| ;
84 | }
| ~
|
s528261056 | p03672 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
st s;
ci(s);
ll a=s.sz;
for(ll k=(a-2),k>0,i+=2){
FOR(i,0,i/2){
if(s[i]==s[i/2+i]){
co(k)
break
b=false
}
}
}
}
| a.cc: In function 'int main()':
a.cc:79:19: error: expected ';' before '>' token
79 | for(ll k=(a-2),k>0,i+=2){
| ^
| ;
a.cc:79:19: error: expected primary-expression before '>' token
a.cc:79:22: error: 'i' was not declared in this scope
79 | for(ll k=(a-2),k>0,i+=2){
| ^
a.cc:79:26: error: expected ';' before ')' token
79 | for(ll k=(a-2),k>0,i+=2){
| ^
| ;
a.cc:83:16: error: expected ';' before 'b'
83 | break
| ^
| ;
84 | b=false
| ~
a.cc:84:11: error: 'b' was not declared in this scope
84 | b=false
| ^
|
s976247397 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
for(int i=0;i<S.size();i++){
S.pop_back();
if(S.size()%2==0){
for(int j=0;j<S.size()/2;j++){
if(S.at(j)!=S.at(S.size()/2+j)){
break;
}
if(j==S.size()/2-1){
cout<<S.size()<<endl;
}
if(S.size()==0){
cout<<0<<endl;
}
}
}
}
| a.cc: In function 'int main()':
a.cc:22:9: error: expected '}' at end of input
22 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s199176779 | p03672 | C++ | #include<iostream>
using namespace std;
int main() {
string S;
cin >> S;
int A = S.size() / 2;
for(int i = 0;i < A / 2;i++) {
S.push_back();
S.push_back();
bool B = true;
for(int j = 0;j < S.size();j++) {
if(S.at(j) != S.at(S.size() / 2 + j) {
B = false;
break;
}
}
if(B == true) {
cout << S.size() << endl;
break;
}
}
}
| a.cc: In function 'int main()':
a.cc:9:16: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()'
9 | S.push_back();
| ~~~~~~~~~~~^~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/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:10:16: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()'
10 | 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:13:43: error: expected ')' before '{' token
13 | if(S.at(j) != S.at(S.size() / 2 + j) {
| ~ ^~
| )
a.cc:17:5: error: expected primary-expression before '}' token
17 | }
| ^
|
s546293267 | p03672 | C++ | #include<iostream>
using namespace std;
int main() {
string S;
cin >> S;
int A = S.size() / 2;
for(int i = 0;i < C / 2;i++) {
S.push_back();
S.push_back();
bool B = true;
for(int j = 0;j < S.size();j++) {
if(S.at(j) != S.at(S.size() / 2 + j) {
B = false;
break;
}
}
if(B == true) {
cout << S.size() << endl;
break;
}
}
} | a.cc: In function 'int main()':
a.cc:8:21: error: 'C' was not declared in this scope
8 | for(int i = 0;i < C / 2;i++) {
| ^
a.cc:9:16: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()'
9 | S.push_back();
| ~~~~~~~~~~~^~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/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:10:16: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()'
10 | 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:13:43: error: expected ')' before '{' token
13 | if(S.at(j) != S.at(S.size() / 2 + j) {
| ~ ^~
| )
a.cc:17:5: error: expected primary-expression before '}' token
17 | }
| ^
|
s714850215 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
int count=0;
for(int i=0;i<S.size();i++){
S.pop_back();
count++;
if(S.size%2==0){
for(int j=0;j<S.size()/2;j++){
if(S.at(j)!=S.at(S.size()/2+j){
break;
}
if(j==S.size()/2-1){
cout<<count<<endl;
}
}
}
}
} | a.cc: In function 'int main()':
a.cc:11:10: 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 '()' ?)
11 | if(S.size%2==0){
| ~~^~~~
| ()
a.cc:13:35: error: expected ')' before '{' token
13 | if(S.at(j)!=S.at(S.size()/2+j){
| ~ ^
| )
a.cc:19:8: error: expected primary-expression before '}' token
19 | }
| ^
|
s207502520 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
int count=0;
for(int i=0;i<S.size();i++){
A.pop_back();
count++;
if(S.size%2==0){
for(int j=0;j<S.size()/2;j++){
if(S.at(j)!=S.at(S.size()/2+j){
break;
}
if(j==S.size()/2-1){
cout<<count<<endl;
}
}
}
}
} | a.cc: In function 'int main()':
a.cc:9:5: error: 'A' was not declared in this scope
9 | A.pop_back();
| ^
a.cc:11:10: 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 '()' ?)
11 | if(S.size%2==0){
| ~~^~~~
| ()
a.cc:13:35: error: expected ')' before '{' token
13 | if(S.at(j)!=S.at(S.size()/2+j){
| ~ ^
| )
a.cc:19:8: error: expected primary-expression before '}' token
19 | }
| ^
|
s393468197 | p03672 | C++ | #include<iostream>
#include<string>
#include<stdio.h>
using namespace std;
char s[222];
int main(){
cin >> s;
int n = strlen(s);
for(int i = n - 2; i >= 0; i -= 2){
if(strncmp(s, s + i / 2, i / 2) == 0){
cout << i << endl;
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:11: error: 'strlen' was not declared in this scope
11 | int n = strlen(s);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 | #include<string>
a.cc:13:8: error: 'strncmp' was not declared in this scope
13 | if(strncmp(s, s + i / 2, i / 2) == 0){
| ^~~~~~~
a.cc:13:8: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s197014163 | p03672 | C++ | #include<iostream>
#include<string>
using namespace std;
char s[222];
int main(){
cin >> s;
int n = strlen(s);
for(int i = n - 2; i >= 0; i -= 2){
if(strncmp(s, s + i / 2, i / 2) == 0){
cout << i << endl;
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:11: error: 'strlen' was not declared in this scope
10 | int n = strlen(s);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 | #include<string>
a.cc:12:8: error: 'strncmp' was not declared in this scope
12 | if(strncmp(s, s + i / 2, i / 2) == 0){
| ^~~~~~~
a.cc:12:8: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s970771277 | p03672 | C++ | #include <iostream>
#include <string>
#include <iomanip>
#include <ios>
using namespace std;
int check(string s){
int n = s.length();
string s_back = s.substr(n / 2,n / 2);
string s_front = s - s_back;
if(s_front == s_back)
return 1;
else
return 0;
}
int main(void){
string word;
cin >> word;
while(1){
int word_length = word.length();
word = word.substr(0,word_length - 1);
if(check(word)){
cout << word.length() << endl;
break;
}
} | a.cc: In function 'int check(std::string)':
a.cc:9:22: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
9 | string s_front = s - s_back;
| ~ ^ ~~~~~~
| | |
| | basic_string<[...]>
| basic_string<[...]>
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:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | string s_front = s - s_back;
| ^~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | string s_front = s - s_back;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:28:4: error: expected '}' at end of input
28 | }
| ^
a.cc:17:15: note: to match this '{'
17 | int main(void){
| ^
|
s250660917 | p03672 | C++ | #include <iostream>
#include <string>
#include <iomanip>
#include <ios>
using namespace std;
int check(string s){
int n = s.length();
string s_back = s.substr(n / 2,n / 2);
string s_front = s - s_back;
if(s_front == s_back)
return 1;
else
return 0;
}
int main(void){
string word;
cin >> word;
while(1){
word = word - word.back();
if(check(word)){
cout << word.length() << endl;
break;
}
}
return 0;
} | a.cc: In function 'int check(std::string)':
a.cc:9:22: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
9 | string s_front = s - s_back;
| ~ ^ ~~~~~~
| | |
| | basic_string<[...]>
| basic_string<[...]>
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:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | string s_front = s - s_back;
| ^~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:9:24: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | string s_front = s - s_back;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:22:17: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
22 | word = word - word.back();
| ~~~~ ^ ~~~~~~~~~~~
| | |
| | __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
| std::string {aka std::__cxx11::basic_string<char>}
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:22:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
22 | word = word - word.back();
| ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:22:29: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
22 | word = word - word.back();
| ^
|
s506154395 | p03672 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
using namespace std;
int main() {
string s;
cin >> s;
for(int i=2; i<s.length(); i+=2) {
if(s.substr(0,s.length()/2)==s.substr(s.length(),s.length()) {
break;
}
}
cout << s.length()-i << endl;
} | a.cc: In function 'int main()':
a.cc:10:65: error: expected ')' before '{' token
10 | if(s.substr(0,s.length()/2)==s.substr(s.length(),s.length()) {
| ~ ^~
| )
a.cc:13:8: error: expected primary-expression before '}' token
13 | }
| ^
a.cc:14:27: error: 'i' was not declared in this scope
14 | cout << s.length()-i << endl;
| ^
|
s017610610 | p03672 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
using namespace std;
int main() {
string s;
cin >> s;
for(int i=2; i<S.length(); i+=2) {
if(s.substr(0,s.length()/2)==s.substr(s.length(),s.length()) {
break;
}
}
cout << s.length()-i << endl;
} | a.cc: In function 'int main()':
a.cc:9:18: error: 'S' was not declared in this scope
9 | for(int i=2; i<S.length(); i+=2) {
| ^
a.cc:10:65: error: expected ')' before '{' token
10 | if(s.substr(0,s.length()/2)==s.substr(s.length(),s.length()) {
| ~ ^~
| )
a.cc:13:8: error: expected primary-expression before '}' token
13 | }
| ^
a.cc:14:27: error: 'i' was not declared in this scope
14 | cout << s.length()-i << endl;
| ^
|
s685714384 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s;
int check = 0;
while(check != 0){
check = 0;
for(int i = 0; i < s.size() - 2; i++){
t.at(i) = s.at(i);
}
for(i = 0; i < t.size() / 2; i++){
if(t.at(i) != t.at((t.size() / 2) + i)){
check++;
}
}
if(check == 0){
break;
}
s = t;
}
cout << t.size() << endl;
}
| a.cc: In function 'int main()':
a.cc:16:9: error: 'i' was not declared in this scope
16 | for(i = 0; i < t.size() / 2; i++){
| ^
|
s495650764 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define INF 2e9
#define ll long long
int main(){
char str[222];
cin>>str;
int n=strlen(str);
for(int i=n-2; i; i-=2){
if(strncom(str, str+i/2, i/2)==0){
cout<<i<<endl;
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:16:12: error: 'strncom' was not declared in this scope; did you mean 'strncpy'?
16 | if(strncom(str, str+i/2, i/2)==0){
| ^~~~~~~
| strncpy
|
s177713410 | p03672 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
const long long INF = 1e9 + 7;
using namespace std;
map<int, int> mp;
int main()
{
char s[222];
cin >> s;
int n = strlen(s);
for (int i = n - 2; i; i -= 2) {
if (strncmp(s, s + i / 2, i / 2) == 0) {
cout << i << endl;
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:23:17: error: 'strlen' was not declared in this scope
23 | int n = strlen(s);
| ^~~~~~
a.cc:16:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
15 | #include <set>
+++ |+#include <cstring>
16 | const long long INF = 1e9 + 7;
a.cc:25:21: error: 'strncmp' was not declared in this scope
25 | if (strncmp(s, s + i / 2, i / 2) == 0) {
| ^~~~~~~
a.cc:25:21: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s390103997 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string str;
cin >> str;
int x;
for (int i=1;i<str.size()- 1;i+=2){
for (int j=0;j<=i;j++){
if(str.at(j) == str.at((i+1)/2+j){
x=i+1;
}
}
}
cout << x;
}
//0123 | a.cc: In function 'int main()':
a.cc:10:36: error: expected ')' before '{' token
10 | if(str.at(j) == str.at((i+1)/2+j){
| ~ ^
| )
a.cc:13:6: error: expected primary-expression before '}' token
13 | }
| ^
|
s545132366 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string str;
cin >> str;
int x;
for (int i=1;i<str.size()- 1;i+=2){
for (int j=0;j<str.size()/2;j++){
if(str.at(j) == str.at(str.size()/2+j-1){
x=i+1;
}
}
}
cout << x;
}
| a.cc: In function 'int main()':
a.cc:10:43: error: expected ')' before '{' token
10 | if(str.at(j) == str.at(str.size()/2+j-1){
| ~ ^
| )
a.cc:13:6: error: expected primary-expression before '}' token
13 | }
| ^
|
s171630481 | p03672 | Java | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
int point = str.length()-1;
while(point > 0) {
String s = str.substring(0,point);
point--;
if(s.length()%2!=0) continue;
if(s.substring(0,s.length()/2).equals(s.substring(s.length()/2))) {
System.out.println(s.length);
return;
}
}
System.out.println(0);
}
} | Main.java:12: error: cannot find symbol
System.out.println(s.length);
^
symbol: variable length
location: variable s of type String
1 error
|
s444686207 | p03672 | C++ | #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
char s[300];
cin >> s;
int t;
int ans;
int count = 0;
for (int i = strlen(s)-2; i > 0; i-=2) {
if (strncmp(s, s+i/2, i/2) == 0) {
cout << i << endl;
return 0;
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:18: error: 'strlen' was not declared in this scope
15 | for (int i = strlen(s)-2; i > 0; i-=2) {
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <algorithm>
+++ |+#include <cstring>
4 |
a.cc:16:13: error: 'strncmp' was not declared in this scope
16 | if (strncmp(s, s+i/2, i/2) == 0) {
| ^~~~~~~
a.cc:16:13: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s161468638 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long mod = pow(10, 9) + 7;
const long long MOD = 998244353;
const long long INF = 1LL << 60;
const int inf = pow(10, 9) + 7;
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, int B) {return (A + (B - 1)) / B;}
long long divCeil(int A, long long B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;}
bool even(S)
{
int N = S.size();
if (S.substr(0, N / 2 - 1) == S.substr(N / 2, N - 1))
return true;
return false;
}
int main()
{
string S;
cin >> S;
int N = S.size();
for (int i = 0; i < N; i++)
{
S.erase(S.end());
if (even(S)) break;
}
cout << S << endl;
} | a.cc:14:11: error: 'S' was not declared in this scope
14 | bool even(S)
| ^
a.cc: In function 'int main()':
a.cc:31:13: error: 'even' cannot be used as a function
31 | if (even(S)) break;
| ~~~~^~~
|
s488512793 | 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.
|
s532775844 | 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.
|
s942203814 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
for(int i=2; i<S,size(); i+=2){
if(S.substr(0,(S.size()-i)/2)
==S.substr(S.size()-i)/2, S.size()-i/2)){break;}
}
cout<<S.size()-i<<endl;
} | a.cc: In function 'int main()':
a.cc:7:17: error: no match for 'operator<' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
7 | for(int i=2; i<S,size(); i+=2){
| ~^~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| int
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
7 | for(int i=2; i<S,size(); i+=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:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
7 | for(int i=2; i<S,size(); i+=2){
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
7 | for(int i=2; i<S,size(); i+=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:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:7:18: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
7 | for(int i=2; i<S,size(); i+=2){
| ^
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
388 |
s474438381 | p03672 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <string>
#include <cstdio>
using namespace std;
#define int long long
#define INF 1e18
signed main () {
char s[400]; cin >> s;
int n = strlen(s);
for(int i = n - 2; i; i -= 2) {
if(strncmp(s, s + i / 2, i / 2) == 0) {
cout << i << endl;
return 0;
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:13: error: 'strlen' was not declared in this scope
15 | int n = strlen(s);
| ^~~~~~
a.cc:8:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include <cstdio>
+++ |+#include <cstring>
8 | using namespace std;
a.cc:17:12: error: 'strncmp' was not declared in this scope
17 | if(strncmp(s, s + i / 2, i / 2) == 0) {
| ^~~~~~~
a.cc:17:12: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s488101996 | p03672 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <string>
#include <cstdio>
using namespace std;
#define int long long
#define INF 1e18
signed main () {
char s[400]; cin >> s;
int n = strlen(s);
for(int i = n - 2; i >= 2; i -= 2) {
if(strncmp(s, s + i / 2, i / 2) == 0) {
cout << i << endl;
return 0;
}
}
}
| a.cc: In function 'int main()':
a.cc:15:13: error: 'strlen' was not declared in this scope
15 | int n = strlen(s);
| ^~~~~~
a.cc:8:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include <cstdio>
+++ |+#include <cstring>
8 | using namespace std;
a.cc:17:12: error: 'strncmp' was not declared in this scope
17 | if(strncmp(s, s + i / 2, i / 2) == 0) {
| ^~~~~~~
a.cc:17:12: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s727883507 | p03672 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <ctype.h>
#include <map>
#include <vector>
#include <stdlib.h>
#include <cctype>
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define REP1(j,n) for(int j=0;j<(int)n;++j)
#define REPD(i,n) for(int i=n;i>=0;--i)
#define REPD1(j,n) for(int j=n;j=>0;--j)
#define REPS(i,n) for(int i=1;i<=(int)n;++i)
#define REPS1(j,n) for(int j=1;j<=(int)n;++j)
#define rep(i,a,n) for(int i=a;i<=(int)n;++i)
#define SZ(x) ((int)(x).size()) //size() unsigned -> int
#define DescSort(a) sort(a.begin(),a.end(),std::greater<int>())
using namespace std;
typedef long long ll;
int main(void) {
char x[205];
cin >> x;
int size = strlen(x);
for (int i = size - 2; i; i -= 2) {
if (strncmp(x, x + i / 2, i / 2) == 0) {
cout << i << endl;
return 0;
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:26:20: error: 'strlen' was not declared in this scope
26 | int size = strlen(x);
| ^~~~~~
a.cc:10:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
9 | #include <cctype>
+++ |+#include <cstring>
10 | #define REP(i,n) for(int i=0;i<(int)n;++i)
a.cc:28:21: error: 'strncmp' was not declared in this scope
28 | if (strncmp(x, x + i / 2, i / 2) == 0) {
| ^~~~~~~
a.cc:28:21: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s691281409 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int len=s.length()-2;
while(len>1) {
if(s.substr(0,s.length()/2)==s.substr(s.length(),s.length()/2) {
cout << len << endl;
return 0;
}
len-=2;
}
}
| a.cc: In function 'int main()':
a.cc:9:67: error: expected ';' before '{' token
9 | if(s.substr(0,s.length()/2)==s.substr(s.length(),s.length()/2) {
| ^~
| ;
a.cc:9:32: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
9 | if(s.substr(0,s.length()/2)==s.substr(s.length(),s.length()/2) {
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:3755:5: note: declared here
3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
a.cc:13:14: error: expected ')' before ';' token
13 | len-=2;
| ^
| )
a.cc:9:7: note: to match this '('
9 | if(s.substr(0,s.length()/2)==s.substr(s.length(),s.length()/2) {
| ^
|
s863916029 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int i, j;
string s;
cin >> s;
for(i=1; i<s.size()/2; i++){
for(j=0; j<s.size()/2-i; j++){
if(s[j] != s[j+s.size()/2-i]){
j = 200;
}
if(j == s.size()/2-i-1){
cout << s.size-2*i;
return 0;#include <bits/stdc++.h>
using namespace std;
int main(){
int i, j;
string s;
cin >> s;
for(i=1; i<s.size()/2; i++){
for(j=0; j<s.size()/2-i; j++){
if(s[j] != s[j+s.size()/2-i]){
j = 200;
}
if(j == s.size()/2-i-1){
cout << s.size()-2*i;
return 0;
}
}
}
cout << 0;
return 0;
}
}
}
}
cout << 0;
return 0;
} | a.cc:15:26: error: stray '#' in program
15 | return 0;#include <bits/stdc++.h>
| ^
a.cc: In function 'int main()':
a.cc:14:27: 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 '()' ?)
14 | cout << s.size-2*i;
| ~~^~~~
| ()
a.cc:15:27: error: 'include' was not declared in this scope
15 | return 0;#include <bits/stdc++.h>
| ^~~~~~~
a.cc:15:36: error: 'bits' was not declared in this scope
15 | return 0;#include <bits/stdc++.h>
| ^~~~
a.cc:15:41: error: 'stdc' was not declared in this scope; did you mean 'std'?
15 | return 0;#include <bits/stdc++.h>
| ^~~~
| std
a.cc:16:1: error: expected primary-expression before 'using'
16 | using namespace std;
| ^~~~~
a.cc:18:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
18 | int main(){
| ^~
a.cc:18:9: note: remove parentheses to default-initialize a variable
18 | int main(){
| ^~
| --
a.cc:18:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:18:11: error: a function-definition is not allowed here before '{' token
18 | int main(){
| ^
|
s316991913 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int i, j;
string s;
cin >> s;
for(i=1; i<s.size()/2; i++){
for(j=0; j<s.size()/2-i; j++){
if(s[j] != s[j+s.size()/2-i]){
j = 200;
}
if(j == s.size()/2-i-1){
cout << s.size-2*i;
return 0;
}
}
}
cout << 0;
return 0;
} | a.cc: In function 'int main()':
a.cc:14:27: 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 '()' ?)
14 | cout << s.size-2*i;
| ~~^~~~
| ()
|
s742839616 | p03672 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s;
int i,j;
cin>>s;
for(i=0,j=1;i<s.size()-1,j<s.size();i+=2,j+=2){
if(s.size()%2!=0){s.pop_back();continue;}
if(s[i]=!=s[j]){s.pop_back();continue;}
}
cout<<s.size()<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:17: error: expected primary-expression before '!=' token
11 | if(s[i]=!=s[j]){s.pop_back();continue;}
| ^~
|
s577043364 | p03672 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s;
cin>>s;
for(int i=0,int j=1;i<s.size()-1,j<s.size();i+=2,j+=2){
if(s.size()%2!=0){s.pop_back();continue;}
if(s[i]=!=s[j]){s.pop_back();continue;}
}
cout<<s.size()<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:21: error: expected unqualified-id before 'int'
8 | for(int i=0,int j=1;i<s.size()-1,j<s.size();i+=2,j+=2){
| ^~~
a.cc:8:21: error: expected ';' before 'int'
8 | for(int i=0,int j=1;i<s.size()-1,j<s.size();i+=2,j+=2){
| ^~~
| ;
a.cc:8:52: error: expected ')' before ';' token
8 | for(int i=0,int j=1;i<s.size()-1,j<s.size();i+=2,j+=2){
| ~ ^
| )
a.cc:8:53: error: 'i' was not declared in this scope
8 | for(int i=0,int j=1;i<s.size()-1,j<s.size();i+=2,j+=2){
| ^
a.cc:8:58: error: 'j' was not declared in this scope
8 | for(int i=0,int j=1;i<s.size()-1,j<s.size();i+=2,j+=2){
| ^
|
s796308085 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
string s;
cin >> s;
for(int i = (int)s.size(); i >= 0; i++)
{
string t = s.substr(0, i);
string p = reverse(t.begin(), t.end());
if(t == p){
cout << i << endl;
break;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:27: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
11 | string p = reverse(t.begin(), t.end());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~
|
s292869512 | p03672 | Java | import java.util.Scanner;
public class Main {
public static void main(String[]srgs) {
Scanner scan=new Scanner(System.in);
String a=scan.next();
for(int i=1;i!=a.length();i++) {
String str=a.substring(0,a.length()-i);
if(str.length()%2==1) {
continue;
}
else {
String str1=str.substring(0,str.length()/2);
String str2=str.substring(str.length()/2,str.length());
if(str1.equals(str2)) {
System.out.println(str.length());
return;
}
} | Main.java:18: error: reached end of file while parsing
}
^
1 error
|
s895952822 | p03672 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
string s;
string temp_s;
cin >> s;
vector<string> ss;
for(int i = 0; i < s.length(); i++){
temp_s = s[i];
ss.push_back(temp_s);
}
int mx = 0;
for(int i = ss.size(); i > 0; i--){
if(i % 2 == 0){
//std::cout << i << "回" << std::endl;
int j = 0;
vector<string> sss1;
vector<string> sss2;
//max = i;
for(j = 0; j < i / 2;j++){
temp_s = ss[j];
sss1.push_back(temp_s);
//std::cout << ss[j];
}
//std::cout << std::endl;
for(j = i/2; j < i;j++){
temp_s = ss[j];
sss2.push_back(temp_s);
std::cout << ss[j];
}
//std::cout << std::endl;
//確かめる
bool flag = true;
for(j = 0; j < i / 2; j++){
if(!(sss1[j] == sss2[j])){
flag = false;
}
}
if(flag == true){
//std::cout << "a" << std::endl;
mx = i;
}
}else{
}
}
if(ss.size() == max){
max = 0;
}
std::cout << mx << std::endl;
} | a.cc: In function 'int main()':
a.cc:59:18: error: invalid operands of types 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} and '<unresolved overloaded function type>' to binary 'operator=='
59 | if(ss.size() == max){
| ~~~~~~~~~~^~~~~~
a.cc:60:15: error: overloaded function with no contextual type information
60 | max = 0;
| ^
|
s372285856 | p03672 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
string s;
string temp_s;
cin >> s;
vector<string> ss;
for(int i = 0; i < s.length(); i++){
temp_s = s[i];
ss.push_back(temp_s);
}
int max = 0;
for(int i = ss.size(); i > 0; i--){
if(i % 2 == 0){
//std::cout << i << "回" << std::endl;
int j = 0;
vector<string> sss1;
vector<string> sss2;
//max = i;
for(j = 0; j < i / 2;j++){
temp_s = ss[j];
sss1.push_back(temp_s);
//std::cout << ss[j];
}
//std::cout << std::endl;
for(j = i/2; j < i;j++){
temp_s = ss[j];
sss2.push_back(temp_s);
std::cout << ss[j];
}
//std::cout << std::endl;
//確かめる
bool flag = true;
for(j = 0; j < i / 2; j++){
if(!(sss1[j] == sss2[j])){
flag = false;
}
}
if(flag == true){
//std::cout << "a" << std::endl;
max = i;
}
}else{
}
}
if(ss.size() == max){
max = 0;
}
std::cout << max << std::endl;
| a.cc: In function 'int main()':
a.cc:63:35: error: expected '}' at end of input
63 | std::cout << max << std::endl;
| ^
a.cc:7:11: note: to match this '{'
7 | int main(){
| ^
|
s302498861 | p03672 | C | #include<stdio.h>
int main(){
int len = 0, j, count = 0;
char s[201];
scanf("%s", s);
while(s[len]){
len++;
}
for (i = len - 2; i >= 0; i -= 2){
count++;
s[i] = '\0';
j = 0;
while(s[j]){
if(s[j] != s[j + i/2]){
break;
}
}
if(i == j){
printf("%d\n", count);
return 0;
}
}
}
| main.c: In function 'main':
main.c:12:8: error: 'i' undeclared (first use in this function)
12 | for (i = len - 2; i >= 0; i -= 2){
| ^
main.c:12:8: note: each undeclared identifier is reported only once for each function it appears in
|
s177332624 | p03672 | C++ | S
S
に対して、条件を満たす
1
1
文字以上の文字列が存在する。 | a.cc:3:1: error: extended character 、 is not valid in an identifier
3 | に対して、条件を満たす
| ^
a.cc:6:1: error: extended character 。 is not valid in an identifier
6 | 文字以上の文字列が存在する。
| ^
a.cc:1:1: error: 'S' does not name a type
1 | S
| ^
|
s408443870 | p03672 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String S =scanner.next();
int count = 0;
for (int i = 2; i < S.length(); i += 2) {
//文字列Sも末尾を、2文字ずつ削除
String s = S.substring(0, S.length()-i);
//文字列Sをs1とs2に分割
// String s1 = s.substring(0, s.length() / 2);
// String s2 = s.substring(s.length() / 2, s.length());
System.out.println("s1:" + s1);
System.out.println("s2:" + s2);
//文字列s1とs2が等しい場合
if (s1.equals(s2)) {
count = s.length();
break;
}
}
System.out.println(count);
}
} | Main.java:17: error: cannot find symbol
System.out.println("s1:" + s1);
^
symbol: variable s1
location: class Main
Main.java:18: error: cannot find symbol
System.out.println("s2:" + s2);
^
symbol: variable s2
location: class Main
Main.java:21: error: cannot find symbol
if (s1.equals(s2)) {
^
symbol: variable s2
location: class Main
Main.java:21: error: cannot find symbol
if (s1.equals(s2)) {
^
symbol: variable s1
location: class Main
4 errors
|
s632311304 | p03672 | C++ | #include <vector>
#include <queue>
#include <string>
using namespace std;
typedef long long ll;
int main() {
string s;
cin >> s;
s.erase(s.end() - 2, s.end());
for (int i = 0; s.size() != 0; i++)
{
for (int k = 0; k <= s.size()/2; k++)
{
if (k == s.size() / 2) {
cout << s.size() << endl;
exit(0);
}
if (s[k] != s[k + s.size() / 2]) break;
}
s.erase(s.end() - 2, s.end());
}
} | a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope
10 | cin >> s;
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include <string>
+++ |+#include <iostream>
4 | using namespace std;
a.cc:18:33: error: 'cout' was not declared in this scope
18 | cout << s.size() << endl;
| ^~~~
a.cc:18:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:53: error: 'endl' was not declared in this scope
18 | cout << s.size() << endl;
| ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
3 | #include <string>
+++ |+#include <ostream>
4 | using namespace std;
|
s679790774 | p03672 | C++ | #include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define MMP(a, b, c) make_pair(make_pair(a, b), c)
#define MAX 1000000000
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483647
#define INT_MAX 2147483647
#define LL_MIN (LL)-9223372036854775807
#define LL_MAX (LL)9223372036854775807
#define PI 3.14159265359
int main(){
iostream::sync_with_stdio(false);
string S;
cin >> S;
S = S.substr(0, S.size()-1);
if(S.size() % 2 == 1) S = S.substr(0, S.size()-1);
while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
S = S.substr(0,S.size()-2);
}
cout << S.size() << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:40:33: error: no match for 'operator!=' (operand types are 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'std::__cxx11::basic_string<char>')
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ~~~~~~~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | std::__cxx11::basic_string<char>
| std::__cxx11::basic_string<char>::size_type {aka long unsigned int}
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)'
197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'const std::fpos<_StateT>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
In file included from /usr/include/c++/14/string:43,
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:
/usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)'
243 | operator!=(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'const std::allocator<_CharT>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
455 | operator!=(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
500 | operator!=(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1686 | operator!=(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1753 | operator!=(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'const std::pair<_T1, _T2>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
651 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long unsigned int'
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
/usr/include/c++/14/string_view:658: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> >)'
658 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long unsigned int'
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
/usr/include/c++/14/string_view:666: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>)'
666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
/usr/include/c++/14/bits/basic_string.h:3833: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>&)'
3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
/usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3847 | operator!=(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'const _CharT*' and 'long unsigned int'
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
/usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed:
a.cc:40:66: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
40 | while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
| ^
In file included from /usr/ |
s384039071 | p03672 | C | #include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define MMP(a, b, c) make_pair(make_pair(a, b), c)
#define MAX 1000000000
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483647
#define INT_MAX 2147483647
#define LL_MIN (LL)-9223372036854775807
#define LL_MAX (LL)9223372036854775807
#define PI 3.14159265359
int main(){
iostream::sync_with_stdio(false);
string S;
cin >> S;
S = S.substr(0, S.size()-1);
if(S.size() % 2 == 1) S = S.substr(0, S.size()-1);
while(S.substr(0,S.size()/2 != S.substr(S.size()/2,S.size()/2){
S = S.substr(0,S.size()-2);
}
cout << S.size() << endl;
return 0;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s998604039 | p03672 | C++ | #include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define MMP(a, b, c) make_pair(make_pair(a, b), c)
#define MAX 1000000000
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483647
#define INT_MAX 2147483647
#define LL_MIN (LL)-9223372036854775807
#define LL_MAX (LL)9223372036854775807
#define PI 3.14159265359
int main(){
iostream::sync_with_stdio(false);
string S;
cin >> S;
int c[26] = {};
int t = 0;
for(int i=0; i<S.size(); i++){
c[S[i]-'a']++;
if(c[S[i]-'a'] % 2 == 1) t++;
else t--;
}
while(t > 0){
c[S[S.size()-1]-'a']--;
if(c[S[S.size()-1]-'a'] % 2 == 1) t++;
else t--;
S = S.substr(0,S.size-2);
}
cout << S << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:48:26: 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 '()' ?)
48 | S = S.substr(0,S.size-2);
| ~~^~~~
| ()
|
s500060609 | p03672 | C++ | #include <stdio.h> #include <string.h>
int main(){
scanf("%s", str);
int n=strlen(str);
for(int i=n-2; i; i-=2){
char str [222];
if(strncmp(str, str+i/2, i/2)==0){ printf("%d\n" ,i);
return 0;
}
}
return 0; } | a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include <stdio.h> #include <string.h>
| ^
a.cc: In function 'int main()':
a.cc:6:16: error: 'str' was not declared in this scope; did you mean 'std'?
6 | scanf("%s", str);
| ^~~
| std
a.cc:7:10: error: 'strlen' was not declared in this scope
7 | int n=strlen(str);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <stdio.h> #include <string.h>
+++ |+#include <cstring>
2 |
a.cc:11:4: error: 'strncmp' was not declared in this scope
11 | if(strncmp(str, str+i/2, i/2)==0){ printf("%d\n" ,i);
| ^~~~~~~
a.cc:11:4: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s753696554 | p03672 | C | #include<stdio.h>
int n, i, j, flag;
char S[201];
int main(){
scanf("%s", S);
while(S[a]){a++;}
i=(a-1)>>2;
while(){
flag=1;
for(j=0; j<i; j++){
if(S[j] != S[j+i]){flag=0; break;}
}
if(flag){break;}
i+=2;
}
printf("%d\n", i*2);
}
| main.c: In function 'main':
main.c:6:11: error: 'a' undeclared (first use in this function)
6 | while(S[a]){a++;}
| ^
main.c:6:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:9: error: expected expression before ')' token
8 | while(){
| ^
|
s627625016 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void){
string s;
cin >> s;
for(int i=s.size()-1;i>=0;++i){
string ss = s.substr(0,i);
if(ss.size()%2!=0) continue;
string s1=ss.substr(0,ss.size()/2),
s2=ss.substr(ss.size()/2, ss.size()/2);
if(s1==s2){
cout << ss.size() << endl;
}
}
| a.cc: In function 'int main()':
a.cc:15:4: error: expected '}' at end of input
15 | }
| ^
a.cc:4:15: note: to match this '{'
4 | int main(void){
| ^
|
s495910253 | p03672 | C++ | #include<cstdio>
#inslude<cstring>
int main(){
int n,flag;
char s[210];
scanf("%s",s);
n=strlen(s);
for(int i=-1;i>0;i--){
flag=1;
if(i%2==0){
for(int j=0;j<i/2;j++)
if(s[j]!=s[j+i/2])
flag=0;
if(flag){
printf("%d\n",i);
return 0;
}
}
}
} | a.cc:2:2: error: invalid preprocessing directive #inslude; did you mean #include?
2 | #inslude<cstring>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:7:5: error: 'strlen' was not declared in this scope
7 | n=strlen(s);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<cstdio>
+++ |+#include <cstring>
2 | #inslude<cstring>
|
s276871161 | p03672 | C++ | #include<cstdio>
#inslude<cstring>
int main(){
int n,flag;
char s[210];
scanf("%s",s);
n=strlen(s);
for(int i=-1;i>0;i--){
flag=1;
if(i%2==0){
for(int j=0;j<i/2;j++)
if(s[j]!=s[j+i/2])
flag=0;
if(flag){
printf("%d\n",I);
return 0;
}
}
}
} | a.cc:2:2: error: invalid preprocessing directive #inslude; did you mean #include?
2 | #inslude<cstring>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:7:5: error: 'strlen' was not declared in this scope
7 | n=strlen(s);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<cstdio>
+++ |+#include <cstring>
2 | #inslude<cstring>
a.cc:15:23: error: 'I' was not declared in this scope
15 | printf("%d\n",I);
| ^
|
s194169585 | p03672 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
string s;
cin>>s;
for(int i=s.size();i>0;i--){
string t=s.substr(0,i);
reverse(t.begin(),t.end());
if(t.size%2==0 && s==t){
cout<<t.size()<<endl;
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:11:10: 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 '()' ?)
11 | if(t.size%2==0 && s==t){
| ~~^~~~
| ()
|
s085086109 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans = 1;
for (int i = 1; i < s.size(); i++) {
bool flg = true;
for (int j = 0; j < i; j++) {
if (s.at(j) != s.at(j + 1))
flag = false;
}
if (flg) ans = i;
}
cout << ans * 2 << endl;
} | a.cc: In function 'int main()':
a.cc:11:33: error: 'flag' was not declared in this scope; did you mean 'flg'?
11 | flag = false;
| ^~~~
| flg
|
s387091104 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int Solve(string s = "") {
cin >> s;
for (int i = s.size() - 2; 0 < i; i -= 2)
if (s.substr(0, i / 2) == s.substr(i / 2, i / 2)) return size;
return 0;
}
int main() {
cin.tie(0); ios::sync_with_stdio(false);
cout << Solve() << endl;
return 0;
}
| a.cc: In function 'int Solve(std::string)':
a.cc:10:66: error: cannot resolve overloaded function 'size' based on conversion to type 'int'
10 | if (s.substr(0, i / 2) == s.substr(i / 2, i / 2)) return size;
| ^~~~
|
s765222234 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
for(int i=0;i<S.size();i++) {
/*if(i==0) {
S.pop_back();
S.pop_back();
}
*/
/*else if(S.size()==2 && (i==0 || S[0]!=S[1])) {
cout << 1 << endl;
return 0;
}*/
else {
int m=S.size()/2-i;
if(S.substr(0,m)==S.substr(m,m)) {
cout << S.size() << endl;
return 0;
}
else{
S.pop_back();
S.pop_back();
}
}
}
}
| a.cc: In function 'int main()':
a.cc:18:5: error: 'else' without a previous 'if'
18 | else {
| ^~~~
|
s673018412 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
for(int i=0;i<S.size();i++) {
if(i==0) {
S.pop_back();
S.pop_back();
}
/*else if(S.size()==2 && (i==0 || S[0]!=S[1])) {
cout << 1 << endl;
return 0;
}*/
else {
int m=S.size()/2;
if(S.substr(0,m)==S.substr(m,m)) {
cout << S.size() << endl;
return 0;
}
else{
S.pop_buck();
S.pop_buck();
break;
}
}
}
}
| a.cc: In function 'int main()':
a.cc:24:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_buck'; did you mean 'pop_back'?
24 | S.pop_buck();
| ^~~~~~~~
| pop_back
a.cc:25:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_buck'; did you mean 'pop_back'?
25 | S.pop_buck();
| ^~~~~~~~
| pop_back
|
s030537309 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
for(i = s.size()/2; i>0; i--){
if(s.substr(0,i) == s.substr(i,i)){
cout << i << endl;
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:5:7: error: 'i' was not declared in this scope
5 | for(i = s.size()/2; i>0; i--){
| ^
|
s546226956 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int c=200;
for(int i=0;i<s.size()/2-1;i++){
char a[100],b[100];
int d=0;
for(int j=0;j<=i;j++){
a[j]=s.at(j);
b[j]=s.at(i+1+j);
if(a[j]==b[j])
d++;
}
if(d==i+1){
c=min(c,s.size()-(i+1)-(i+1));
}
}
cout<<c;
}
| a.cc: In function 'int main()':
a.cc:18:12: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
18 | c=min(c,s.size()-(i+1)-(i+1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
18 | c=min(c,s.size()-(i+1)-(i+1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
18 | c=min(c,s.size()-(i+1)-(i+1));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~
|
s858422026 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int c=200;
for(int i=0;i<s.size()/2-1;i++){
char a[100],b[100];
int d=0;
for(int j=0;j<=i;j++){
a[j]=s.at(j);
b[j]=s.at(i+1+j);
if(a[j]==b[j])
d++;
}
if(d==i+1){
c=min(c,s.size()-(i+1)*2);
}
}
cout<<c;
}
| a.cc: In function 'int main()':
a.cc:18:12: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
18 | c=min(c,s.size()-(i+1)*2);
| ~~~^~~~~~~~~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
18 | c=min(c,s.size()-(i+1)*2);
| ~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
18 | c=min(c,s.size()-(i+1)*2);
| ~~~^~~~~~~~~~~~~~~~~~~~
|
s548042625 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int c=200;
for(int i=0;i<s.size()/2-1;i++){
char a[100],b[100];
for(int j=0;j<=i;j++){
a[j]=s.at(j);
b[j]=s.at(i+1+j);
}
if(a==b){
c=min(c,s.size()-(i+1)*2);
}
}
cout<<c;
} | a.cc: In function 'int main()':
a.cc:14:12: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
14 | c=min(c,s.size()-(i+1)*2);
| ~~~^~~~~~~~~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
14 | c=min(c,s.size()-(i+1)*2);
| ~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
14 | c=min(c,s.size()-(i+1)*2);
| ~~~^~~~~~~~~~~~~~~~~~~~
|
s712966906 | p03672 | C++ | #include "pch.h"
#include <iostream>
#include<stdio.h>
#include<cstring>
char str[201];
char a[101], b[101];
void shorten(char str[]) {//文字列を2文字分短くする//
int i,n;
n = strlen(str);
str[n - 1] = '\0';
str[n - 2] = '\n';
}
void splid(char str[], int x) {//文字列を二つに分ける//
int i;
for (i = 0; i < x / 2; i++) {
a[i] = str[i];
b[i] = str[x / 2 + i];
}
a[x / 2] = '\n';
b[x / 2] = '\n';
}
int main() {
int len;
gets_s(str);
while (strlen(str) > 0) {
shorten(str);
len = strlen(str);
splid(str, len);
if (strcmp(a, b) == 0) {
printf("%d", len-1);
return 0;
}
}
return 0;
}
| a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s199340701 | p03672 | C++ | #include <iostream>
#include<stdio.h>
#include<cstring>
char str[201];
char a[101], b[101];
void shorten(char str[]) {//文字列を2文字分短くする//
int i,n;
n = strlen(str);
str[n - 1] = '\0';
str[n - 2] = '\n';
}
void splid(char str[], int x) {//文字列を二つに分ける//
int i;
for (i = 0; i < x / 2; i++) {
a[i] = str[i];
b[i] = str[x / 2 + i];
}
a[x / 2] = '\n';
b[x / 2] = '\n';
}
int main() {
int len;
gets_s(str);
while (strlen(str) > 0) {
shorten(str);
len = strlen(str);
splid(str, len);
if (strcmp(a, b) == 0) {
printf("%d", len-1);
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:33:9: error: 'gets_s' was not declared in this scope
33 | gets_s(str);
| ^~~~~~
|
s720970446 | p03672 | C++ | #include<stdio.h>
#include<cstring>
char str[201];
char a[101], b[101];
void shorten(char str[]) {//文字列を2文字分短くする//
int i,n;
n = strlen(str);
str[n - 1] = '\0';
str[n - 2] = '\n';
}
void splid(char str[], int x) {//文字列を二つに分ける//
int i;
for (i = 0; i < x / 2; i++) {
a[i] = str[i];
b[i] = str[x / 2 + i];
}
a[x / 2] = '\n';
b[x / 2] = '\n';
}
int main() {
int len;
gets(str);
while (strlen(str) > 0) {
shorten(str);
len = strlen(str);
splid(str, len);
if (strcmp(a, b) == 0) {
printf("%d", len-1);
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:32:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
32 | gets(str);
| ^~~~
| getw
|
s082654959 | p03672 | C++ | #include<stdio.h>
#include<cstring>
char str[201];
char a[101], b[101];
void shorten(char str[]) {//文字列を2文字分短くする//
int i,n;
n = strlen(str);
str[n - 1] = '\0';
str[n - 2] = '\n';
}
void splid(char str[], int x) {//文字列を二つに分ける//
int i;
for (i = 0; i < x / 2; i++) {
a[i] = str[i];
b[i] = str[x / 2 + i];
}
a[x / 2] = '\n';
b[x / 2] = '\n';
}
int main() {
int len;
gets_s(str);
while (strlen(str) > 0) {
shorten(str);
len = strlen(str);
splid(str, len);
if (strcmp(a, b) == 0) {
printf("%d", len-1);
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:32:9: error: 'gets_s' was not declared in this scope
32 | gets_s(str);
| ^~~~~~
|
s353406317 | p03672 | C++ | #include <bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
string n;
cin>>n;
for(int i=n.size()-1;2<=i;i--){
if(i%2==0){
if(n.substr(0,i/2-1)==s.substr(i/2,i)){
cout<<i<<endl;
return 0;
}
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:47: error: 's' was not declared in this scope
9 | if(n.substr(0,i/2-1)==s.substr(i/2,i)){
| ^
|
s972998479 | p03672 | C++ | #include <bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
string n;
cin>>n;
for(int i=n.size()-1;2<=i;i--;){
if(i%2==0){
if(n.substr(0,i/2-1)==s.substr(i/2,i)){
cout<<i<<endl;
return 0;
}
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:38: error: expected ')' before ';' token
7 | for(int i=n.size()-1;2<=i;i--;){
| ~ ^
| )
a.cc:7:39: error: expected primary-expression before ')' token
7 | for(int i=n.size()-1;2<=i;i--;){
| ^
|
s270600457 | p03672 | C++ | #include <bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
string n;
cin>>n;
for(int i=n.sise()-1;2<=i;i--;){
if(i%2==0){
if(n.substr(0,i/2-1)==s.substr(i/2,i)){
cout<<i<<endl;
return 0;
}
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:21: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sise'; did you mean 'size'?
7 | for(int i=n.sise()-1;2<=i;i--;){
| ^~~~
| size
a.cc:7:38: error: expected ')' before ';' token
7 | for(int i=n.sise()-1;2<=i;i--;){
| ~ ^
| )
a.cc:7:39: error: expected primary-expression before ')' token
7 | for(int i=n.sise()-1;2<=i;i--;){
| ^
|
s119632417 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
signed main() {
string s;
cin >> s;
bool latte = false;
latte = true;
int malta = 0;
latte = 0119;
malta = 1333;
for (int i = 0; i < s.size(); ++i) {
for(int j = i; j < s.size(); j++) {
}
if(malta == 1333) malta = 0;
}
for(int luzhiled = 0; luzhiled < s.size(); ++luzhiled) {
int i = luzhiled;
int j = luzhiled + luzhiled;
if (s.substr(0, i) == s.substr(i, j)) malta = i;
if (s.substr(0, i) == s.substr(i, i)) malta = i;
} // 4 tab de muzukasii
cout << malta << endl;
cerr << "+++ kurumizawa = ukunichia = " << endl;
return 0;
} | a.cc:10:11: error: invalid digit "9" in octal constant
10 | latte = 0119;
| ^~~~
|
s985199789 | p03672 | C++ | #include <bist/stdc++.h>
using namespace std;
signed main() {
string s;
cin >> s;
bool latte = false;
latte = true;
int malta = 0;
latte = 0119;
malta = 1333;
for (int i = 0; i < s.size(); ++i) {
for(int j = i; j < s.size(); j++) {
}
if(malta == 1333) malta = 0;
}
for(int luzhiled = 0; luzhiled < s.size(); ++luzhiled) {
int i = luzhiled;
int j = luzhiled + luzhiled;
if (s.substr(0, i) == s.substr(i, j)) malta = i;
if (s.substr(0, i) == s.substr(i, i)) malta = i;
} // 4 tab de muzukasii
cout << malta << endl;
cerr << "+++ kurumizawa = ukunichia = " << endl;
return 0;
} | a.cc:1:10: fatal error: bist/stdc++.h: No such file or directory
1 | #include <bist/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s536368844 | 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.
|
s720588226 | 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.
|
s770092202 | 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.
|
s419233700 | p03672 | C++ | #include <iostream>
#include <string>
using namespace std;
int main () {
char str [222];
cin >> str;
int n= strlen (str );
for (int i=n -2; i; i -=2) {
if( strncmp (str, str +i/2, i/2) ==0) {
cout << i;
return 0;
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:16: error: 'strlen' was not declared in this scope
7 | int n= strlen (str );
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
2 | #include <string>
a.cc:9:21: error: 'strncmp' was not declared in this scope
9 | if( strncmp (str, str +i/2, i/2) ==0) {
| ^~~~~~~
a.cc:9:21: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s498800907 | p03672 | C++ | akasakaakasakasakaakas | a.cc:1:1: error: 'akasakaakasakasakaakas' does not name a type
1 | akasakaakasakasakaakas
| ^~~~~~~~~~~~~~~~~~~~~~
|
s640485169 | p03672 | C++ | main(){
puts("Hello World");
} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:2:3: error: 'puts' was not declared in this scope
2 | puts("Hello World");
| ^~~~
|
s674417172 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int a;
string s;
map <char,int>
int main(){
cin>>s;
s.pop_back();
if(s.size()%2==1)s.pop_back;
while(a){
if(s)
}
}
| a.cc:7:1: error: two or more data types in declaration of 'main'
7 | map <char,int>
| ^~~~~~~~~~~~~~
|
s824800661 | p03672 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
char str[233];
int main() {
while(~scanf("%s", str)) {
int ln = strlen(str);
int res;
for(int i = ln-1; i >= 0; i--) {
if(i & 1) {
bool flg=1;
for(int j = 0, k=(i+1)/2; j <= (i-1)/2, k <= i; j++, k++) {
if(str[i] != str[j]) {
flg=0;
break;
}
}
}
if(!flg) continue;
else {
res = i+1;
break;
}
}
printf("%d\n", res);
}
} | a.cc: In function 'int main()':
a.cc:23:5: error: 'flg' was not declared in this scope
23 | if(!flg) continue;
| ^~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.