submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s091364695 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int res = 0;
while (true) {
string a, b;
s.erase(s.begin() + s.size() - 1);
res++;
if (s.size() % 2 != 0) continue;
a = s.substr(0, s.size() / 2);
b = s.substr(s.size() / 2, s.size());
if (a == b) {
... | a.cc: In function 'int main()':
a.cc:21:16: error: invalid conversion from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'const char*' [-fpermissive]
21 | printf(s.size());
| ~~~~~~^~
| |
| std::__cxx11::basic_string<char>::size_... |
s244617534 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
signed main() {
string s;
cin >> s;
int res = 0;
while (true) {
string a, b;
s.erase(s.begin() + s.size() - 1);
res++;
if (s.size() % 2 != 0) continue;
a = s.substr(0, s.size() / 2);
b = s.substr(s.size() / 2, s.size());
if (a == b) ... | a.cc: In function 'int main()':
a.cc:21:3: error: 'print' was not declared in this scope; did you mean 'rint'?
21 | print(s.size());
| ^~~~~
| rint
|
s059714773 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans =0 ;
for(int i = 0 ;i<= (s.size()-1)/2; i++){
bool a = true;
for ( int j = i+1 ; j<= s.size()-1 ;j++){
if ( s.at(j)!=a.at(j+i)){
a = false;
break ;
}
}
if(!a){
break;
... | a.cc: In function 'int main()':
a.cc:11:23: error: request for member 'at' in 'a', which is of non-class type 'bool'
11 | if ( s.at(j)!=a.at(j+i)){
| ^~
|
s667400079 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans =0 ;
for(int i = 0 ;i<= (s.size()-1)/2; i++){
bool a = true;
for ( int j = i+1 ; j<= (s.size()-1)/2 ;j++){
if ( s.at(j)!=a.at(j+i)){
a = false;
break ;
}
}
if(!a){
break;... | a.cc: In function 'int main()':
a.cc:11:23: error: request for member 'at' in 'a', which is of non-class type 'bool'
11 | if ( s.at(j)!=a.at(j+i)){
| ^~
|
s160734661 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans =0 ;
for(int i = 0 ;i< (s.size()-1)/2; i++){
bool a = true;
for ( int j = i ; j<i< (s.size()-1)/2 ;j++){
if ( s.at(j)!=a.at(j+i)){
a = false;
break ;
}
}
if(!a){
break;
... | a.cc: In function 'int main()':
a.cc:11:23: error: request for member 'at' in 'a', which is of non-class type 'bool'
11 | if ( s.at(j)!=a.at(j+i)){
| ^~
|
s280111476 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans =0
for(int i = 0 ;i< (s.size()-1)/2; i++){
bool a = true;
for ( int j = i ; j<i< (s.size()-1)/2 ;j++){
if ( s.at(j)!=a.at(j+i)){
a = false;
break ;
}
}
if(!a){
break;
... | a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'for'
8 | for(int i = 0 ;i< (s.size()-1)/2; i++){
| ^~~
a.cc:8:18: error: 'i' was not declared in this scope
8 | for(int i = 0 ;i< (s.size()-1)/2; i++){
| ^
|
s038321130 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int ... | a.cc: In function 'int main()':
a.cc:47:21: error: expected ',' or ';' before 'for'
47 | #define forr(i,a,b) for(int i=(a); i<(b); i++)
| ^~~
a.cc:49:19: note: in expansion of macro 'forr'
49 | #define forn(i,n) forr(i,0,n)
| ^~~~
a.cc:60:3: note: in expansion of ... |
s141911302 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int ... | a.cc: In function 'int main()':
a.cc:47:21: error: expected ',' or ';' before 'for'
47 | #define forr(i,a,b) for(int i=(a); i<(b); i++)
| ^~~
a.cc:49:19: note: in expansion of macro 'forr'
49 | #define forn(i,n) forr(i,0,n)
| ^~~~
a.cc:60:3: note: in expansion of ... |
s814257124 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int ... | a.cc: In function 'int main()':
a.cc:47:21: error: expected ',' or ';' before 'for'
47 | #define forr(i,a,b) for(int i=(a); i<(b); i++)
| ^~~
a.cc:49:19: note: in expansion of macro 'forr'
49 | #define forn(i,n) forr(i,0,n)
| ^~~~
a.cc:60:3: note: in expansion of ... |
s366337589 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
bool A(string S){
for(int i=0;i<S.size/2;i++){
if(S.at(i)!=S.at(i+S.size()/2)){
return 1;
}
}
return 0;
}
int main(){
string N;cin<<N;
if(N.size()%2){
N.pop_back();
}
while(A(N)){
N.pop_back();
N.pop_back();
}
cout<<N.size()<<en... | a.cc: In function 'bool A(std::string)':
a.cc:5:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = lo... |
s801098058 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = s.length()-2; i >= 2; i -= 2) {
vector<char> zen(i/2), kou(i/2);
for (int j = 0; j < i; j++) {
if (j < i/2)
zen[j] = s[j];
else
kou[j - i/2] = s[j];
}
bool check = true;
... | a.cc: In function 'int main()':
a.cc:25:12: error: expected ';' before '}' token
25 | break
| ^
| ;
26 | }
| ~
|
s382715082 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
using str = string;
using ll = long long;
int a[26];
int main()
{
cin.tie(0);
ios::sync_with_stdio(0);
str s;cin>>s;
int ans=s.size();
for(int i=s.size()-1;i>=0;i--)
{
a[s[i]-'a']++;
ans--
bool c=true;
... | a.cc: In function 'int main()':
a.cc:21:14: error: expected ';' before 'bool'
21 | ans--
| ^
| ;
22 | bool c=true;
| ~~~~
a.cc:23:41: error: 'c' was not declared in this scope
23 | for(int j=0;j<26;j++)if(a[j]%2) c=false;
| ... |
s861723707 | p03672 | C++ | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <boost/xpressive/xpressive_static.hpp>
#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)... | a.cc:3:10: fatal error: boost/xpressive/xpressive_static.hpp: No such file or directory
3 | #include <boost/xpressive/xpressive_static.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s739681314 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n, x, i, y;
char s[500];
gets(s);
n = strlen(s);
x = n;
while(1)
{
x = x - 2;
y = strncmp((s), (s+(x/2)), (x/2));
if(y==0)
{
cout << x << endl;
break;
... | a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(s);
| ^~~~
| getw
|
s027664633 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
for (int i = n - 2; i >= 0; i--) {
string t = s.substr(0, i);
if (t.size() % 2 == 0) {
bool ok = true;
for (int i = 0; i < t.size() / 2; i... | a.cc: In function 'int main()':
a.cc:10:18: error: 'n' was not declared in this scope
10 | for (int i = n - 2; i >= 0; i--) {
| ^
|
s840747679 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int i, j;
string s;
cin >> s;
n = s.size();
int ans=0, r=s.size()-2;
for(i=n-2; i; i-=2){
bool ok = 1;
for(j=0;j<i/2;j++){
if(s[j]!=s[j+i/2])ok=0;
}if(ok){
cout << i... | a.cc: In function 'int main()':
a.cc:11:9: error: 'n' was not declared in this scope
11 | n = s.size();
| ^
|
s653295723 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
bool f = false;
for (int j = a.size(); j >=0; j-=2) {
if (j%2 == 1 && f == false) {
f = true;
a.pop_back();
}
if (a.substr(0, a.size()/2); == a.substr(a.size()/2, a.size()-1); && f) {
cout << j << endl;
... | a.cc: In function 'int main()':
a.cc:12:17: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = lon... |
s325229500 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
bool Check(string input){
if(input.size()%2 == 1){
return false;
}
else{
int len = input.size() / 2;
for(int i=0;i<len;i++){
if(input[i] != input[i+len]) return false;
}
return true;
}
}
int main(void)... | a.cc: In function 'int main()':
a.cc:24:3: error: expected '}' at end of input
24 | }
| ^
a.cc:16:15: note: to match this '{'
16 | int main(void){
| ^
|
s512936667 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;
using ll = long long;
using ull = unsigned long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP... | a.cc: In function 'bool Ok(const std::string&, int)':
a.cc:42:7: error: 'i' was not declared in this scope
42 | for(i = 0; i < n/2; ++i)f &= s[i] == s[i+n];
| ^
|
s339618828 | p03672 | C++ | /*
* atcoder/abc089/b.cpp
*/
// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
void solve();
int main() { solve();... | a.cc: In function 'void solve()':
a.cc:21:27: error: 'n' was not declared in this scope
21 | for (int count=2; count<n; count += 2) {
| ^
|
s693657951 | p03672 | Java | public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scanner = new Scanner(System.in);
String S = scanner.nextLine();
int length = S.length();
while(true) {
if ((S.length() -1) % 2 == 0) {
String sub1 = S.substring(0, S.length() / 2);
// System.out.println(... | Main.java:5: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s157384472 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
for(int i=s.size()-2;i>0;i-=2){
if(s.substr(0,i/2)==s.substr(i/2,i/2){
cout<<i<<endl;
return 0;
}
}
}
| a.cc: In function 'int main()':
a.cc:8:42: error: expected ')' before '{' token
8 | if(s.substr(0,i/2)==s.substr(i/2,i/2){
| ~ ^
| )
a.cc:12:3: error: expected primary-expression before '}' token
12 | }
| ^
|
s374205601 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
for(int i=s.size()-2;i>-;i-=2){
if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2)){
cout<<s.size()<<endl;
return 0;
}
}
}
| a.cc: In function 'int main()':
a.cc:7:27: error: expected primary-expression before ';' token
7 | for(int i=s.size()-2;i>-;i-=2){
| ^
|
s156212805 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
s.push_back();
int hu=0;
for(int i=s.size()-2;i>-;i-=2){
if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2)){
cout<<s.size()<<endl;
return 0;
}
}
}
| a.cc: In function 'int main()':
a.cc:7:14: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()'
7 | s.push_back();
| ~~~~~~~~~~~^~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include... |
s768293168 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
s.push_back();
int hu=0;
for(int i=0;i<s.size();i++){
if(s.size()%2!=0){
s.push_back();
continue;
}
if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2)){
cout<<s.size()<<endl;
return 0;
}... | a.cc: In function 'int main()':
a.cc:7:14: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()'
7 | s.push_back();
| ~~~~~~~~~~~^~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include... |
s973577363 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
vector<string>s;
cin>>s;
s.push_back();
int hu=0;
for(int i=0;i<s.size();i++){
if(s.size()%2!=0){
s.push_back();
continue;
}
if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2)){
cout<<s.size()<<endl;
return 0... | a.cc: In function 'int main()':
a.cc:6:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
6 | cin>>s;
| ~~~^~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| ... |
s197395167 | p03672 | C++ | #include <bits/stdc++.h>
#define rep(i,x,n) for(int i=x; i<(int)(n); i++)
#define rep_eq(i,x,n) for(int i=x; i<=(int)(n); i++)
using namespace std;
int main() {
string S; cin >>S;
vector<char> vec(S.size());
rep(i,0,S.size()) vec[i]=S[i];
while(true) {
vec.pop_back();
if (vec.size()%2) continue;
el... | a.cc: In function 'int main()':
a.cc:16:41: error: expected ']' before ')' token
16 | if (vec[i]==vec[(vec.size()/2)+i)] count++;
| ^
| ]
a.cc:16:42: error: expected primary-expression before ']' token
16 | ... |
s325085846 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
string s;cin>>s;
int n = s.size();
for(int i=2;i<=s/2;i+=2){
int m = n - i;
int cc = 0;
rep(j,m/2){
if(s[j]!=s[m/2 + j])cc=1;
... | a.cc: In function 'int main()':
a.cc:11:21: error: no match for 'operator/' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
11 | for(int i=2;i<=s/2;i+=2){
| ~^~
| | |
| | int
| ... |
s183688031 | p03672 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String s=sc.next();
int n=s.length();
for(int i=0;i<s.length();i+=2){
String a=s.substring(0,2/n),b=s.substring(2/n,n);
if(a.equals(b)){
Systen.out.println(n);
... | Main.java:12: error: package Systen does not exist
Systen.out.println(n);
^
1 error
|
s114230436 | p03672 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String s=sc.next();
int n=s.length()
for(int i=0;i<s.length();i+=2){
String a=s.substring(0,2/n),b=s.substring(2/n,n);
if(a.equals(b)){
Systen.out.println(n);
... | Main.java:8: error: ';' expected
int n=s.length()
^
1 error
|
s438372780 | p03672 | C | # include < stdio .h >
# include < string .h >
int main () {
char str [222];
scanf ("%s", str ) ;
int n= strlen (str );
for ( int i=n -2; i; i -=2) {
if( strncmp (str , str +i/2 , i /2) ==0) {
printf ("%d\n" ,i);
return 0;
}
}
return 0;
} | main.c:1:11: fatal error: stdio .h : No such file or directory
1 | # include < stdio .h >
| ^~~~~~~~~~~~
compilation terminated.
|
s995757031 | p03672 | C++ | # include < stdio .h >
# include < string .h >
int main(){
string ani; cin>>ani;
int n = ani.length();
for(int i = n-2;i>=0;i-=2){
if(strncmp(str,str+i/2,i/2) == 0){
cout<<i<<endl;
return 0; }
}
return 0;
}
| a.cc:1:11: fatal error: stdio .h : No such file or directory
1 | # include < stdio .h >
| ^~~~~~~~~~~~
compilation terminated.
|
s152785347 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
s.pop_back();
while(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size())){
s.pop_back;
}
cout<<s.size()<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:7: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
9 | s.pop_back;
| ~~^~~~~~~~
In file included from /us... |
s342656403 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
vector<string>s;
cin>>s;
while(s.substr(0,s.size()/2)!=s.substr(s.size()/2,s.size()/2)){
s.pop_back();
}
cout<<s.size()<<endl;
}
| a.cc: In function 'int main()':
a.cc:6:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
6 | cin>>s;
| ~~~^~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| ... |
s441010431 | p03672 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
#include <list>
#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <... | a.cc: In function 'int main()':
a.cc:41:21: error: 'tmp' was not declared in this scope; did you mean 'tm'?
41 | s = s.substr(0, tmp-2);
| ^~~
| tm
|
s392428336 | p03672 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
#include <list>
#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <... | a.cc: In function 'int main()':
a.cc:41:20: error: 'n' was not declared in this scope
41 | for(int i=0; i<n; i++)
| ^
|
s245495506 | p03672 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(int argc, char const *argv[])
{
string S;
cin >> S;
string str1, str2;
for (int i = 0; i < S.size(); i++)
{
S.pop_back();
if (S.size() % != 0) continue;
str1 = S.substr(0, (S.size() / 2));
str2 = S... | a.cc: In function 'int main(int, const char**)':
a.cc:15:24: error: expected primary-expression before '!=' token
15 | if (S.size() % != 0) continue;
| ^~
|
s877373715 | p03672 | C++ | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
int main() {
string S;
cin >> S;
if(S.size() == 2) { cout << 0; return 0; }
for(int i = 0; i < S.size() - 2; i++) {
S.pop_back();
int N = S.size();
if(S.substr(0, N / 2) == S.substr(N / 2, N / 2)) {
cou... | a.cc: In function 'int main()':
a.cc:14:29: error: expected ';' before 'return'
14 | cout << S.size() - 1;1
| ^
| ;
15 | return 0;
| ~~~~~~
|
s028283626 | p03672 | C++ | #include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef long long ll;
namespace mp = boost::multiprecision;
using Mint = mp::cpp_int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = int(a); i < int(b); i++)
#define all(v) v.begin(), v.end()
... | a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
2 | #include <boost/multiprecision/cpp_int.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s890794152 | p03672 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int count=0;
string data,data1,data2;
cin>>data;
if(data.size()%2==0){
count+=2
data1=data.substr(0,data.size()/2-1);
data2=data.substr(data.size()/2-1,data.size()/2-1);
}
else if(data.size()%2!=0){
count+=1;
data1=d... | a.cc: In function 'int main()':
a.cc:10:13: error: expected ';' before 'data1'
10 | count+=2
| ^
| ;
11 | data1=data.substr(0,data.size()/2-1);
| ~~~~~
|
s425615739 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
for(int i=s.size()-2;i>=0;i-=2){
s=s.substr(0,s.size-2);
if(s.substr(0,i/2)==s.substr(i/2+1,i)){
cout << i;
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:7:20: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsign... |
s788058030 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int ctoi(const char c) {
if ('0' <= c && c <= '9') return (c - '0');
return -1;
}
vector<int> input(int n) {
vector<int> vec(n);
for (int i = 0; i < n; i++) {
cin >> vec.at(i);
}
return vec... | a.cc:88:7: error: stray '#' in program
88 | sort#include <bits/stdc++.h>
| ^
a.cc: In function 'int main()':
a.cc:88:7: error: expected ';' before 'include'
88 | sort#include <bits/stdc++.h>
| ^~~~~~~~
| ;
a.cc:89:20: error: statement cannot resolve address of overloaded fu... |
s901712696 | p03672 | C++ | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
string s;
cin>>s;
int n=s.size();
for(int i=n-2;i;i-=2){
if(strncmp(s,s+n/2,n/2)==0){
cout<<i<<endl;
return 0;
}
}
}
| a.cc: In function 'int main()':
a.cc:10:19: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
10 | if(strncmp(s,s+n/2,n/2)==0){
| ~^~~~
| | |
| | int
| ... |
s960629066 | p03672 | C++ | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
string s;
cin>>s;
int n=s.size();
for(int i=n-2;i;i-=2){
if(strncmp(s,s+n/2,n/2)){
cout<<i<<endl;
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:10:19: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
10 | if(strncmp(s,s+n/2,n/2)){
| ~^~~~
| | |
| | int
| std... |
s826384206 | p03672 | C++ | #include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main() {
string s;
int cnt=0;
getline(cin,s);
for(int i=s/2;i>=0;i--){
for(int j=1;j<=i;i++){
if(s[j-1]==s[j-1+i])cnt++;
}
if(cnt==i){
cout<<i;
break;
}... | a.cc: In function 'int main()':
a.cc:9:20: error: no match for 'operator/' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
9 | for(int i=s/2;i>=0;i--){
| ~^~
| | |
| | int
| s... |
s283687126 | p03672 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) fo... | a.cc: In function 'bool evenStr(std::string)':
a.cc:16:28: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_ty... |
s834404258 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
bool gu(string S){
int N=S.size();
bool flag=true;
for(int i=0;i<N/2;i++){
if(S.at(i)!=S.at(i+N/2)){
flag=false;
}
}
return flag;
}
int main(){
string T;
cin>>T;
for(int i=0;i<N/2;i++){
T.pop_back();
T.pop_back();
if(gu(T)){
... | a.cc: In function 'int main()':
a.cc:17:17: error: 'N' was not declared in this scope
17 | for(int i=0;i<N/2;i++){
| ^
|
s294989017 | p03672 | C++ | # include < stdio .h >
2 # include < string .h >
3
4 int main () {
5 char str [222];
6 scanf ("%s", str ) ;
7 int n= strlen (str ) ;
8 for (int i=n -2; i; i -=2) {
9 if( strncmp (str , str +i/2 , i/2) ==0) {
10 printf ("%d\n" ,i) ;
11 return 0;
12 }
13 }
14 return 0;
15 }
#include<stdio.h>
#include<string.h>
int main(... | a.cc:1:11: fatal error: stdio .h : No such file or directory
1 | # include < stdio .h >
| ^~~~~~~~~~~~
compilation terminated.
|
s525807482 | p03672 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <cmath>
using namespace std;
using ll = long long;
string str;
ll ans = 0;
int main() {
cin >> str;
for (ll i = 0; i < str.length / 2; i++)
{
if (str.substr(0, (size_t)i + 1) == str.substr((size_t)i + 1, (size_t)i + 1)) {
... | a.cc: In function 'int main()':
a.cc:17:32: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long uns... |
s517145845 | p03672 | C | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
const long long MODNUM = 7;
int main() {
string s; cin >> s;
// 最初に1文字必ず消す必要がある
string tmp = s.substr(0, s.size()-1);
while(tmp.size() >= 2) {
if(tmp.size() % 2 ... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s593274100 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_b... | a.cc: In function 'int main()':
a.cc:481:18: error: 'n' was not declared in this scope
481 | for(int i=2; i<n-1; i+=2){
| ^
|
s804781669 | p03672 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <functional>
using namespace std;
int main(){
string s;
cin >> s;
bool f = true;
for(int i = 0; i < s.size() / 2; i++){
s.pop_back();
s.pop_back();
//cout << s << endl;
for(int j = 0; j < s.s... | a.cc: In function 'int main()':
a.cc:29:4: error: expected '}' at end of input
29 | }
| ^
a.cc:9:11: note: to match this '{'
9 | int main(){
| ^
|
s671992332 | p03672 | C++ | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a ... | a.cc: In function 'int main()':
a.cc:65:13: error: 'i' was not declared in this scope
65 | for(i = n - 3;i >= 0;i-=2) {
| ^
a.cc:67:22: error: 'j' was not declared in this scope
67 | for (j = 0;j <(i+1)/2;++j) {
| ^
|
s953790370 | p03672 | C++ | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a ... | a.cc:65:34: error: macro "rep" requires 2 arguments, but only 1 given
65 | rep(i = n - 3;i >= 0;i-=2) {
| ^
a.cc:2:9: note: macro "rep" defined here
2 | #define rep(i,n)for(int i=0;i<n;++i)
| ^~~
a.cc: In function 'int main()':
a.cc:65:9: error: 'rep' ... |
s788778465 | p03672 | C++ | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
using namespace std;
int main() {
string s;
cin >> s;
for (int i = 0; i < s.size(); i++) {
s.pop_back();
if (s.size() == 2) {
if (s[0] == s[1]) {
cout << s.size() <... | a.cc: In function 'int main()':
a.cc:20:31: error: expected ';' before '{' token
20 | } else (s.size() == 1) {
| ^~
| ;
|
s412650360 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
string s;cin>>s;
while (s.size()>0) {
s.pop_back();
if (s.size()%2!=0) continue;
rep(i,n/2) if (s[i]!=s[i+n/2]) continue;
cout << s.size();
return 0;
}
}
| a.cc: In function 'int main()':
a.cc:10:11: error: 'n' was not declared in this scope
10 | rep(i,n/2) if (s[i]!=s[i+n/2]) continue;
| ^
a.cc:3:45: note: in definition of macro 'rep'
3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
| ^
|
s464434053 | p03672 | C++ | #include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string.h>
using namespace std;
int main(void){
char str [222];
scanf ("%s", str ) ;
int n= strlen (str ) ;
for (int i=n -2; i; i -=2) {
if( strncmp (str , str +i/2 , i/2) ==0) {
printf ("%d\n" ,i) ;
return 0;
}
}... | a.cc: In function 'int main()':
a.cc:19:11: error: expected '}' at end of input
19 | return 0;
| ^
a.cc:8:15: note: to match this '{'
8 | int main(void){
| ^
|
s716960180 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int ans = 0;
if (S.size() % 2 == 1) {
S.erase(S.size() - 1);
}
for (int i = S.size(); i >= 0; i-=2) {
bool judge = true;
for (int j = 0; j < i / 2 j++) {
if (S[j] != S[j + (i / 2)]) judge = false;
}
if (... | a.cc: In function 'int main()':
a.cc:12:30: error: expected ';' before 'j'
12 | for (int j = 0; j < i / 2 j++) {
| ^~
| ;
|
s796287197 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int ans = 0;
if (S % 2 == 1) {
S.erase(S.size() - 1);
}
for (int i = S.size(); i >= 0; i-=2) {
bool judge = true;
for (int j = 0; j < i / 2 j++) {
if (S[j] != S[j + (i / 2)]) judge = false;
}
if (judge) ... | a.cc: In function 'int main()':
a.cc:7:9: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
7 | if (S % 2 == 1) {
| ~ ^ ~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}
In fil... |
s864412948 | p03672 | C++ | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << '\n'
typedef int64_t Int;
const double pi = M_PI;
using namespace std;
int main() {
string n;
cin >> n;
string a, b;
for (int i = 0; i < n.size(); i++) {
if (n.size() - i % 2 == 0) {
a = n.substr(0, ... | a.cc: In function 'int main()':
a.cc:22:22: error: expected ';' before '}' token
22 | break
| ^
| ;
23 | }
| ~
|
s196289780 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans=0;
for(int i=s.size()-3;i>0;i-=2){
int count=0;
for(int j=0;j<=(i/2);j++){
if(s.at(j)==s.at(j+((i+1)/2)) count++;
}
if(count==((i+1)/2)){
ans=i+1;
b... | a.cc: In function 'int main()':
a.cc:11:42: error: expected ';' before 'count'
11 | if(s.at(j)==s.at(j+((i+1)/2)) count++;
| ^~~~~~
| ;
a.cc:12:9: error: expected primary-expression before '}' token
12 | ... |
s401039695 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans=0;
for(int i=s.size()-3;s>0;s-=2){
int count=0;
for(int j=0;j<=(i/2);j++){
if(s.at(j)==s.at(j+((i+1)/2)) count++;
}
if(count==((i+1)/2)){
ans=i+1;
b... | a.cc: In function 'int main()':
a.cc:8:27: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
8 | for(int i=s.size()-3;s>0;s-=2){
| ~^~
| | |
| | int
... |
s593391921 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s; cin>>s; int c=0;
for(int i=s.length()-2;i>=0;i--){
if(s[i]==s[s.length()-1]){if((s.length()-i)%2==0)cout<<s.length()-i;break;else continue ;}
}
}
| a.cc: In function 'int main()':
a.cc:6:76: error: expected '}' before 'else'
6 | if(s[i]==s[s.length()-1]){if((s.length()-i)%2==0)cout<<s.length()-i;break;else continue ;}
| ~ ^~~~
a.cc: At global scope:
a.cc:9:1: error: expected declar... |
s990279795 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int sl = s.size();
for(int i = 1;i < s.size()/2;i++)
{
sl - = 2;
if(s.substr(0,sl/2) == s.substr(sl/2,sl/2))
{
break;
}
}
cout << sl << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:22: error: expected primary-expression before '=' token
10 | sl - = 2;
| ^
|
s238703371 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string S;cin>>S;
while(1){
S.erase(S.size()-2,2);
for(int i=0;i<S.size()/2;i++)if(S.at(i)!=S.at(i+S.size()/2))break;
if(i==S.size()/2)break;
}
cout<<S<<endl;
} | a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
8 | if(i==S.size()/2)break;
| ^
|
s382944537 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin >> S;
if(S.length==4){
cout<<2<<endl:
return 0;
}
for(int i=2;i<S.length()+1;i=i+2){
S=S.erase(S.length()-2);
if(S.substr(S.length()/2)==S.substr(0,S.length()/2)){
cout<<S.length()<<endl;
return 0;
}
... | a.cc: In function 'int main()':
a.cc:7:8: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig... |
s936811035 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl
const int maxn = 1e6 + 5;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
string s; cin>>s;
s.p... | a.cc: In function 'int main()':
a.cc:15:15: error: expected ';' before 's'
15 | s.pop_back() s.pop_back();
| ^~
| ;
|
s115978886 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl
const int maxn = 1e6 + 5;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
string s; cin>>s;
s.p... | a.cc: In function 'int main()':
a.cc:15:15: error: expected ';' before 's'
15 | s.pop_back() s.pop_back();
| ^~
| ;
a.cc:19:17: error: expected ';' before 's'
19 | s.pop_back() s.pop_back();
| ^~
| ;
|
s763977265 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl
const int maxn = 1e6 + 5;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
stirng s; cin>>s;
s.p... | a.cc: In function 'int main()':
a.cc:14:3: error: 'stirng' was not declared in this scope
14 | stirng s; cin>>s;
| ^~~~~~
a.cc:14:18: error: 's' was not declared in this scope
14 | stirng s; cin>>s;
| ^
|
s154005042 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
for(int i=1;i<=s.length();i++){
if(s.length()%2==0){
string str = s.substr(0,s.length()/2-1-(i-1));
if(equal(str.begin(), str.end(), s.substr(s.length()/2,s.length()/2-1-(i-1)))){
cout << s.length()-i;
b... | In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'static bool std::__equal<_BoolType>::equal(_II1, _II1, _II2) [with _II1 = char*; _II2 = std::__... |
s094873440 | p03672 | C++ | #include<stdio .h>
#include<string .h>
int main ()
{
char str [222];
scanf ("%s", str ) ;
int n= strlen (str ) ;
for (int i=n -2; i; i -=2)
{
if( strncmp (str , str +i/2 , i/2) ==0)
{
printf ("%d\n" ,i) ;
return 0;
}
}
return 0;
}
| a.cc:1:9: fatal error: stdio .h: No such file or directory
1 | #include<stdio .h>
| ^~~~~~~~~~
compilation terminated.
|
s155577606 | p03672 | C | # include < stdio .h >
# include < string .h >
int main ()
{
char str [222];
scanf ("%s", str ) ;
int n= strlen (str ) ;
for (int i=n -2; i; i -=2)
{
if( strncmp (str , str +i/2 , i/2) ==0)
{
printf ("%d\n" ,i) ;
return 0;
}
}
return 0;
} | main.c:1:11: fatal error: stdio .h : No such file or directory
1 | # include < stdio .h >
| ^~~~~~~~~~~~
compilation terminated.
|
s418247904 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin>>a;
for(int i=1;i<=a.length()/2;i++){
a.pop_back();a.pop_back();
for(int j=0;j<a.length()/2;j++){
if(a.at(i)!=a.at(i+a.length()/2))break;
else{cout<<i*2<<endl;}}
}
| a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s261006350 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin>>a;
for(int i=1;i<=a.length()/2;i++){
a.pop_back();a.pop_back();
for(int j=0;j<a.length()/2;j++){
if(a.at(i)!=a.at(i+a.length()/2))break;}
else{cout<<i*2<<endl;}
}
| a.cc: In function 'int main()':
a.cc:13:5: error: 'else' without a previous 'if'
13 | else{cout<<i*2<<endl;}
| ^~~~
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s964177387 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin>>a;
for(int i=1;i<=a.length()/2;i++;){
a.pop_back();a.pop_back();
for(int j=0;j<a.length()/2;j++){
if(a.at(i)!=a.at(i+a.length()/2))break;}
else{cout<<i*2<<endl;}
}
| a.cc: In function 'int main()':
a.cc:9:34: error: expected ')' before ';' token
9 | for(int i=1;i<=a.length()/2;i++;){
| ~ ^
| )
a.cc:9:35: error: expected primary-expression before ')' token
9 | for(int i=1;i<=a.length()/2;i++;){
... |
s278530287 | p03672 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
char[] c = sc.next().toCharArray();
int N = c.length;
boolean b = true;
boolean dame = false;
int ans ;
for(int i = 2;i<N;i+=2)
{
dame = false;
for(int k = 0;k<(N-i)/2;k... | Main.java:23: error: variable ans might not have been initialized
System.out.println(ans);
^
1 error
|
s554192218 | p03672 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
char[] c = sc.next().toCharArray();
boolean b = true;
boolean dame = false;
int ans ;
for(int i = 2;i<N;i+=2)
{
dame = false;
for(int k = 0;k<(N-i)/2;k++)
{
if(... | Main.java:9: error: cannot find symbol
for(int i = 2;i<N;i+=2)
^
symbol: variable N
location: class Main
Main.java:12: error: cannot find symbol
for(int k = 0;k<(N-i)/2;k++)
^
symbol: variable N
location: class Main
Main.java:14: error: cannot find symbol
... |
s002723477 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
int frr[28]={0};
int arr[28]={0};
for(int i=0;i<s.size();i++)
{
frr[s[i]-'a']++;
}
for(int i=s.size()-1;i>=0;i--)
{
frr[s[i]-'a']--;
arr[s[i]-'a']++;
int counter=0;
fo... | a.cc: In function 'int main()':
a.cc:40:26: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)'
40 | cout<<max(i,s.size()-i)<<endl;
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
fro... |
s731977750 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
signed main(){
string a,b,c;
int b;
cin>>a;
for(int i=0;i<a.size();i++){
if((a.size()-i)%2==0){
for(int j=0;j<(a.size()-i)/2;j++){
b+=a[j];
}
for(int j=(a.size()-i)/2;j<a.size()-i;j++){
c+=a[j];
}
if(b==c){
d... | a.cc: In function 'int main()':
a.cc:5:7: error: conflicting declaration 'int b'
5 | int b;
| ^
a.cc:4:12: note: previous declaration as 'std::string b'
4 | string a,b,c;
| ^
a.cc:16:9: error: 'd' was not declared in this scope
16 | d=b.size();
| ^
a.cc:... |
s796120620 | p03672 | Java | import org.assertj.core.util.Strings;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println(execute(sc.nextLine()));
}
public static int ex... | Main.java:1: error: package org.assertj.core.util does not exist
import org.assertj.core.util.Strings;
^
Main.java:28: error: cannot find symbol
if (!Strings.isNullOrEmpty(s)) {
^
symbol: variable Strings
location: class Main
2 errors
|
s285774172 | p03672 | C++ | # include < stdio .h >
# include < string .h >
int main () {
char str [222];
scanf ("%s", str ) ;
int n= strlen (str ) ;
for (int i=n -2; i; i -=2) {
if( strncmp (str , str +i/2 , i/2) ==0) {
printf ("%d\n" ,i) ;
return 0;
}
}
return 0;
} | a.cc:1:11: fatal error: stdio .h : No such file or directory
1 | # include < stdio .h >
| ^~~~~~~~~~~~
compilation terminated.
|
s401578884 | p03672 | C++ | #include<bits/stdc++.h>
3
4 int main () {
5 char str [222];
6 scanf ("%s", str ) ;
7 int n= strlen (str ) ;
8 for (int i=n -2; i; i -=2) {
9 if( strncmp (str , str +i/2 , i/2) ==0) {
10 printf ("%d\n" ,i) ;
11 return 0;
12 }
13 }
14 return 0;
15 } | a.cc:2:1: error: expected unqualified-id before numeric constant
2 | 3
| ^
|
s756067757 | p03672 | C++ | # include < stdio .h >
# include < string .h >
int main () {
char str [222];
scanf ("%s", str ) ;
int n= strlen (str) ;
for (int i=n -2; i; i -=2) {
if( strncmp (str , str +i/2 , i/2) ==0) {
printf ("%d\n" ,i) ;
return 0;
}
}
return 0;
} | a.cc:1:11: fatal error: stdio .h : No such file or directory
1 | # include < stdio .h >
| ^~~~~~~~~~~~
compilation terminated.
|
s209211860 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int isEvenstr(string s){
if(s.size()%2!=0)return 0;
if(s.substr(0,s.size()/2)+s.substr(0,s.size()/2)==s)return 1;
return 0;
}
int main(){
string s;
cin>>s;
for(i=s.size();0<i;i--){
if(isEvenstr(s.substr(0,i))==1){
cout<<i;
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:13:7: error: 'i' was not declared in this scope
13 | for(i=s.size();0<i;i--){
| ^
|
s115636926 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
int isEvenstr(string s){
if(s.size()%2!=0)return 0;
if(s.substr(0,s.size/2)+s.substr(0,s.size/2)==s)return 1;
return 0;
}
int main(){
string s;
cin>>s;
for(i=s.size;0<i;i--){
if(isEvenstr(s.substr(0,i))==1){
cout<<i;
return 0;
}
}
} | a.cc: In function 'int isEvenstr(std::string)':
a.cc:6:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_ty... |
s842124057 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
main(){
string s;
cin>>s;
int n=s.size();
int ans=0;
for(int i=0;i<n;++i){
int len=n-i;
if(len%2!=0)continue;
int half=len/2;
string ss=s.substr(0,half);
string tt=s.substr(half,falf);
if(ss==tt){
cout<<ss.size()<<endl;
return 0;... | a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:13:29: error: 'falf' was not declared in this scope; did you mean 'half'?
13 | string tt=s.substr(half,falf);
| ^~~~
| ... |
s695193743 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#defin... | a.cc: In function 'int main()':
a.cc:260:11: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&]', declared w... |
s969356068 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#defin... | a.cc: In function 'int main()':
a.cc:260:11: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&]', declared w... |
s396312846 | p03672 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#defin... | a.cc: In function 'int main()':
a.cc:260:11: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&]', declared w... |
s805253024 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string w;
cin >> w;
for (int i = w.size()-3; i >= 0; i-=2){
if(w[i] == w[(i/2)] ){
cout << i << endl;
}
return 0;
}
}
}
| a.cc:20:1: error: expected declaration before '}' token
20 | }
| ^
|
s707616314 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string w;
cin >> w;
for (int i = w.size()-2; i >= 0; i-=2){
if(w[i] == w[(i/2)] ){
cout << i << endl;
}
return 0;
}
}
} | a.cc:20:1: error: expected declaration before '}' token
20 | }
| ^
|
s269232723 | p03672 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner kbd = new Scanner(System.in);
String s = sc.next();
int x = 0;
for(int i = s.length()-1 ; i>0 ; i--){
s = s.substring(0,i);
String s1 = s.substring(0,i/2);
String s2 = s.substring(i/2,i);... | Main.java:6: error: cannot find symbol
String s = sc.next();
^
symbol: variable sc
location: class Main
Main.java:15: error: cannot find symbol
if(s1.epuals(s2)){
^
symbol: method epuals(String)
location: variable s1 of type String
2 errors
|
s638165403 | p03672 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner kbd = new Scanner(System.in);
String s = sc.next();
int x = 0;
for(int i = s.length()-1 ; i>0 ; i--){
s = s.substring(0,i);
String s1 = s.substring(0,i/2);
String s2 = s.substring(i/2,i);... | Main.java:6: error: cannot find symbol
String s = sc.next();
^
symbol: variable sc
location: class Main
Main.java:15: error: cannot find symbol
if(s1.epuals(s2)){
^
symbol: method epuals(String)
location: variable s1 of type String
2 errors
|
s598172246 | p03672 | C++ | #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
string S;
cin >> S;
bool flag = true;
for (int i = 1; i < (S.length()-1); i++){
flag = true;
for (int j = 0; j < (S.length()-i); j++){
if ((S.length()-i) % 2 == 0){
... | a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
5 | string S;
| ^~~~~~
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin >> S;
| ^~~
a.cc:6:12: error: 'S' was not declared in this scope
6 | cin >> S;
| ^
a.... |
s423013740 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
string S;
cin >> S;
for (int i = 1; i < (S.length()-1); i++){
bool flag = true;
for (int j = 0; j ... | a.cc: In function 'int main()':
a.cc:30:9: error: 'flag' was not declared in this scope
30 | if (flag == false) {
| ^~~~
|
s046820885 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
string S;
cin >> S;
for (int i = 1; i < (S.length()-1); i++){
bool flag = true;
for (int j = 0; j ... | a.cc: In function 'int main()':
a.cc:13:20: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'?
13 | if ((S.lenght()-i) % 2 == 0){
| ^~~~~~
| length
a.cc:14:41: error: 'std::string' {aka... |
s378470750 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
string S;
cin >> S;
bool flag = true;
for (int i = 1; i < (S.length()-1); i++){
for (int j = 0; j < (S... | a.cc: In function 'int main()':
a.cc:12:48: error: expected ';' before ')' token
12 | for (int j = 0; j < (S.length()-i), j++){
| ^
| ;
a.cc:13:20: error: 'std::string' {aka 'class std::__cxx11::basic_st... |
s921512466 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
string S;
cin >> S;
bool flag = true;
for (int i = 1; i < S.length()-1; i++){
for (int j = 0; j < S.le... | a.cc: In function 'int main()':
a.cc:12:46: error: expected ';' before ')' token
12 | for (int j = 0; j < S.length()-i, j++){
| ^
| ;
a.cc:13:20: error: 'std::string' {aka 'class std::__cxx11::basic_string<c... |
s987030603 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
bool func(string s) {
for(int i = 0;i < s.size() / 2;i++) {
if(s.at(i) != s.at(i + s.size() / 2)) {
return false;
}
}
return true;
}
int main() {
string s;
cin >> s;
while() {
s.pop_back();
s.pop_back();
if(func(s)) {
cout << s.si... | a.cc: In function 'int main()':
a.cc:14:9: error: expected primary-expression before ')' token
14 | while() {
| ^
|
s540622854 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
bool func(string s) {
for(int i = 0;i < n / 2;i++) {
if(s.at(i) != s.at(i + n / 2)) {
return false;
}
}
return true;
}
int main() {
string s;
cin >> s;
while() {
s.pop_back();
s.pop_back();
if(func(s)) {
cout << s.size() << endl;
... | a.cc: In function 'bool func(std::string)':
a.cc:4:21: error: 'n' was not declared in this scope
4 | for(int i = 0;i < n / 2;i++) {
| ^
a.cc: In function 'int main()':
a.cc:14:9: error: expected primary-expression before ')' token
14 | while() {
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.