submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s494606518 | p03671 | C++ | int main(){
int a,b,c;
scanf("%d %d %d", &a, &b, &c);
int max = a;
if(b>max) max=b;
if(c>max)max=c;
printf("%d\n",a+b+c-max);
return 0;
} | a.cc: In function 'int main()':
a.cc:3:1: error: 'scanf' was not declared in this scope
3 | scanf("%d %d %d", &a, &b, &c);
| ^~~~~
a.cc:7:1: error: 'printf' was not declared in this scope
7 | printf("%d\n",a+b+c-max);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main(){
|
s823887976 | p03671 | C++ |
int main(){
int a,b,c;
int max = a;
if (a
| a.cc: In function 'int main()':
a.cc:6:6: error: expected ')' at end of input
6 | if (a
| ~ ^
| )
a.cc:6:6: error: expected statement at end of input
a.cc:6:6: error: expected '}' at end of input
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s000413682 | p03671 | C | #include <stdio.h>
int main(void){
int a;
int b;
int c;
while(1<=a<=10000){
scanf("%d" , &a);}
while(1<=b<=10000){
scanf("%d" , &b)};
while(1<=c<=10000){
scanf("%d" , &c)};
if(a > b && c > b)
{printf("%d",a+c)}
if(a > c && b > c)
{printf("%d",a+b)}
if(b > a && c > a)
{printf("%d",b+c)}
} | main.c: In function 'main':
main.c:10:25: error: expected ';' before '}' token
10 | scanf("%d" , &b)};
| ^
| ;
main.c:12:25: error: expected ';' before '}' token
12 | scanf("%d" , &c)};
| ^
| ;
main.c:14:18: error: expected ';' before '}' token
14 | {printf("%d",a+c)}
| ^
| ;
main.c:16:18: error: expected ';' before '}' token
16 | {printf("%d",a+b)}
| ^
| ;
main.c:18:18: error: expected ';' before '}' token
18 | {printf("%d",b+c)}
| ^
| ;
|
s608365828 | p03671 | C | #include <stdio.h>
int main(void){
int a;
int b;
int c;
while(1<=a<=10000){
scanf("%d" , &a);}
while(1<=b<=10000){
scanf("%d" , &b)};
while(1<=c<=10000){
scanf("%d" , &c)};
if(a > b && c > b)
{printf("%d",a+c)}
if(a > c && b > c)
{printf("%d",a+b)}
if(b > a && c > a)
{printf("%d",b+c)}
} | main.c: In function 'main':
main.c:10:25: error: expected ';' before '}' token
10 | scanf("%d" , &b)};
| ^
| ;
main.c:12:25: error: expected ';' before '}' token
12 | scanf("%d" , &c)};
| ^
| ;
main.c:14:18: error: expected ';' before '}' token
14 | {printf("%d",a+c)}
| ^
| ;
main.c:16:18: error: expected ';' before '}' token
16 | {printf("%d",a+b)}
| ^
| ;
main.c:18:18: error: expected ';' before '}' token
18 | {printf("%d",b+c)}
| ^
| ;
|
s928756722 | p03671 | C | #include <stdio.h>
int main(void){
char str[201];
int i,j;
scanf("%s",str);
i=0;
while(str[i]!='\0') i++;
str[i-1]='\0';
while(1){
if(i%2==0){
str[i-2]='\0';
}
i=0;
while(str[i]!='\0') i++;
for(j=0;j<i/2;j++){
if(str[j]!=str[i/2+j]){
break;
}
}
if(j==i/2){
printf("%d\n",i);
break;
}
str[i-1]='\0';
if(i==0){
break;
}
}
| main.c: In function 'main':
main.c:34:3: error: expected declaration or statement at end of input
34 | }
| ^
|
s265959444 | p03671 | Java | Loading subst-jis...done
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int sum = 0;
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if (a >= b && a >= c) {
sum = b + c;
} else if (b >= a && b >= c) {
sum = a + c;
} else {
sum = a + b;
}
System.out.println(sum);
}
} | Main.java:1: error: class, interface, enum, or record expected
Loading subst-jis...done
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.*;
^
2 errors
|
s018944638 | p03671 | C++ | Loading subst-jis...done
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int sum = 0;
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if (a >= b && a >= c) {
sum = b + c;
} else if (b >= a && b >= c) {
sum = a + c;
} else {
sum = a + b;
}
System.out.println(sum);
}
} | a.cc:1:1: error: 'Loading' does not name a type
1 | Loading subst-jis...done
| ^~~~~~~
a.cc:3:1: error: 'import' does not name a type
3 | import java.util.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
5 | public class Main {
| ^~~~~~
|
s750991349 | p03671 | C++ | #include <cstdio>
#define min(a,b) a>b ? b : a
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
int A,B,C;
A = a+b;
B = b+c;
C = a+c;
int ans = min(A,B);
printf("%d\n",min(ans,C));
return 0;
| a.cc: In function 'int main()':
a.cc:18:11: error: expected '}' at end of input
18 | return 0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s617103482 | p03671 | C++ | #include <cstdio>
#define min(a,b) a>b ? b : a;
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
int A,B,C;
A = a+b;
B = b+c;
C = a+c;
int ans = min(A,B);
printf("%d\n",min(ans,C));
return 0;
} | a.cc: In function 'int main()':
a.cc:2:29: error: expected ')' before ';' token
2 | #define min(a,b) a>b ? b : a;
| ^
a.cc:16:15: note: in expansion of macro 'min'
16 | printf("%d\n",min(ans,C));
| ^~~
a.cc:16:7: note: to match this '('
16 | printf("%d\n",min(ans,C));
| ^
a.cc:16:25: error: expected primary-expression before ')' token
16 | printf("%d\n",min(ans,C));
| ^
|
s567384055 | p03671 | C++ | # include < stdio .h >
int main () {
int a, b, c;
scanf ("%d␣%d␣%d", &a, &b, &c);
int max =a;
if(b> max ) max =b;
if(c> max ) max =c;
printf ("%d\n", a+b+c-max );
return 0;
} | a.cc:1:11: fatal error: stdio .h : No such file or directory
1 | # include < stdio .h >
| ^~~~~~~~~~~~
compilation terminated.
|
s922964331 | p03671 | C++ |
/** || By The Name of Allah, Who Created Me. || **/
/**
* Author : Farid ul Islam Chy.
* Batch : 38th.
* Semester : 7C(E).
* Leading University, Sylhet.
* Online Judge: Atcoder
**/
#include <bits/stdc++.h>
using namespace std;
#define gc getchar unlocked
#define gc getchar
#define pc putchar_unlocked
#define pc putchar
#define pb push_back
#define ForA(n) for (ll i=0; i<n; i++)
#define ForA2(n) for (ll j=0; j<n; j++)
#define ForA3(n) for (ll k=0; k<n; k++)
#define ForN(n) for (ll i=1; i<=n; i++)
#define ForN2(n) for (ll j=1; j<=n; j++)
#define ForN3(n) for (ll k=1; k<=n; k++)
#define SortA(n,x) sort(n,n+x);
#define SortS(s) sort(s.begin(), s.end());
#define SortRS(s) sort(s.rbegin(), s.rend());
#define Search(s) s.begin(), s.end()
#define SortSG(n) sort(n.begin(), n.end(), greater<int>());
#define Cin(a) cin>>a;
#define GCin(a) getline(cin,a);
#define Sz(a) a.size()
#define Cin2(a,b) cin>>a>>b;
#define Cin3(a,b,c) cin>>a>>b>>c;
#define Cin4(a,b,c,d) cin>>a>>b>>c>>d;
#define scan2(a,b) scan(a);scan(b);
#define scan3(a,b,c) scan(a);scan(b),scan(c);
#define scan4(a,b,c,d) scan(a);scan(b),scan(c),scan(d)
#define Unique(n) sort(Search(n)),n.erase(unique(Search(n)),n.end())
#define PI 3.1415926535897932384626433832795l
#define Ignore cin.ignore();
#define Cout(n) cout<<n<<endl;
#define mem(n,i) memset(n,i,sizeof n);
#define deci(n) cout<<fixed<<setprecision(n);
#define square(n) n*n
#define cube(n) n*n*n
#define F first
#define S second
#define bug() cerr<<"*****<>*****\n";
typedef unsigned long long ull;
typedef long double ldb;
typedef long long ll;
typedef stringstream SS;
typedef vector<string> VS;
typedef vector<ll> VI;
typedef vector<char> VC;
typedef map<string, string> MSS;
typedef map <ll,string> MIS;
typedef map <char,ll> MCI;
typedef map <string,ll> MSI;
typedef map <ll,ll> MII;
typedef pair<int, int> pii;
const int dx4[] = {-1, 0, 1, 0};
const int dy4[] = { 0, 1, 0,-1};
const int dx8[] = {-1, 0, 1, 0, -1,-1, 1, 1};
const int dy8[] = { 0, 1, 0,-1, -1, 1,-1, 1};
const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2 , -2, 2,-2, 1,-1};
template <typename T> inline T ItoS(T n){SS a; a<<n;return a.str();}
template <typename T> inline T TrailingZeros(T n){ll cnt = 0;for(ll i=5; n/i>=1; i*=5) cnt += n/i;return cnt;}
template <typename T> inline T StoI(T s){ll sum=0;for(ll i=0; i<Sz(s); i++){s[i]-='0';sum=sum*10+s[i];}return sum;}
template <typename T> inline T binary_decimal(T n){ll decimal=0, i=0, rem;while (n!=0){rem = n%10;n/=10;decimal += rem*pow(2,i);++i;}return decimal;}
template <typename T> inline T LCM(T a,T b){return (a*b)/GCD(a,b);}
template <typename T> inline T maxi(T x, T y) { if(x>y) return x; else return y;}
template <typename T> inline T maxi(T x, T y,T z) { return maxi(maxi(x,y),z);}
template <typename T> inline T mini(T x, T y) { if(x<y) return x; else return y;}
template <typename T> inline T mini(T x, T y,T z) { return mini(mini(x,y),z);}
template <typename T> inline T GCD(T a,T b) {ll t;while(a){t = a;a = b%a;b = t;}return b;}
template <typename T> inline T Pow(T base,T exp){ll result = 1;while (exp){if(exp&1)result*=base;exp>>=1;base*=base;}return result;}
template <typename T> inline T Mulmod(T a, T b, T c){ull x = 0,y = a%c;while(b>0){if(b&1) x = (x+y)%c;y = (y<<1)%c;b >>= 1;}return x;}
template <typename T> inline T Pow(T base,T exp,T mod){ull x = 1, y = base;while(exp>0){if(exp&1) x = Mulmod(x,y,mod);y = Mulmod(y,y,mod);exp >>= 1;}return x;}
template <typename T> inline T modulo(T a,T b,T c){ull x = 1 , y = a%c ;while( b>0 ){if(b%2) x = Mulmod(x,y,c) ;y=Mulmod(y,y,c);b/=2;}return x%c ;}
template <typename T> inline T BigMod(T a, T b, T m){if(!b)return 1;ll x=BigMod(a, b/2, m);x=(x*x)%m;if(b%2)x=(x*a)%m;return x;}
template <typename T> inline T EGCD(T a,T b,T &x,T &y){if(a == 0) {x = 0;y = 1;return b;}T x1, y1;T d = EGCD(b % a, a, x1, y1);x = y1 - (b / a) * x1;y = x1;return d;}
/****************** Prime Generator **********************/
const int N=1e7+10; int prime[20000010]; bool isprime[N]; int nprime;
template <typename T> void Sieve(T a) {nprime = 0;memset(isprime,true,sizeof(isprime));isprime[1]=false;for(int i=2;i<N;i++){if(isprime[i]){prime[nprime++]=i;for(int j=2;i*j<N;j++)isprime[i*j]=false;}}}
template <typename T> bool miller_rabin(T p, T itt) {if(p<2) return 0 ;if(p==2) return 1;if(p%2==0) return 0 ;ull s = p-1 ;while(s%2==0) s/=2;for(ll i=1;i<=itt;i++) {ull a = rand() % (p-1)+1 , temp = s ;ull mod = modulo(a,temp,(ull)p);while(mod!=1 and mod!=p-1 and temp!=p-1){mod = Mulmod(mod,mod,(ull)p);temp*=2;}if(temp%2==0 and mod!=p-1) return false ;}return true;}
template <typename T> inline T PrimeFactors(T n){ll cnt=0,sum=1;for(int i=0; prime[i]*prime[i]<=n and i<nprime;i++){cnt=0;while(n%prime[i]==0){cnt++;n/=prime[i];}sum*=(cnt+1);}if(n>1)sum*=2;return sum;}
/********************** Faster I/O *********************/
template <typename T> inline T scan(T &n) { n=0; bool negative=0; char c=gc(); while(c<'0'||c>'9') {if(c=='-') negative=1; c=gc();} while(c>='0'&&c<='9'){n=n*10+c-48;c=gc();} if(negative) n=~(n-1);}
template <typename T> void print(T n){if(n<0){pc('-');n=-n;}if(!n){pc('0');pc('\n');return;}char buff[12];int len=0;while(n) buff[len++]=n%10+48,n/=10;for(int i=len-1;i>=0;i--) pc(buff[i]);pc('\n');}
template <typename T> void print(T a, T b){print(a);print(b);}
template <typename T> void print(T a, T b, T c){print(a);print(b);print(c);}
template <typename T> void Print(T n){if(n<0){pc('-');n=-n;}if(!n){pc('0');return;}char buff[12];int len=0;while(n) buff[len++]=n%10+48,n/=10;for(int i=len-1;i>=0;i--) pc(buff[i]);}
template <typename T> void Print(T a, T b) {cout<<a<<" "<<b<<endl;}
template <typename T> void Print(T a, T b, T c) {cout<<a<<" "<<b<<" "<<c<<endl;}
template <typename T> void Print(T a, T b, T c, T d) {cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;}
/**>>>>>>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<<<<<**/
int main(){
#ifdef FariD
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
#endif // FariD
int arr[4];
cin3(arr[0],arr[1],arr[2]);
SortA(arr,3);
Cout(arr[0]+arr[1])
return 0;
}
| a.cc:16:9: warning: "gc" redefined
16 | #define gc getchar
| ^~
a.cc:15:9: note: this is the location of the previous definition
15 | #define gc getchar unlocked
| ^~
a.cc:18:9: warning: "pc" redefined
18 | #define pc putchar
| ^~
a.cc:17:9: note: this is the location of the previous definition
17 | #define pc putchar_unlocked
| ^~
a.cc: In function 'int main()':
a.cc:124:5: error: 'cin3' was not declared in this scope; did you mean 'Cin3'?
124 | cin3(arr[0],arr[1],arr[2]);
| ^~~~
| Cin3
|
s987589902 | p03671 | Java | import java.util.*;
public class ringing {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
// 整数の入力
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if(a<=b){
if(b <= c){
System.out.println(a+b);
}else{
System.out.println(a+c);
}
}else{
if(a <= c){
System.out.println(a+b);
}else{
System.out.println(b+c);
}
}
}
} | Main.java:3: error: class ringing is public, should be declared in a file named ringing.java
public class ringing {
^
1 error
|
s412220510 | p03671 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class abc066 {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(is);
String input;
String[] inputStr;
long[] num = {0,0,0};
long tmp, result;
int i,j;
try {
while ((input = br.readLine()) != null) {
inputStr = input.split(" ");
num[0] = Long.parseLong(inputStr[0]);
num[1] = Long.parseLong(inputStr[1]);
num[2] = Long.parseLong(inputStr[2]);
for(i=0;i<num.length-1;i++) {
for(j=1;j<num.length;j++) {
if(num[i] > num[j]) {
tmp = num[i];
num[i] = num[j];
num[j] = tmp;
continue;
}
}
}
result = num[0] + num[1];
System.out.println(result);
}
} catch (IOException e) {
System.out.println("入出力エラー" + e);
}
}
} | Main.java:5: error: class abc066 is public, should be declared in a file named abc066.java
public class abc066 {
^
1 error
|
s784142750 | p03671 | C++ | #include<iostream>
using namespace std;
int main() {
int a, b, c, sum;
cin >> a >> b >> c;
if (a<c && b<c) {
sum = a + b;
} else if (a<b && c<b) {
sum = a + c;
} else {
sum = b + c;
} | a.cc: In function 'int main()':
a.cc:12:3: error: expected '}' at end of input
12 | }
| ^
a.cc:3:12: note: to match this '{'
3 | int main() {
| ^
|
s901207823 | p03671 | C++ | #include <stdio>
using namespace std;
int max(int a, int b) {
return a > b ? a : b;
}
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << a + b + c - max(a, max(b, c)) << endl;
return 0;
} | a.cc:1:10: fatal error: stdio: No such file or directory
1 | #include <stdio>
| ^~~~~~~
compilation terminated.
|
s197153735 | p03671 | C++ | a,b,c = map(int, input().split())
print(min(a+b,b+c,a+c))
| a.cc:1:1: error: 'a' does not name a type
1 | a,b,c = map(int, input().split())
| ^
|
s249754016 | p03671 | C++ | #include <iostream>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
using namespace std;
int show (int *,int,int);
int ch (int *,int,int,int);
int zero(int *,int,int);
int sum(int *,int,int);
int main(){
int a,b,c;
cin>>a>>b>>c;
int ans=min(a+b,b+c,c+a);
cout<<ans<<endl;
return 0;
} | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:19:13: required from here
19 | int ans=min(a+b,b+c,c+a);
| ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
284 | if (__comp(__b, __a))
| ~~~~~~^~~~~~~~~~
|
s483380738 | p03671 | C++ | inport sys
arglist = sys.arg
best = arglist[0] + arglist[1]
if (arglist[1] + argilst[2] < best) :
| a.cc:1:1: error: 'inport' does not name a type
1 | inport sys
| ^~~~~~
|
s221561020 | p03671 | C | #include <stdio.h>
int main() {
int a, b, c;
int ans;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &c);
int max;
max = a;
if (max < b) max = b
if (max < c) max = c
printf("%d", a+b+c-max);
return 0;
}
| main.c: In function 'main':
main.c:13:29: error: expected ';' before 'if'
13 | if (max < b) max = b
| ^
| ;
14 | if (max < c) max = c
| ~~
|
s998834032 | p03671 | C++ | #include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> tab(3, 0);
cin >> tab[0] >> tab[1] >> tab[2];
sort(tab.begin(), tab.end());
cout << tab[0] + tab[1] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(tab.begin(), tab.end());
| ^~~~
| short
|
s477045563 | p03671 | C++ | lis=input().split()
lis.sort()
print(int(lis[0])+int(lis[1])) | a.cc:1:1: error: 'lis' does not name a type
1 | lis=input().split()
| ^~~
|
s237559180 | p03671 | C++ | #include <iostream>
#include <vector>
// #include <map>
#include <algorithm>
// #include <numeric>
// #include <limits>
using namespace std;
int main() {
vector<int> data(3);
cin >> data[0] >> data[1] >> data[2];
int max_val = *std::max_element(data.begin(), data.end());
int sum = accumulate(data.begin(), data.end(), 0);
cout << sum - max_val << endl;
//std::cout << "\e[38;5;0m\e[48;5;40m --- end --- \e[m" << std::endl; // debug
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:19: error: 'accumulate' was not declared in this scope
14 | int sum = accumulate(data.begin(), data.end(), 0);
| ^~~~~~~~~~
|
s669958729 | p03671 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collection;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String x = br.readLine();
String[] cut = x.split(" ");
int a = Integer.parseInt(cut[0]);
int b = Integer.parseInt(cut[1]);
int c = Integer.parseInt(cut[2]);
ArrayList<Integer> array = new ArrayList<>();
array.add(a);
array.add(b);
array.add(c);
Collections.sort(array);
int q = array.get(0);
int p = array.get(1);
System.out.println(q + p);
}
} | Main.java:21: error: cannot find symbol
Collections.sort(array);
^
symbol: variable Collections
location: class Main
1 error
|
s183478771 | p03671 | C | #include <stdio.h>
int main(void)
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if( (a >= b)&&(a >= c) )
{
printf("%d\n",b + c);
return 0;
}
if( (b >= a)&&(b >= c) )
{
printf("%d/n",a + c);
return 0;
}
if( (c>= a)&&(c >= b)
printf("%d\n",a + b);
return 0;
}
| main.c: In function 'main':
main.c:19:24: error: expected ')' before 'printf'
19 | if( (c>= a)&&(c >= b)
| ~ ^
| )
20 | printf("%d\n",a + b);
| ~~~~~~
main.c:23:1: error: expected expression before '}' token
23 | }
| ^
|
s153633947 | p03671 | C++ | #include<iostream>
using namespace std;
int A,B,C;
int main(){
cin>>A>>B>>C;
cout<<A+B+C-max({A,B,C});
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:20: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
6 | cout<<A+B+C-max({A,B,C});
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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: candidate expects 2 arguments, 1 provided
/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, 1 provided
|
s068451057 | p03671 | C++ | #include<iostream>
using namespace std;
int main(){
int n,temp,d,e;
int a[200000];
int b[200000];
cin >> n;
for (int i = 0; i < n; i++) cin >> a[i]; cin;
for (int i = 0; i < n; i++) {
b[i] = a[i];//末尾に追加
//bを逆向きに並び替える
d = 0;
e = i;
while(d < e)
{
temp = b[d];
b[d] = b[e];
b[e] = temp;
i++;
e--;
}
}
for (int i = 0; i < n - 1; i++) {
cout << b[i] <<" ";
}
cout << b[n - 1]<<endl;
} | a.cc:10:1: error: extended character is not valid in an identifier
10 |
| ^
a.cc:12:1: error: extended character is not valid in an identifier
12 |
| ^
a.cc:15:1: error: extended character is not valid in an identifier
15 |
| ^
a.cc:27:1: error: extended character is not valid in an identifier
27 |
| ^
a.cc:28:1: error: extended character is not valid in an identifier
28 |
| ^
a.cc:30:1: error: extended character is not valid in an identifier
30 |
| ^
a.cc:32:1: error: extended character is not valid in an identifier
32 |
| ^
a.cc:36:1: error: extended character is not valid in an identifier
36 |
| ^
a.cc:38:1: error: extended character is not valid in an identifier
38 |
| ^
a.cc: In function 'int main()':
a.cc:10:1: error: '\U000000a0' was not declared in this scope
10 |
| ^
a.cc:11:25: error: 'i' was not declared in this scope
11 | for (int i = 0; i < n; i++) {
| ^
a.cc:30:2: error: expected ';' before 'for'
30 |
| ^
| ;
31 | for (int i = 0; i < n - 1; i++) {
| ~~~
a.cc:36:2: error: expected ';' before 'cout'
36 |
| ^
| ;
37 | cout << b[n - 1]<<endl;
| ~~~~
a.cc:38:2: error: expected ';' before '}' token
38 |
| ^
| ;
39 | }
| ~
|
s083801997 | p03671 | C++ | #include <iostream>
#include <array>
int main(){
array <int,200000> a;
int n;
std::cin>>n;
for (int i;i<n;i++){
std::cin>>a.at(i);
}
bool flag = true;
while(flag){
flag = true;
n -=2;
for(int i;i<n/2;i++){
if(a.at(i)!=a.at(i+n/2){
flag=false;
}
}
}
std::cout<<n<<std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'array' was not declared in this scope; did you mean 'std::array'?
5 | array <int,200000> a;
| ^~~~~
| std::array
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: 'std::array' declared here
99 | struct array;
| ^~~~~
a.cc:5:10: error: expected primary-expression before 'int'
5 | array <int,200000> a;
| ^~~
a.cc:9:15: error: 'a' was not declared in this scope
9 | std::cin>>a.at(i);
| ^
a.cc:16:10: error: 'a' was not declared in this scope
16 | if(a.at(i)!=a.at(i+n/2){
| ^
a.cc:16:30: error: expected ')' before '{' token
16 | if(a.at(i)!=a.at(i+n/2){
| ~ ^
| )
a.cc:19:5: error: expected primary-expression before '}' token
19 | }
| ^
|
s388222233 | p03671 | C++ | #include <iostream>
int main() {
int a,b,c,d;
std::cin >> a >> b >> c;
d = std::max({a,b,c});
std::cout << (a + b + c) - d<< std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:13: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
5 | d = std::max({a,b,c});
| ~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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: candidate expects 2 arguments, 1 provided
/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, 1 provided
|
s163651440 | p03671 | C++ | #include <iostream>
int main() {
int a,b,c;
std::cin >> a >> b >> c;
std::cout << (a + b + c) - std::max({a, b, c}) << std::endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:38: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
5 | std::cout << (a + b + c) - std::max({a, b, c}) << std::endl;
| ~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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: candidate expects 2 arguments, 1 provided
/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, 1 provided
|
s620893694 | p03671 | C++ | #include <iostream>
int main() {
std::cin >> a >> b >> c;
std::cout << (a + b + c) - std::max({a, b, c}) << std::endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:3:15: error: 'a' was not declared in this scope
3 | std::cin >> a >> b >> c;
| ^
a.cc:3:20: error: 'b' was not declared in this scope
3 | std::cin >> a >> b >> c;
| ^
a.cc:3:25: error: 'c' was not declared in this scope
3 | std::cin >> a >> b >> c;
| ^
a.cc:4:38: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
4 | std::cout << (a + b + c) - std::max({a, b, c}) << std::endl;
| ~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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: candidate expects 2 arguments, 1 provided
/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, 1 provided
|
s098335595 | p03671 | C++ | #include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
int main() {
int a[3];
cin >> a[0] >> a[1] >> a[2];
sort(ALL(a));
cout << a[0] + a[1] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:18:20: error: request for member 'begin' in 'a', which is of non-class type 'int [3]'
18 | #define ALL(c) (c).begin(), (c).end()
| ^~~~~
a.cc:31:14: note: in expansion of macro 'ALL'
31 | sort(ALL(a));
| ^~~
a.cc:18:33: error: request for member 'end' in 'a', which is of non-class type 'int [3]'
18 | #define ALL(c) (c).begin(), (c).end()
| ^~~
a.cc:31:14: note: in expansion of macro 'ALL'
31 | sort(ALL(a));
| ^~~
|
s400744828 | p03671 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<map>
#include<list>
#include<vector>
#include<unordered_map>
using namespace std;
signed main() {
int a, b,c; cin >> a >> b>>c;
cout << min({a + b, b + c, a + c}) << endl;
} | a.cc:9:1: error: extended character is not valid in an identifier
9 |
| ^
a.cc:9:1: error: '\U000000a0' does not name a type
9 |
| ^
|
s305838156 | p03671 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<map>
#include<list>
#include<vector>
#include<unordered_map>
#define int long long
using namespace std;
signed main() {
int a, b,c; cin >> a >> b>>c;
cout << min(a + b, b + c, a + c) << endl;
} | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:13:13: required from here
13 | cout << min(a + b, b + c, a + c) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
284 | if (__comp(__b, __a))
| ~~~~~~^~~~~~~~~~
|
s400159931 | p03671 | C++ | #include <iostream>
#include <vector>
#define MAX_NUM 1000000000
using namespace std;
int n;
int a[MAX_NUM];
int b[MAX_NUM];
int main()
{
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
for (int i = 0; i < n; ++i) {
b[i] = a[i];
for (int j = 0; j < n / 2; ++j) {
int tmp = b[i];
b[i] = b[n-i-1];
b[n-i-1] = tmp;
}
}
for (int i = 0; i < n - 1; ++i) {
cout << b[i] << " ";
}
cout << b[n-1] << endl;
return 0;
}
| /tmp/cctImY2l.o: in function `main':
a.cc:(.text+0x96): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/cctImY2l.o
a.cc:(.text+0xb6): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/cctImY2l.o
a.cc:(.text+0xd9): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/cctImY2l.o
a.cc:(.text+0xf1): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/cctImY2l.o
a.cc:(.text+0x111): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/cctImY2l.o
a.cc:(.text+0x163): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/cctImY2l.o
a.cc:(.text+0x1b8): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/cctImY2l.o
collect2: error: ld returned 1 exit status
|
s046252521 | p03671 | Java | import java.util.Scanner;
public class Main {
public static void main(String args[]){
//B問題
Scanner scan = new Scanner(System.in);
//文字列格納用
String S;
S = scan.next();
while(S.length() >= 2){
//1文字削除
if(S != null && S.length() > 0){
S = S.substring(0, S.length()-1);
}
//文字数が偶数ならば
if(S.length() % 2 == 0){
String sa = S.substring(0,S.length() / 2);
String sb = S.substring(S.length() / 2 ,S.length());
if(sa.equals(sb)){
System.out.println(S.length());
break;
}
}
}
} | Main.java:31: error: reached end of file while parsing
}
^
1 error
|
s611889380 | p03671 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int sum = 0;
if(a >= b){
if(a >= c) {
if(b >= c){
sum = a + b;
} else {
sum = a + c;
}
} else {
sum = a + c;
}
} else
if(c >= a){
sum = b + c;
} else {
sum = a + b;
}
}
System.out.println(sum);
}
} | Main.java:31: error: <identifier> expected
System.out.println(sum);
^
Main.java:31: error: <identifier> expected
System.out.println(sum);
^
Main.java:34: error: class, interface, enum, or record expected
}
^
3 errors
|
s326302889 | p03671 | C++ | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner s = new Scanner(System.in);
int a, b, c ;
a = s.nextInt();
b = s.nextInt();
c = s.nextInt();
System.out.println(minValue(a,b,c)
);
}
public static int minValue(int a, int b, int c) {
int min = a + b;
if (min > b + c) min = b + c;
if (min > c + a) min = c + a;
return min;
}
} | a.cc:3:1: error: 'import' does not name a type
3 | import java.util.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.lang.*;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
5 | import java.io.*;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:10:15: error: expected ':' before 'static'
10 | public static void main (String[] args) throws java.lang.Exception
| ^~~~~~~
| :
a.cc:10:34: error: 'String' has not been declared
10 | public static void main (String[] args) throws java.lang.Exception
| ^~~~~~
a.cc:10:43: error: expected ',' or '...' before 'args'
10 | public static void main (String[] args) throws java.lang.Exception
| ^~~~
a.cc:10:47: error: expected ';' at end of member declaration
10 | public static void main (String[] args) throws java.lang.Exception
| ^
| ;
a.cc:10:49: error: 'throws' does not name a type
10 | public static void main (String[] args) throws java.lang.Exception
| ^~~~~~
a.cc:21:31: error: expected ':' before 'static'
21 | public static int minValue(int a, int b, int c) {
| ^~~~~~~
| :
a.cc:29:2: error: expected ';' after class definition
29 | }
| ^
| ;
|
s875742684 | p03671 | C++ | #include <bits/stdc++.h>
#define rep(i, first, to) for(int i = first; i < to; ++i)
#define REP(i, first, to) for(int i = first; i <= to; ++i)
#define MyDebug
#ifdef MyDebug
#define debug(x) cout << #x << " : " << x << endl
#define debugP(x) cout << x << endl
#else
#define debug(x)
#define debugP(x)
#endif
using namespace std;
typedef long long ll;
const int MOD = 1000000000 + 7;
int a[(int)1e5];
int n;
int two;
int nLength[(int)1e5 + 1];
int twoLength[(int)1e5];
int cnt[(int)1e5 + 1];
int p;
void solve() {
cin >> n;
rep (i, 0, n) cin >> a[i];
rep(i, 0, n) cnt[a[i]]++;
REP(i, 1, n) {
if (cnt[i] == 2) {
p = i;
break;
}
}
for (int i = n - 1; i >= 0; --i) {
if(a[i] == p) {
twoLength = n - i;
}
}
nLength[2] = (n * (n - 1) / 2) % MOD;
if (two >= 2) {
twoLength[2] = (two * (two - 1) / 2) % MOD;
}
rep(i, 3, n) {
nLength[i] = nLength[i - 1] * (n - i + 1) / i;
nLength[i] %= MOD;
}
nLength[n] = 1;
rep(i, 3, two) {
twoLength[i] = twoLength[i - 1] * (two - i + 1) / i;
twoLength[i] %= MOD;
}
twoLength[two] = 1;
cout << n - 1 << endl;
REP(i, 2, n) {
cout << (MOD + nLength[i] - twoLength[i]) % MOD) << endl;
}
}
int main() {
solve();
return 0;
}
| a.cc: In function 'void solve()':
a.cc:40:35: error: incompatible types in assignment of 'int' to 'int [100000]'
40 | twoLength = n - i;
| ~~~~~~~~~~^~~~~~~
a.cc:61:64: error: expected ';' before ')' token
61 | cout << (MOD + nLength[i] - twoLength[i]) % MOD) << endl;
| ^
| ;
|
s017899293 | p03671 | C | #include <stdio.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
long long n=0;
int t=1;
long long flag=n;
long long a[n]={0};
scanf("%d",&n);
while(n--){
scanf("%d",&a[t]);
if(t>=2){
int temp1=t;
if(t%2==0){
int i=1;
while(i<t){
int swap=0;
swap=a[i];a[i]=a[t];a[t]=swap;
i++;t--;
}
t=temp1;
}
else if(t%2!=0){
int j=1;
while(j!=t){
int swap=0;
swap=a[j];a[j]=a[t];a[t]=swap;
j++;t--;
}
t=temp1;
}
}
t++;
}
for(int k=1;k<flag;k++){
printf("%d ",a[k]);
}
printf("%d",a[flag]);
return 0;
} | main.c: In function 'main':
main.c:10:17: error: variable-sized object may not be initialized except with an empty initializer
10 | long long a[n]={0};
| ^
|
s795397795 | p03671 | C++ | #include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
char s[205], t1[205], t2[205];
int main()
{
gets(s);
int len = strlen(s);
int w = len;
for (int j = 1; j <= 200; j++){
int tot = -1;
for (int i = 0; i <= (len - 3) / 2; i++) t1[i] = s[i];
for (int i = (len - 3) / 2 + 1; i < len - 1; i++){
t2[++tot] = s[i];
}
t2[++tot] = '\0';
// puts(t2);
if (strcmp(t1, t2) == 0){
// puts(t1);
// puts(t2);
printf ("%d\n", len - 1);
return 0;
}
else{
// puts(t1);
// puts(t2);
len--;
// printf ("%d\n", len);
memset(t1, 0, sizeof(t1));
memset(t2, 0, sizeof(t2));
}
}
}
| a.cc: In function 'int main()':
a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(s);
| ^~~~
| getw
|
s879886790 | p03671 | C++ | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int sum = 0;
if(a >= b){
if(a >= c) {
if(b >= c){
sum = a + b;
} else {
sum = a + c;
}
} else {
sum = a + c;
}
} else
if(c >= a){
sum = b + c;
} else {
sum = a + b;
}
}
System.out.println(sum);
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
a.cc:34:1: error: expected declaration before '}' token
34 | }
| ^
|
s393626154 | p03671 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
long long int n,b,c;
long long int a[200001];
int main(){
b=n/2;
c=(n+1)/2;
cin>>n;
for(int z=0;z<n;z++){
cin>>a[z];
}
if(n%2=1){
for(int i=1;i<=c;i++){
a[i]=a[n+2-2*i];
}
for(int j=n;j>c;j--){
a[j]=a[-n-1+2*j];
}
}
if(n%2=0){
for(int i=1;i<=b;i++){
a[i]=a[n+2-2*i];
}
for(int j=n;j>b;j--){
a[j]=a[-n-1+2*j];
}
}
for(int k=0;k<n;k++){
cout<<a[k];
}
} | a.cc: In function 'int main()':
a.cc:14:5: error: lvalue required as left operand of assignment
14 | if(n%2=1){
| ~^~
a.cc:22:5: error: lvalue required as left operand of assignment
22 | if(n%2=0){
| ~^~
|
s384261225 | p03671 | C++ | #include <cstdio>
using namespace std;
int main(){
int a,b,c;
int ans=0;
scanf("%d %d %d",&a,&b,&c);
ans=a+b;
ans=min(ans,a+c);
ans=min(ans,b+c);
printf("%d\n",ans);
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:21: error: 'min' was not declared in this scope; did you mean 'main'?
9 | ans=min(ans,a+c);
| ^~~
| main
|
s196308433 | p03671 | Java | import java.util.Scanner;
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a[] = new int[3];
for(int i = 0;i < 3; i++) {
int a[i] = sc.nextInt();
}
Arrays.sort(a);
System.out.println(a[0] + a[1]);
}
} | Main.java:12: error: ']' expected
int a[i] = sc.nextInt();
^
Main.java:12: error: ';' expected
int a[i] = sc.nextInt();
^
2 errors
|
s509560041 | p03671 | Java | import java.util.Scanner;
import java.util.Arrays;
public class atcoder {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a[] = new int[3];
for(int i = 0;i < 3; i++) {
a[i] = sc.nextInt();
}
Arrays.sort(a);
System.out.println(a[0] + a[1]);
}
} | Main.java:4: error: class atcoder is public, should be declared in a file named atcoder.java
public class atcoder {
^
1 error
|
s214231605 | p03671 | Java | import java.util.Scanner;
import java.util.Arrays;
public class atcoder {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a[] = new int[3];
for(int i = 0;i < 3; i++) {
int a[i] = sc.nextInt();
}
Arrays.sort(a);
System.out.println(a[0] + a[1]);
}
}
| Main.java:12: error: ']' expected
int a[i] = sc.nextInt();
^
Main.java:12: error: ';' expected
int a[i] = sc.nextInt();
^
2 errors
|
s272962528 | p03671 | C++ | #include<iostream>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<cmath>
#include<string>
using namespace std;
int main(){
int a[3];
for(int i=0;i<3;i++){
cin >> a[i];
}
sort(s.size(),3);
cout << a[0]+a[1] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:6: error: 's' was not declared in this scope
15 | sort(s.size(),3);
| ^
|
s374240210 | p03671 | C++ | #include<iostream>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<cmath>
#include<string>
using namespace std;
int main(){
int a[3];
for(int i=0;i<3;i++){
cin >> a[i];
}
sort(a[3],3);
cout << a[0]+a[1] << endl;
return 0;
} | In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:15:5: required from here
15 | sort(a[3],3);
| ~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1780:17: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
1780 | __val = _GLIBCXX_MOVE(*__i);
| ^~~~~
In file included from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1780:25: error: invalid type argument of unary '*' (have 'int')
1780 | __val = _GLIBCXX_MOVE(*__i);
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1782:15: error: invalid type argument of unary '*' (have 'int')
1782 | *__first = _GLIBCXX_MOVE(__val);
| ^~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]':
/usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1777 | if (__comp(__i, __first))
| ~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:15:5: required from here
15 | sort(a[3],3);
| ~~~~^~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:45:16: error: invalid type argument of unary '*' (have 'int')
45 | { return *__it1 < *__it2; }
| ^~~~~~
/usr/include/c++/14/bits/predefined_ops.h:45:25: error: invalid type argument of unary '*' (have 'int')
45 | { return *__it1 < *__it2; }
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algo.h:61:
/usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1593 | std::__make_heap(__first, __middle, __comp);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1868 | std::__heap_select(__first, __middle, __last, __comp);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1884 | std::__partial_sort(__first, __last, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1905 | std::__introsort_loop(__first, __last,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
1906 | std::__lg(__last - __first) * 2,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1907 | __comp);
| ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:15:5: required from here
15 | sort(a[3],3);
| ~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:344:11: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
344 | _ValueType;
| ^~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:346:11: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
346 | _DistanceType;
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:1596:19: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1596 | std::__pop_heap(__first, __middle, __i, __comp);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1868 | std::__heap_select(__first, __middle, __last, __comp);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1884 | std::__partial_sort(__first, __last, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1905 | std::__introsort_loop(__first, __last,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
1906 | std::__lg(__last - __first) * 2,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1907 | __comp);
| ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:15:5: required from here
15 | sort(a[3],3);
| ~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:258:9: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
258 | _ValueType;
| ^~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:260:9: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
260 | _DistanceType;
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:262:28: error: invalid type argument of unary '*' (have 'int')
262 | _ValueType __value = _GLIBCXX_MOVE(*__result);
| ^~~~~~~~~~~~~
/usr/ |
s602480187 | p03671 | C | #include <stdio.h>
int main(void){
int k,l,m;
scanf("%d%d%d",&k,&l,&m);
int min = k + l;
if(min > (l + m)){
min = l + m;
}
if(min > k + m){
min = k + m;
}
printf("%d",max);
return 0;
}
| main.c: In function 'main':
main.c:12:15: error: 'max' undeclared (first use in this function)
12 | printf("%d",max);
| ^~~
main.c:12:15: note: each undeclared identifier is reported only once for each function it appears in
|
s004303702 | p03671 | C++ | include<iostream>
include<algorithm>
int main(){
int a,b,c;
std::cin>>a>>b>>c;
std::cout<<"std::min(a+b,std::min(b+c,a+c))"<<srd::endl;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
|
s306953219 | p03671 | Java | import java.util.Scanner;
public class At001 {
private static int ptn = 3;
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner sc = new Scanner(System.in);
int[] price= new int[ptn];
for(int i=0; ptn > i; i++) {
price[i] = sc.nextInt();
}
int min = 0;
for(int i=0; ptn-1 > i; i++) {
for(int j=i; ptn-1 > j; j++) {
if ( min > price[j] + price[j+1] || min == 0) {
min = price[j] + price[j+1];
}
}
}
System.out.println(min);
}
}
| Main.java:3: error: class At001 is public, should be declared in a file named At001.java
public class At001 {
^
1 error
|
s251654287 | p03671 | C++ | #include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <Windows.h>
#define _USE_MATH_DEFINES
#define LL long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
using namespace std;
int smax(int *ary) {
int m = 0;
for (int i = 0; i < sizeof(ary) / sizeof(ary[0]); i++)
if (m < ary[i]) m = ary[i];
return m;
}
int nmax(int *ary) {
int max = 0, num;
for (int i = 0; i < sizeof(ary) / sizeof(ary[0]); i++)
if (max < ary[i]) {
max = ary[i];
num = i;
}
return max, num;
}
int main() {
int a, b, c, a1, b1;
cin >> a >> b >> c;
if (a > b) a1 = b;
else a1 = a;
if (b > c)b1 = c;
else b1 = b;
if (a1 == b1)
b1 = MAX(a, b);
cout << a1 + b1 << endl;
return 0;
}
| a.cc:8:10: fatal error: Windows.h: No such file or directory
8 | #include <Windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s645526008 | p03671 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
int a,b,c,rtn;
Scanner sc=new scanner(System.in);
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
if(a>b){
if(a>c)rtn=b+c;
else rtn=a+b;
}else{
if(b>c)rtn=a+c;
else rtn=a+b;
}
System.out.println(rtn);
}
} | Main.java:5: error: cannot find symbol
Scanner sc=new scanner(System.in);
^
symbol: class scanner
location: class Main
1 error
|
s795113024 | p03671 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
int a,b,c,rtn;
Scanner sc=new scanner(System.in);
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
if(a>b){
if(a>c)rtn=b+c;
else rtn=a+b;
}else{
if(b>c)rtn=a+c;
else rtn=a+b;
}
System.out.println(rtn);
}
} | Main.java:5: error: cannot find symbol
Scanner sc=new scanner(System.in);
^
symbol: class scanner
location: class Main
1 error
|
s135887818 | p03671 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
int a,b,c,rtn;
Scanner sc=new scanner(System.in);
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
if(a>b){
if(a>c)rtn=b+c;
else rtn=a+b;
}else{
if(b>c)rtn=a+c;
else rtn=a+b
}
System.out.println(rtn);
}
} | Main.java:14: error: ';' expected
else rtn=a+b
^
1 error
|
s553906328 | p03671 | C | #include<stdio.h>
int main(void){
int a,b,c;
scanf("%d %d %d", &a, $b, &c);
int min=a+b;
if(min>b+c){
min=b+c;
}
if(min>a+c){
min=a+c;
}
printf("%d\n",min);
return 0;
} | main.c: In function 'main':
main.c:4:23: error: '$b' undeclared (first use in this function); did you mean 'b'?
4 | scanf("%d %d %d", &a, $b, &c);
| ^~
| b
main.c:4:23: note: each undeclared identifier is reported only once for each function it appears in
|
s036782144 | p03671 | C++ | abc = input().split(' ')
abc =[ int(x) for x in abc]
s= 0
if abc[0] == abc[1] == abc[2] :
print(abc[0] + abc[1])
elif abc[0] == abc[1] or abc[2] == abc[1] or abc[2] == abc[0]:
else:
for i in abc:
if i != min(abc):
s += i
print(s)
| a.cc:1:1: error: 'abc' does not name a type
1 | abc = input().split(' ')
| ^~~
|
s808927463 | p03671 | C++ | abc = input().split(' ')
abc =[ int(x) for x in abc]
s= 0
if abc[0] == abc[1] == abc[2] :
print(abc[0] + abc[1])
elif abc[0] == abc[1] or abc[2] == abc[1] or abc[2] == abc[0]:
else:
for i in abc:
if i != min(abc):
s += i
print(s)
| a.cc:1:1: error: 'abc' does not name a type
1 | abc = input().split(' ')
| ^~~
|
s817994071 | p03671 | C++ | include<iostream>
include<algorithm>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<"min(a+b,min(b+c,a+c))"<<endl;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:2: error: 'cin' was not declared in this scope
6 | cin>>a>>b>>c;
| ^~~
a.cc:7:2: error: 'cout' was not declared in this scope
7 | cout<<"min(a+b,min(b+c,a+c))"<<endl;
| ^~~~
a.cc:7:33: error: 'endl' was not declared in this scope
7 | cout<<"min(a+b,min(b+c,a+c))"<<endl;
| ^~~~
|
s766222760 | p03671 | C++ | #include<iostream>
using namespace std;
int main(){
int a[3];
cin>>a[0]>>a[1]>>a[2];
sort(a,a+3);
cout<<a[0]+a[1]<<endl;
} | a.cc: In function 'int main()':
a.cc:6:5: error: 'sort' was not declared in this scope; did you mean 'short'?
6 | sort(a,a+3);
| ^~~~
| short
|
s280987310 | p03671 | C | #include<stdio.h>
int Ring[3];
int main(void){
int i, max, sum;
for(i = 0; i < 3; i++) scanf("%d", &Ring[i]);
sum = max = Ring[0];
for( i=1; i < 3; i++){
if(max <= Ring[i]) min = Ring[i];
sum += Ring[i];
}
sum -= max;
printf("%d", sum);
} | main.c: In function 'main':
main.c:11:28: error: 'min' undeclared (first use in this function); did you mean 'main'?
11 | if(max <= Ring[i]) min = Ring[i];
| ^~~
| main
main.c:11:28: note: each undeclared identifier is reported only once for each function it appears in
|
s061043239 | p03671 | C++ | a = list(map(int, input().split()))
a.remove(max(a))
print(sum(a))
| a.cc:1:1: error: 'a' does not name a type
1 | a = list(map(int, input().split()))
| ^
|
s655695622 | p03671 | C++ | int main(void){
int a,b,c,d;
scanf("%d %d %d",&a,&b,&c);
d = a+b;
if(d >=a+c){
d = a+c;
}
if(d>=a+b){
d = b+c;
}
printf("%d",d);
}
| a.cc: In function 'int main()':
a.cc:3:1: error: 'scanf' was not declared in this scope
3 | scanf("%d %d %d",&a,&b,&c);
| ^~~~~
a.cc:11:1: error: 'printf' was not declared in this scope
11 | printf("%d",d);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main(void){
|
s352733014 | p03671 | C++ |
#include <iostream>
using namespace std;
int main(void){
int a, b, c;
cin >> a >> b >> c;
int ans;
ans = min(min(a + b, b + c), c + a);
cout << ans << endl;
return 0;
} | a.cc:4:1: error: extended character is not valid in an identifier
4 |
| ^
a.cc:8:1: error: extended character is not valid in an identifier
8 |
| ^
a.cc:11:1: error: extended character is not valid in an identifier
11 |
| ^
a.cc:4:1: error: '\U000000a0' does not name a type
4 |
| ^
|
s436079247 | p03671 | C | #include <stdio.h>
#include <math.h>
int main(void){
short a,b,c;
scanf("%d",a);
scanf("%d",b);
scanf("%d",c);
short sum=min(a+b,b+c,c+a);
printf("%d",sum);
return 0;
} | main.c: In function 'main':
main.c:10:19: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
10 | short sum=min(a+b,b+c,c+a);
| ^~~
| main
|
s926921895 | p03671 | C | #include<stdio.h>
int Ring[3]
int main(void){
int i, min, sum;
for(i = 0; i < 3; i++) scanf("%d", &Ring[i]);
sum = min = Ring[0];
for( i=1; i < 3; i++){
if(min >= Ring[i]) min = Ring[i];
sum += Ring[i];
}
sum -= min;
printf("%d", sum);
} | main.c:3:12: error: expected ';' before 'int'
3 | int Ring[3]
| ^
| ;
4 |
5 | int main(void){
| ~~~
main.c: In function 'main':
main.c:8:41: error: 'Ring' undeclared (first use in this function)
8 | for(i = 0; i < 3; i++) scanf("%d", &Ring[i]);
| ^~~~
main.c:8:41: note: each undeclared identifier is reported only once for each function it appears in
|
s001210565 | p03671 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
int temp = 0;
temp = (a < b) ? ((b < c)? c : b) : ((a < c)? c : a);
if (temp == a) {
cout << b + c << endl;
}
else if (temp == b) {
cout << a + c << endl;
}
else if (temp == c) {
cout << a + b << endl;
}
return 0; | a.cc: In function 'int main()':
a.cc:22:18: error: expected '}' at end of input
22 | return 0;
| ^
a.cc:8:1: note: to match this '{'
8 | {
| ^
|
s575112263 | p03671 | C++ |
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,f,t) for(int i=(int)f; i<(int)t; i++)
#define FORR(i,f,t) for(int i=(int)f; i>(int)t; i--)
#define ms(obj, val) memset(obj, val, sizeof(obj))
#define pb push_back
#define SYNC ios_base::sync_with_stdio(false)
#define inf 100248012
#define mp make_pair
#define F first
#define S second
#define ri(x) scanf("%d",&x)
#define rii(x,y) scanf("%d %d",&x,&y)
#define riii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define lri(x) scanf("%lld",&x)
#define lrii(x,y) scanf("%lld %lld",&x,&y)
#define lriii(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> ii;
double X0;
double Y0;
const int MAXN = 5e3+3;
struct Point{
double x;
double y;
Point(double a = 0, double b = 0){
x = a,y = b;
}
bool operator==(const Point p)const {
return p.x == x && p.y == y;
}
bool operator<(const Point &p) const{
return y<p.y || (y == p.y && x<p.x);
}
bool operator<=(const Point &p) const{
return y<p.y || (y == p.y && x<=p.x);
}
Point operator+( Point p){
return Point(x+p.x,y+p.y);
}
Point operator-( Point p){
return Point(x-p.x,y-p.y);
}
Point operator*( double a){
return Point(a*x,a*y);
}
double operator*( Point p){
return x*p.x + y*p.y;
}
double operator^( Point p){
return x*p.y - y*p.x;
}
double norma2(){
return x*x + y*y;
}
double norma(){
return sqrt(this->norma2());
}
};
struct Recta{
return Point(inf,inf);
}
else{
double alpha;
alpha=((M.P-P)^M.V)/(V^M.V);
return P+V*alpha;
}
}
};
struct Segmento{
Point P;
Point V;
Segmento(Point p=Point(0,0),Point q=Point(0,0)){
P=p;
V=q;
}
Point operator *(Recta M){
if(((M.V)^V) == 0){
return Point(inf,inf);
}
else{
double alpha;
alpha=((M.P-P)^M.V)/(V^M.V);
if((alpha<=1)&&(alpha>=0))
{return P+V*alpha;}
else
{return Point(inf,inf);}
}
}
};
int main(){
int a[3];
scanf("%d %d %d",&a[0],&a[1],&a[2]);
sort(a,a+3);
printf("%d\n",a[0]+a[1]);
return 0;
}
Point P;
Point V;
Recta(Point p=Point(0,0),Point q=Point(0,0)){
P=p;
V=q;
}
Point operator *(Recta M){
if(((M.V)^V) == 0){
return Point(inf,inf);
}
else{
double alpha;
alpha=((M.P-P)^M.V)/(V^M.V);
return P+V*alpha;
}
}
};
struct Segmento{
Point P;
Point V;
Segmento(Point p=Point(0,0),Point q=Point(0,0)){
P=p;
V=q;
}
Point operator *(Recta M){
if(((M.V)^V) == 0){
return Point(inf,inf);
}
else{
double alpha;
alpha=((M.P-P)^M.V)/(V^M.V);
if((alpha<=1)&&(alpha>=0))
{return P+V*alpha;}
else
{return Point(inf,inf);}
}
}
};
int main(){
int a[3];
scanf("%d %d %d",&a[0],&a[1],&a[2]);
sort(a,a+3);
printf("%d\n",a[0]+a[1]);
return 0;
}
| a.cc:67:25: error: expected unqualified-id before 'return'
67 | return Point(inf,inf);
| ^~~~~~
a.cc:68:26: error: expected ';' after struct definition
68 | }
| ^
| ;
a.cc:69:17: error: expected unqualified-id before 'else'
69 | else{
| ^~~~
a.cc:74:17: error: expected declaration before '}' token
74 | }
| ^
a.cc:75:9: error: expected declaration before '}' token
75 | };
| ^
a.cc: In member function 'Point Segmento::operator*(Recta)':
a.cc:84:24: error: 'struct Recta' has no member named 'V'
84 | if(((M.V)^V) == 0){
| ^
a.cc:89:35: error: 'struct Recta' has no member named 'P'
89 | alpha=((M.P-P)^M.V)/(V^M.V);
| ^
a.cc:89:42: error: 'struct Recta' has no member named 'V'
89 | alpha=((M.P-P)^M.V)/(V^M.V);
| ^
a.cc:89:50: error: 'struct Recta' has no member named 'V'
89 | alpha=((M.P-P)^M.V)/(V^M.V);
| ^
a.cc: At global scope:
a.cc:108:9: error: ISO C++ forbids declaration of 'Recta' with no type [-fpermissive]
108 | Recta(Point p=Point(0,0),Point q=Point(0,0)){
| ^~~~~
a.cc: In function 'int Recta(Point, Point)':
a.cc:111:17: warning: no return statement in function returning non-void [-Wreturn-type]
111 | }
| ^
a.cc: At global scope:
a.cc:112:15: error: declaration of 'operator*' as non-function
112 | Point operator *(Recta M){
| ^~~~~~~~
a.cc:112:31: error: expected ')' before 'M'
112 | Point operator *(Recta M){
| ~ ^~
| )
a.cc:122:9: error: expected declaration before '}' token
122 | };
| ^
a.cc:123:8: error: redefinition of 'struct Segmento'
123 | struct Segmento{
| ^~~~~~~~
a.cc:76:8: note: previous definition of 'struct Segmento'
76 | struct Segmento{
| ^~~~~~~~
a.cc:146:5: error: redefinition of 'int main()'
146 | int main(){
| ^~~~
a.cc:99:5: note: 'int main()' previously defined here
99 | int main(){
| ^~~~
|
s580389945 | p03671 | Java |
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
new A().start();
}
void start(){
Scanner in = new Scanner(System.in);
int[] a = new int[3];
for(int i = 0; i < 3; i++){
a[i] = in.nextInt();
}
Arrays.sort(a);
System.out.println(a[0] + a[1]);
in.close();
}
}
| Main.java:9: error: cannot find symbol
new A().start();
^
symbol: class A
location: class Main
1 error
|
s442061234 | p03671 | C++ |
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,f,t) for(int i=(int)f; i<(int)t; i++)
#define FORR(i,f,t) for(int i=(int)f; i>(int)t; i--)
#define ms(obj, val) memset(obj, val, sizeof(obj))
#define pb push_back
#define SYNC ios_base::sync_with_stdio(false)
#define inf 100248012
#define mp make_pair
#define F first
#define S second
#define ri(x) scanf("%d",&x)
#define rii(x,y) scanf("%d %d",&x,&y)
#define riii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define lri(x) scanf("%lld",&x)
#define lrii(x,y) scanf("%lld %lld",&x,&y)
#define lriii(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> ii;
double X0;
double Y0;
const int MAXN = 5e3+3;
struct Point{
double x;
double y;
Point(double a = 0, double b = 0){
x = a,y = b;
}
bool operator==(const Point p)const {
return p.x == x && p.y == y;
}
bool operator<(const Point &p) const{
return y<p.y || (y == p.y && x<p.x);
}
bool operator<=(const Point &p) const{
return y<p.y || (y == p.y && x<=p.x);
}
Point operator+( Point p){
return Point(x+p.x,y+p.y);
}
Point operator-( Point p){
return Point(x-p.x,y-p.y);
}
Point operator*( double a){
return Point(a*x,a*y);
}
double operator*( Point p){
return x*p.x + y*p.y;
}
double operator^( Point p){
return x*p.y - y*p.x;
}
double norma2(){
return x*x + y*y;
}
double norma(){
return sqrt(this->norma2());
}
};
struct Recta{
Point P;
Point V;
Recta(Point p=Point(0,0),Point q=Point(0,0)){
P=p;
V=q;
}
Point operator *(Recta M){
if(((M.V)^V) == 0){
return Point(inf,inf);
}
else{
double alpha;
alpha=((M.P-P)^M.V)/(V^M.V);
return P+V*alpha;
}
}
};
struct Segmento{
Point P;
Point V;
Segmento(Point p=Point(0,0),Point q=Point(0,0)){
P=p;
V=q;
}
Point operator *(Recta M){
if(((M.V)^V) == 0){
return Point(inf,inf);
}
else{
double alpha;
alpha=((M.P-P)^M.V)/(V^M.V);
if((alpha<=1)&&(alpha>=0))
{return P+V*alpha;}
else
{return Point(inf,inf);}
}
}
};
int main(){
int a[3];
scanf("%d %d %d",&a[0],&a[1],&a[2]);
sort(a,a+3);
printf("%d\n",a+b);
return 0;
} | a.cc: In function 'int main()':
a.cc:111:25: error: 'b' was not declared in this scope
111 | printf("%d\n",a+b);
| ^
|
s145438908 | p03671 | C++ | #include <cstdio>
using namespace std;
int main(){
int a,b,c;
int ans=0;
scanf("%d %d %d",&a,&b,&c);
ans=a+b;
ans=min(ans,a+c);
ans=min(ans,b+c);
printf("%d\n",ans);
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:21: error: 'min' was not declared in this scope; did you mean 'main'?
9 | ans=min(ans,a+c);
| ^~~
| main
|
s291478726 | p03671 | Java | public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
int c = scanner.nextInt();
if (a > b && a > c) {
System.out.println(b + c);
} else if (b > a && b > c) {
System.out.println(a + c);
} else {
System.out.println(a + b);
}
}
} | Main.java:3: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s205383119 | p03671 | C++ | #include <bits/stdc++.h>
#define lson l,mid,o<<1
#define rson mid+1,r,o<<1|1
using namespace std;
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> PII;
const int INF=0x3f3f3f3f;
const LL MAX_N=2e5 + 10;
const LL mod=1e9+7;
const double PI=acos(-1);
int main()
{
int a , b, c;
cin >> a >> b >> c;
ans = min(a + b, a + c);
ans = min(ans, b + c);
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:18:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
18 | ans = min(a + b, a + c);
| ^~~
| abs
|
s373594640 | p03671 | C++ | #include <bits/stdc++.h>
#define lson l,mid,o<<1
#define rson mid+1,r,o<<1|1
using namespace std;
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> PII;
const int INF=0x3f3f3f3f;
const LL MAX_N=2e5 + 10;
const LL mod=1e9+7;
const double PI=acos(-1);
int main()
{
int a , b, c;
cin >> a >> b >> c;
ans = min(a + b, a + c);
ans = min(ans, b + c);
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:18:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
18 | ans = min(a + b, a + c);
| ^~~
| abs
|
s427179829 | p03671 | C++ | #include <iostream>
using namespace std;
int main()
{
int a[2];
cin >> a[0] >> a[1] >> a[2];
sort(a,a+2);
cout << a[0]+a[1];
return 0;
} | a.cc: In function 'int main()':
a.cc:8:3: error: 'sort' was not declared in this scope; did you mean 'short'?
8 | sort(a,a+2);
| ^~~~
| short
|
s204880181 | p03671 | C++ | # -*- coding:utf-8 -*-
a = [int(i) for i in input().split()]
a = sorted(a)
print(a[0] + a[1])
| a.cc:1:3: error: invalid preprocessing directive #-
1 | # -*- coding:utf-8 -*-
| ^
a.cc:2:1: error: 'a' does not name a type
2 | a = [int(i) for i in input().split()]
| ^
|
s746696540 | p03671 | C++ | a = list(map(int, input().split()))
sorted(a)
print(a[0] + a[1]) | a.cc:1:1: error: 'a' does not name a type
1 | a = list(map(int, input().split()))
| ^
|
s322051348 | p03671 | C++ | 700 600 780 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 700 600 780
| ^~~
|
s557510332 | p03672 | C++ | #include <iostream>
#include<algorithm>
using namespace std;
int main()
{
char S[201];
cin>>S;
int len = strlen(S);
int k = 0;
for(int i = 1; i < len; i++){
if((len-i) % 2 == 0){
int f = 0;
for(int j = 0; j < (len-i)/2; j++)
{
if(S[j] != S[j+(len-i)/2]){
f = 1;
break;
}
}
if(f == 0){
k = i;
break;
}
}
}
cout<< len-k<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:19: error: 'strlen' was not declared in this scope
10 | int len = strlen(S);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm>
+++ |+#include <cstring>
3 | using namespace std;
|
s488314352 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >>s;
s.pop_back();
for(int i=0;i<200;i++){
int n=s.size();
if(n%2){
s.pop_back;
continue;
}
string a=s.substr(0,n/2) , b = s.substr(n/2,n/2);
if(a==b){
cout<<s.size()<<endl;
}
else{
s.pop_out;
}
}
} | a.cc: In function 'int main()':
a.cc:11:15: 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>]'
11 | s.pop_back;
| ~~^~~~~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here
2174 | pop_back() noexcept
| ^~~~~~~~
a.cc:19:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_out'
19 | s.pop_out;
| ^~~~~~~
|
s064070313 | p03672 | C++ | #include <iostream>
#include <string>
using namespace std;
int main()
{
string S;
cin >> S;
int len = S.length();
for (int i = 1; i < len; i++) {
int len1 = (len-i)/2;
int len2 = len-i-len1;
if (len1!=len2) continue;
string s1 = S.substr(0, len1);
string s2 = S.substr(len1, len2);
if (s1==s2) {
cout << len1+len2 << endl;
retrun 0;
}
}
}
| a.cc: In function 'int main()':
a.cc:18:7: error: 'retrun' was not declared in this scope
18 | retrun 0;
| ^~~~~~
|
s282253273 | p03672 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#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 << endl;
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:15:17: error: 'strlen' was not declared in this scope
15 | int n = strlen(str);
| ^~~~~~
a.cc:8:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include <map>
+++ |+#include <cstring>
8 | #include <string>
a.cc:17:21: error: 'strncmp' was not declared in this scope
17 | if (strncmp(str, str + i / 2, i / 2) == 0) {
| ^~~~~~~
a.cc:17:21: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s661659376 | p03672 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <string>
using namespace std;
int main()
{
int ans,n, m;
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) {
printf("%d\n", i);
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:16:13: error: redeclaration of 'int n'
16 | int n = strlen(str);
| ^
a.cc:13:17: note: 'int n' previously declared here
13 | int ans,n, m;
| ^
a.cc:16:17: error: 'strlen' was not declared in this scope
16 | int n = strlen(str);
| ^~~~~~
a.cc:8:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include <map>
+++ |+#include <cstring>
8 | #include <string>
a.cc:18:21: error: 'strncmp' was not declared in this scope
18 | if (strncmp(str, str + i / 2, i / 2) == 0) {
| ^~~~~~~
a.cc:18:21: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s033558180 | p03672 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <string>
using namespace std;
int main()
{
int ans,n, m;
string a;
cin >> a;
for (int i = 0;i< a.length;i++) {
string ma = a.substr(0, a.length/2-i);
string usi = a.substr(a.length/2+1-i, a.length-i*2);
if(ma == usi){
ans = a.length/2-i;
break;
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:17:29: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
17 | for (int i = 0;i< a.length;i++) {
| ~~^~~~~~
| ()
a.cc:18:43: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
18 | string ma = a.substr(0, a.length/2-i);
| ~~^~~~~~
| ()
a.cc:19:41: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
19 | string usi = a.substr(a.length/2+1-i, a.length-i*2);
| ~~^~~~~~
| ()
a.cc:19:57: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
19 | string usi = a.substr(a.length/2+1-i, a.length-i*2);
| ~~^~~~~~
| ()
a.cc:21:33: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
21 | ans = a.length/2-i;
| ~~^~~~~~
| ()
|
s021551057 | p03672 | C++ | #include <bits/stdc++.h>
#include <regex>
using namespace std;
//type
typedef long long int ll;
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define Z class
// input
#define INIT \
std::ios::sync_with_stdio(false); \
std::cin.tie(0);
#define VAR(type, ...) \
type __VA_ARGS__; \
MACRO_VAR_Scan(__VA_ARGS__);
template <typename T>
void MACRO_VAR_Scan(T &t)
{
std::cin >> t;
}
template <typename First, typename... Rest>
void MACRO_VAR_Scan(First &first, Rest &... rest)
{
std::cin >> first;
MACRO_VAR_Scan(rest...);
}
#define VEC_ROW(type, n, ...) \
std::vector<type> __VA_ARGS__; \
MACRO_VEC_ROW_Init(n, __VA_ARGS__); \
for (int w_ = 0; w_ < n; ++w_) \
{ \
MACRO_VEC_ROW_Scan(w_, __VA_ARGS__); \
}
template <typename T>
void MACRO_VEC_ROW_Init(int n, T &t)
{
t.resize(n);
}
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Init(int n, First &first, Rest &... rest)
{
first.resize(n);
MACRO_VEC_ROW_Init(n, rest...);
}
template <typename T>
void MACRO_VEC_ROW_Scan(int p, T &t) { std::cin >> t[p]; }
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Scan(int p, First &first, Rest &... rest)
{
std::cin >> first[p];
MACRO_VEC_ROW_Scan(p, rest...);
}
#define VEC(type, c, n) \
std::vector<type> c(n); \
for (auto &i : c) \
std::cin >> i;
// 2d vector: MAT(type, v, size, size);
#define MAT(type, c, m, n) \
std::vector<std::vector<type>> c(m, std::vector<type>(n)); \
for (auto &R : c) \
for (auto &w : R) \
std::cin >> w;
// output
template <typename T>
void MACRO_OUT(const T t) { std::cout << t; }
#define OUT(...) MACRO_OUT(__VA_ARGS__);
#define SP std::cout << " ";
#define TAB std::cout << "\t";
#define BR std::cout << "\n";
#define ENDL std::cout << std::endl;
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define yes() printf("yes\n")
#define no() printf("no\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
cout << a;
ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
cout << a << ' ' << b << endl;
}
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
template <class T>
T GCD(T a, T b)
{
T r;
while (a)
r = b, b = a, a = r % a;
return b;
}
template <class T>
T LCM(T a, T b) { return a / GCD(a, b) * b; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repe(i, n) for (ll i = 0; i <= (n); i++)
#define repd(i, n) for (ll i = n; i > 0; i--)
#define repde(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < (b); i++)
#define FORE(i, a, b) for (ll i = a; i <= (b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (b); i--)
#define FORA(i, I) for (const auto &i : I)
// vector
#define ALL(x) x.begin(), x.end()
#define ALLR(x) x.end(), x.begin()
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<ll> vl;
#define ERASE(x) x.erase(unique(ALL(x)), x.end()); // erase same elements
bool yes = 0;
bool boo = 0;
int mx = -100000, mn = 100000;
int sum = 0;
int ans = 0;
int co = 0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// cout << (conditon ? (result: == 1 ): (==0)) << endl; <- output result of if
// long long 型が表せる値の上限はおよそ 9 × 10^18 です.
// vector
// sum: accumulate(ALl(x),0)
// return last element: v.back();
// i & 1 は偶数なら 0に 奇数なら1に
// sort (descending order) : sort(arr, arr+n, greater<int>());
// sort indescending order: sort(ALL())-> reverse(ALL())
// (string): sort(all(t),greater<char>()); (string t )
// string
// strncmp: ompare characters of two string *長さ指定 strcmp(s1,s2,length)
// <0:s1<s2 (s1が辞書早い) | 0:s1==s2 | >0:s1>s2
int main()
{
// abc 66 b
// string
VAR(string, s);
while (S.length() != 0) {
S.pop_back();
int b = S.length() % 2;
int a = S.length() / 2;
if (b == 0) {
if (S.substr(0, a) == S.substr(a, a)) {
cout << S.length() << endl;
return 0;
}
}
}
cout << 0 << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:11: error: 'second' was not declared in this scope
16 | #define S second //pairの二つ目の要素
| ^~~~~~
a.cc:173:12: note: in expansion of macro 'S'
173 | while (S.length() != 0) {
| ^
|
s977892722 | p03672 | C++ | #include <bits/stdc++.h>
#include <regex>
using namespace std;
//type
typedef long long int ll;
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define Z class
// input
#define INIT \
std::ios::sync_with_stdio(false); \
std::cin.tie(0);
#define VAR(type, ...) \
type __VA_ARGS__; \
MACRO_VAR_Scan(__VA_ARGS__);
template <typename T>
void MACRO_VAR_Scan(T &t)
{
std::cin >> t;
}
template <typename First, typename... Rest>
void MACRO_VAR_Scan(First &first, Rest &... rest)
{
std::cin >> first;
MACRO_VAR_Scan(rest...);
}
#define VEC_ROW(type, n, ...) \
std::vector<type> __VA_ARGS__; \
MACRO_VEC_ROW_Init(n, __VA_ARGS__); \
for (int w_ = 0; w_ < n; ++w_) \
{ \
MACRO_VEC_ROW_Scan(w_, __VA_ARGS__); \
}
template <typename T>
void MACRO_VEC_ROW_Init(int n, T &t)
{
t.resize(n);
}
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Init(int n, First &first, Rest &... rest)
{
first.resize(n);
MACRO_VEC_ROW_Init(n, rest...);
}
template <typename T>
void MACRO_VEC_ROW_Scan(int p, T &t) { std::cin >> t[p]; }
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Scan(int p, First &first, Rest &... rest)
{
std::cin >> first[p];
MACRO_VEC_ROW_Scan(p, rest...);
}
#define VEC(type, c, n) \
std::vector<type> c(n); \
for (auto &i : c) \
std::cin >> i;
// 2d vector: MAT(type, v, size, size);
#define MAT(type, c, m, n) \
std::vector<std::vector<type>> c(m, std::vector<type>(n)); \
for (auto &R : c) \
for (auto &w : R) \
std::cin >> w;
// output
template <typename T>
void MACRO_OUT(const T t) { std::cout << t; }
#define OUT(...) MACRO_OUT(__VA_ARGS__);
#define SP std::cout << " ";
#define TAB std::cout << "\t";
#define BR std::cout << "\n";
#define ENDL std::cout << std::endl;
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define yes() printf("yes\n")
#define no() printf("no\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
cout << a;
ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
cout << a << ' ' << b << endl;
}
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
template <class T>
T GCD(T a, T b)
{
T r;
while (a)
r = b, b = a, a = r % a;
return b;
}
template <class T>
T LCM(T a, T b) { return a / GCD(a, b) * b; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repe(i, n) for (ll i = 0; i <= (n); i++)
#define repd(i, n) for (ll i = n; i > 0; i--)
#define repde(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < (b); i++)
#define FORE(i, a, b) for (ll i = a; i <= (b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (b); i--)
#define FORA(i, I) for (const auto &i : I)
// vector
#define ALL(x) x.begin(), x.end()
#define ALLR(x) x.end(), x.begin()
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<ll> vl;
#define ERASE(x) x.erase(unique(ALL(x)), x.end()); // erase same elements
bool yes = 0;
bool boo = 0;
int mx = -100000, mn = 100000;
int sum = 0;
int ans = 0;
int co = 0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// cout << (conditon ? (result: == 1 ): (==0)) << endl; <- output result of if
// long long 型が表せる値の上限はおよそ 9 × 10^18 です.
// vector
// sum: accumulate(ALl(x),0)
// return last element: v.back();
// i & 1 は偶数なら 0に 奇数なら1に
// sort (descending order) : sort(arr, arr+n, greater<int>());
// sort indescending order: sort(ALL())-> reverse(ALL())
// (string): sort(all(t),greater<char>()); (string t )
// string
// strncmp: ompare characters of two string *長さ指定 strcmp(s1,s2,length)
// <0:s1<s2 (s1が辞書早い) | 0:s1==s2 | >0:s1>s2
int main()
{
// abc 66 b
// string
VAR(string, str);
int n = strlen(str);
for (int i = n - 2; i; i -= 2)
{
if (strncmp(str, str + i / 2, i / 2) == 0)
{
pr(i);
return 0;
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:173:20: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
173 | int n = strlen(str);
| ^~~
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
from a.cc:1:
/usr/include/string.h:407:35: note: initializing argument 1 of 'size_t strlen(const char*)'
407 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
a.cc:176:30: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ~~~ ^ ~~~~~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
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_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
1798 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
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:
/usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3616 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'const _CharT*' and 'int'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: deduced conflicting types for parameter '_CharT' ('char' and 'int')
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3719 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3726 | operator+(_CharT __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)'
3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed:
a.cc:176:36: note: mismatched types 'const _CharT*' and 'int'
176 | if (strncmp(str, str + i / 2, i / 2) == 0)
| ^
/usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator |
s286177122 | p03672 | C++ | #include <bits/stdc++.h>
#include <regex>
using namespace std;
//type
typedef long long int ll;
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define Z class
// input
#define INIT \
std::ios::sync_with_stdio(false); \
std::cin.tie(0);
#define VAR(type, ...) \
type __VA_ARGS__; \
MACRO_VAR_Scan(__VA_ARGS__);
template <typename T>
void MACRO_VAR_Scan(T &t)
{
std::cin >> t;
}
template <typename First, typename... Rest>
void MACRO_VAR_Scan(First &first, Rest &... rest)
{
std::cin >> first;
MACRO_VAR_Scan(rest...);
}
#define VEC_ROW(type, n, ...) \
std::vector<type> __VA_ARGS__; \
MACRO_VEC_ROW_Init(n, __VA_ARGS__); \
for (int w_ = 0; w_ < n; ++w_) \
{ \
MACRO_VEC_ROW_Scan(w_, __VA_ARGS__); \
}
template <typename T>
void MACRO_VEC_ROW_Init(int n, T &t)
{
t.resize(n);
}
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Init(int n, First &first, Rest &... rest)
{
first.resize(n);
MACRO_VEC_ROW_Init(n, rest...);
}
template <typename T>
void MACRO_VEC_ROW_Scan(int p, T &t) { std::cin >> t[p]; }
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Scan(int p, First &first, Rest &... rest)
{
std::cin >> first[p];
MACRO_VEC_ROW_Scan(p, rest...);
}
#define VEC(type, c, n) \
std::vector<type> c(n); \
for (auto &i : c) \
std::cin >> i;
// 2d vector: MAT(type, v, size, size);
#define MAT(type, c, m, n) \
std::vector<std::vector<type>> c(m, std::vector<type>(n)); \
for (auto &R : c) \
for (auto &w : R) \
std::cin >> w;
// output
template <typename T>
void MACRO_OUT(const T t) { std::cout << t; }
#define OUT(...) MACRO_OUT(__VA_ARGS__);
#define SP std::cout << " ";
#define TAB std::cout << "\t";
#define BR std::cout << "\n";
#define ENDL std::cout << std::endl;
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define yes() printf("yes\n")
#define no() printf("no\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
cout << a;
ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
cout << a << ' ' << b << endl;
}
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
template <class T>
T GCD(T a, T b)
{
T r;
while (a)
r = b, b = a, a = r % a;
return b;
}
template <class T>
T LCM(T a, T b) { return a / GCD(a, b) * b; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repe(i, n) for (ll i = 0; i <= (n); i++)
#define repd(i, n) for (ll i = n; i > 0; i--)
#define repde(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < (b); i++)
#define FORE(i, a, b) for (ll i = a; i <= (b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (b); i--)
#define FORA(i, I) for (const auto &i : I)
// vector
#define ALL(x) x.begin(), x.end()
#define ALLR(x) x.end(), x.begin()
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<ll> vl;
#define ERASE(x) x.erase(unique(ALL(x)), x.end()); // erase same elements
bool yes = 0;
bool boo = 0;
int mx = -100000, mn = 100000;
int sum = 0;
int ans = 0;
int co = 0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// cout << (conditon ? (result: == 1 ): (==0)) << endl; <- output result of if
// long long 型が表せる値の上限はおよそ 9 × 10^18 です.
// vector
// sum: accumulate(ALl(x),0)
// return last element: v.back();
// i & 1 は偶数なら 0に 奇数なら1に
// sort (descending order) : sort(arr, arr+n, greater<int>());
// sort indescending order: sort(ALL())-> reverse(ALL())
// (string): sort(all(t),greater<char>()); (string t )
// string
// strncmp: ompare characters of two string *長さ指定 strcmp(s1,s2,length)
// <0:s1<s2 (s1が辞書早い) | 0:s1==s2 | >0:s1>s2
signed main
{
VAR(string, s);
int n = strlen(str);
for (int i = n - 2; i; i -= 2)
{
if (strncmp(str, str + i / 2, i / 2) == 0)
{
pr(i);
return 0;
}
}
return 0;
}
| a.cc:166:8: error: cannot declare '::main' to be a global variable
166 | signed main
| ^~~~
a.cc:169:17: error: expected primary-expression before 's'
169 | VAR(string, s);
| ^
a.cc:24:10: note: in definition of macro 'VAR'
24 | type __VA_ARGS__; \
| ^~~~~~~~~~~
a.cc:169:17: error: expected '}' before 's'
169 | VAR(string, s);
| ^
a.cc:24:10: note: in definition of macro 'VAR'
24 | type __VA_ARGS__; \
| ^~~~~~~~~~~
a.cc:167:1: note: to match this '{'
167 | {
| ^
a.cc:25:19: error: expected constructor, destructor, or type conversion before '(' token
25 | MACRO_VAR_Scan(__VA_ARGS__);
| ^
a.cc:169:5: note: in expansion of macro 'VAR'
169 | VAR(string, s);
| ^~~
a.cc:171:20: error: 'str' was not declared in this scope; did you mean 'std'?
171 | int n = strlen(str);
| ^~~
| std
a.cc:172:5: error: expected unqualified-id before 'for'
172 | for (int i = n - 2; i; i -= 2)
| ^~~
a.cc:172:25: error: 'i' does not name a type; did you mean 'vi'?
172 | for (int i = n - 2; i; i -= 2)
| ^
| vi
a.cc:172:28: error: 'i' does not name a type; did you mean 'vi'?
172 | for (int i = n - 2; i; i -= 2)
| ^
| vi
a.cc:180:5: error: expected unqualified-id before 'return'
180 | return 0;
| ^~~~~~
a.cc:181:1: error: expected declaration before '}' token
181 | }
| ^
|
s620883646 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s , ll n , char x){
// n文字目は前の文字列
string a ,b,c,d;
a = s;
b = s
if ( x == 'f'){
return c = a.erase(n) ;
}else if ( x == 'l'){
return d = b.substr(n) ;
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,s.length()){
s = s.erase(s.length()-2);
ll x = s.length() ;
string a = split ( s ,x/2,'f');
string b = split ( s ,x/2,'l');
if ( a == b){
ANS(x);
return 0;
}
}
}
| a.cc: In function 'std::string split(std::string, ll, char)':
a.cc:86:9: error: expected ';' before 'if'
86 | b = s
| ^
| ;
87 | if ( x == 'f'){
| ~~
a.cc:89:5: error: 'else' without a previous 'if'
89 | }else if ( x == 'l'){
| ^~~~
a.cc:92:2: warning: control reaches end of non-void function [-Wreturn-type]
92 | }
| ^
|
s719005494 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s , ll n , char x){
// n文字目は前の文字列
string a ;
if ( x == 'f'){
return a = s.erase(n) ;
}else if ( x == 'l'){
return a = s.substr(n) ;
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,s.size()){
s = s.erase(s.size()-1);
if ( s.size()%2 == 1){
continue;
}
ll x = s.size()
string a = split ( s ,x/2,'f');
string b = split ( s ,x/2,'l');
if ( a == b){
ANS(x);
return 0;
}
}
}
| a.cc: In function 'int main()':
a.cc:101:5: error: expected ',' or ';' before 'string'
101 | string a = split ( s ,x/2,'f');
| ^~~~~~
a.cc:103:10: error: 'a' was not declared in this scope
103 | if ( a == b){
| ^
a.cc: In function 'std::string split(std::string, ll, char)':
a.cc:90:2: warning: control reaches end of non-void function [-Wreturn-type]
90 | }
| ^
|
s992177507 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s , int n , char x){
// n文字目は前の文字列
string a ;
if ( x == 'f'){
return a = s.erase(n) ;
}else if ( x == 'l'){
return a = s.substr(n,s.size()-1) ;
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,s.size()){
s = s.back();
if ( s.size()%2 == 1){
continue;
}
string a = split ( s ,s.size()/2-1,f);
string b = split ( s ,s.size()/2-1,f);
if ( a == b){
ANS(s.size());
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:100:40: error: 'f' was not declared in this scope
100 | string a = split ( s ,s.size()/2-1,f);
| ^
a.cc: In function 'std::string split(std::string, int, char)':
a.cc:90:2: warning: control reaches end of non-void function [-Wreturn-type]
90 | }
| ^
|
s372782053 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s , int n , char x){
// n文字目は前の文字列
string a ;
if ( x == 'f'){
return a = s.erase(n) ;
}else if ( x == 'l'){
return a = s.substr(n,s.size()-1) ;
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,n){
s = s.back();
if ( s.size()%2 == 1){
continue;
}
string a = split ( s ,s.size()/2-1,f);
string b = split ( s ,s.size()/2-1,f);
if ( a == b){
ANS(s.size());
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:95:10: error: 'n' was not declared in this scope
95 | forn(i,n){
| ^
a.cc:47:41: note: in definition of macro 'forr'
47 | #define forr(i,a,b) ; for(int i=(a); i<(b); i++)
| ^
a.cc:95:3: note: in expansion of macro 'forn'
95 | forn(i,n){
| ^~~~
a.cc:100:40: error: 'f' was not declared in this scope
100 | string a = split ( s ,s.size()/2-1,f);
| ^
a.cc: In function 'std::string split(std::string, int, char)':
a.cc:90:2: warning: control reaches end of non-void function [-Wreturn-type]
90 | }
| ^
|
s947605006 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s , int n , char x){
// n文字目は前の文字列
string a ;
if ( x == 'f'){
return a = s.erase(n) ;
}else ( x == 'l'){
return a = s.substr(n,s.size()-1) ;
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,n){
s = s.back();
if ( s.size()%2 == 1){
continue;
}
string a = split ( s ,s.size()/2-1,f);
string b = split ( s ,s.size()/2-1,f);
if ( a == b){
ANS(s.size());
return 0;
}
}
} | a.cc: In function 'std::string split(std::string, int, char)':
a.cc:87:21: error: expected ';' before '{' token
87 | }else ( x == 'l'){
| ^
| ;
a.cc: In function 'int main()':
a.cc:95:10: error: 'n' was not declared in this scope
95 | forn(i,n){
| ^
a.cc:47:41: note: in definition of macro 'forr'
47 | #define forr(i,a,b) ; for(int i=(a); i<(b); i++)
| ^
a.cc:95:3: note: in expansion of macro 'forn'
95 | forn(i,n){
| ^~~~
a.cc:100:40: error: 'f' was not declared in this scope
100 | string a = split ( s ,s.size()/2-1,f);
| ^
a.cc: In function 'std::string split(std::string, int, char)':
a.cc:90:2: warning: control reaches end of non-void function [-Wreturn-type]
90 | }
| ^
|
s505426496 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s , int n , char x){
// n文字目は前の文字列
string a ;
if ( x == 'f'){
return a = s.erase(n) ;
}else ( x == 'l'){
return a = s.substr(n,s.size()-1) ;
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,n){
s = s.back();
if ( s.size()%2 == 1){
continue;
}
string a = split ( s ,s.size()/2-1,f);
string b = split ( s ,s.size()/2-1,f);
if ( a == b){
ANS(s.size());
return 0;
}
}
} | a.cc: In function 'std::string split(std::string, int, char)':
a.cc:87:21: error: expected ';' before '{' token
87 | }else ( x == 'l'){
| ^
| ;
a.cc: In function 'int main()':
a.cc:95:10: error: 'n' was not declared in this scope
95 | forn(i,n){
| ^
a.cc:47:41: note: in definition of macro 'forr'
47 | #define forr(i,a,b) ; for(int i=(a); i<(b); i++)
| ^
a.cc:95:3: note: in expansion of macro 'forn'
95 | forn(i,n){
| ^~~~
a.cc:100:40: error: 'f' was not declared in this scope
100 | string a = split ( s ,s.size()/2-1,f);
| ^
a.cc: In function 'std::string split(std::string, int, char)':
a.cc:90:2: warning: control reaches end of non-void function [-Wreturn-type]
90 | }
| ^
|
s119588076 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s , int n , char x){
// n文字目は前の文字列
string a ;
if ( x == 'f'){
return a = s.erace(n) ;
}else ( x == 'l'){
return a = s.substr(n,s.size()-1) ;
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,n){
s = s.back();
if ( s.size()%2 == 1){
continue;
}
string a = split ( s ,s.size()/2-1,f);
string b = split ( s ,s.size()/2-1,f);
if ( a == b){
ANS(s.size());
return 0;
}
}
} | a.cc: In function 'std::string split(std::string, int, char)':
a.cc:86:20: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'erace'; did you mean 'erase'?
86 | return a = s.erace(n) ;
| ^~~~~
| erase
a.cc:87:21: error: expected ';' before '{' token
87 | }else ( x == 'l'){
| ^
| ;
a.cc: In function 'int main()':
a.cc:95:10: error: 'n' was not declared in this scope
95 | forn(i,n){
| ^
a.cc:47:41: note: in definition of macro 'forr'
47 | #define forr(i,a,b) ; for(int i=(a); i<(b); i++)
| ^
a.cc:95:3: note: in expansion of macro 'forn'
95 | forn(i,n){
| ^~~~
a.cc:100:40: error: 'f' was not declared in this scope
100 | string a = split ( s ,s.size()/2-1,f);
| ^
|
s367758614 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s , int n , char x){
// n文字目は前の文字列
string a ;
if ( x == 'f'){
return a = s.back(n) ;
}else ( x == 'l'){
return a = s.substr(n,s.size()-1) ;
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,n){
s = s.back();
if ( s.size()%2 == 1){
continue;
}
string a = split ( s ,s.size()/2-1,f);
string b = split ( s ,s.size()/2-1,f);
if ( a == b){
ANS(s.size());
return 0;
}
}
} | a.cc: In function 'std::string split(std::string, int, char)':
a.cc:86:24: error: no matching function for call to 'std::__cxx11::basic_string<char>::back(int&)'
86 | return a = s.back(n) ;
| ~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1350:7: note: candidate: '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&]'
1350 | back() noexcept
| ^~~~
/usr/include/c++/14/bits/basic_string.h:1350:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:1362:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::back() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&]'
1362 | back() const noexcept
| ^~~~
/usr/include/c++/14/bits/basic_string.h:1362:7: note: candidate expects 0 arguments, 1 provided
a.cc:87:21: error: expected ';' before '{' token
87 | }else ( x == 'l'){
| ^
| ;
a.cc: In function 'int main()':
a.cc:95:10: error: 'n' was not declared in this scope
95 | forn(i,n){
| ^
a.cc:47:41: note: in definition of macro 'forr'
47 | #define forr(i,a,b) ; for(int i=(a); i<(b); i++)
| ^
a.cc:95:3: note: in expansion of macro 'forn'
95 | forn(i,n){
| ^~~~
a.cc:100:40: error: 'f' was not declared in this scope
100 | string a = split ( s ,s.size()/2-1,f);
| ^
|
s625159552 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s , int n , char x){
// n文字目は前の文字列
if( n > s.size()){
return 0;
}
string a ;
if ( x == 'f'){
return a = s.back(n) ;
}else ( x == 'l'){
return a = s.substr(n,s.size()-1) ;
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,n){
s = s.back();
if ( s.size()%2 == 1){
continue;
}
string a = split ( s ,s.size()/2-1,f);
string b = split ( s ,s.size()/2-1,f);
if ( a == b){
ANS(s.size());
return 0;
}
}
} | a.cc: In function 'std::string split(std::string, int, char)':
a.cc:89:24: error: no matching function for call to 'std::__cxx11::basic_string<char>::back(int&)'
89 | return a = s.back(n) ;
| ~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1350:7: note: candidate: '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&]'
1350 | back() noexcept
| ^~~~
/usr/include/c++/14/bits/basic_string.h:1350:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:1362:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::back() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&]'
1362 | back() const noexcept
| ^~~~
/usr/include/c++/14/bits/basic_string.h:1362:7: note: candidate expects 0 arguments, 1 provided
a.cc:90:21: error: expected ';' before '{' token
90 | }else ( x == 'l'){
| ^
| ;
a.cc: In function 'int main()':
a.cc:98:10: error: 'n' was not declared in this scope
98 | forn(i,n){
| ^
a.cc:47:41: note: in definition of macro 'forr'
47 | #define forr(i,a,b) ; for(int i=(a); i<(b); i++)
| ^
a.cc:98:3: note: in expansion of macro 'forn'
98 | forn(i,n){
| ^~~~
a.cc:103:40: error: 'f' was not declared in this scope
103 | string a = split ( s ,s.size()/2-1,f);
| ^
|
s276073973 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s , ll n , char x){
// n文字目は前の文字列
if( n > s.size()){
return 0;
}
string a ;
if ( x == 'f'){
return a = s.back(n) ;
}else ( x == 'l'){
return a = s.substr(n,s.size()-1) ;
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,n){
s = s.back();
if ( s.size()%2 == 1){
continue;
}
string a = split ( s ,s.size()/2-1,f);
string b = split ( s ,s.size()/2-1,f);
if ( a == b){
ANS(s.size());
return 0;
}
}
} | a.cc: In function 'std::string split(std::string, ll, char)':
a.cc:89:24: error: no matching function for call to 'std::__cxx11::basic_string<char>::back(ll&)'
89 | return a = s.back(n) ;
| ~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1350:7: note: candidate: '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&]'
1350 | back() noexcept
| ^~~~
/usr/include/c++/14/bits/basic_string.h:1350:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:1362:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::back() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&]'
1362 | back() const noexcept
| ^~~~
/usr/include/c++/14/bits/basic_string.h:1362:7: note: candidate expects 0 arguments, 1 provided
a.cc:90:21: error: expected ';' before '{' token
90 | }else ( x == 'l'){
| ^
| ;
a.cc: In function 'int main()':
a.cc:98:10: error: 'n' was not declared in this scope
98 | forn(i,n){
| ^
a.cc:47:41: note: in definition of macro 'forr'
47 | #define forr(i,a,b) ; for(int i=(a); i<(b); i++)
| ^
a.cc:98:3: note: in expansion of macro 'forn'
98 | forn(i,n){
| ^~~~
a.cc:103:40: error: 'f' was not declared in this scope
103 | string a = split ( s ,s.size()/2-1,f);
| ^
|
s464016970 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s , ll n , char x){
// n文字目は前の文字列
if( n > s.size()){
return 0;
}
string a
if ( x == 'f'){
return a = s.back(n) ;
}else ( x == 'l'){
return a = s.substr(n,s.size()-1)
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,n){
s = s.back();
if ( s.size()%2 == 1){
continue;
}
string a = split ( s ,s.size()/2-1,f);
string b = split ( s ,s.size()/2-1,f);
if ( a == b){
ANS(s.size());
return 0;
}
}
} | a.cc: In function 'std::string split(std::string, ll, char)':
a.cc:88:4: error: expected initializer before 'if'
88 | if ( x == 'f'){
| ^~
a.cc:90:5: error: 'else' without a previous 'if'
90 | }else ( x == 'l'){
| ^~~~
a.cc:90:21: error: expected ';' before '{' token
90 | }else ( x == 'l'){
| ^
| ;
a.cc: In function 'int main()':
a.cc:98:10: error: 'n' was not declared in this scope
98 | forn(i,n){
| ^
a.cc:47:41: note: in definition of macro 'forr'
47 | #define forr(i,a,b) ; for(int i=(a); i<(b); i++)
| ^
a.cc:98:3: note: in expansion of macro 'forn'
98 | forn(i,n){
| ^~~~
a.cc:103:40: error: 'f' was not declared in this scope
103 | string a = split ( s ,s.size()/2-1,f);
| ^
a.cc: In function 'std::string split(std::string, ll, char)':
a.cc:93:2: warning: control reaches end of non-void function [-Wreturn-type]
93 | }
| ^
|
s243075277 | p03672 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} // b進数の各位の和?
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和
//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
bool is_prime (int x){
if (x<=1) return false ;
for (int i=2 ; i*i<=x ; i++){
if (x%i==0) return false ;
}
return true;
}
string alpha = "abcdefghijklmnopqrstuvwxyz" ;
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
bool chmin (int a,int b){
if ( a > b ){
a = b;
return true ;
}
return false ;
}
bool chmax (int a,int b){
if ( a < b ){
a = b;
return true ;
}
return false ;
}
#define SORT(c) sort((c).begin(),(c).end());
#define ANS(ans) cout<<(ans)<<endl;
string split (string s ; ll n ; char x){
// n文字目は前の文字列
if( n > s.size()){
return 0;
}
string a
if ( x == 'f'){
return a = s.back(n) ;
}else ( x == 'l'){
return a = s.substr(n,s.size()-1)
}
}
/*CODE START HERE*/
int main() {
string s;
cin >> s;
forn(i,n){
s = s.back();
if ( s.size()%2 == 1){
continue;
}
string a = split ( s ,s.size()/2-1,f);
string b = split ( s ,s.size()/2-1,f);
if ( a == b){
ANS(s.size());
return 0;
}
}
} | a.cc:82:24: error: expected ')' before ';' token
82 | string split (string s ; ll n ; char x){
| ~ ^~
| )
a.cc:82:40: error: expected initializer before ')' token
82 | string split (string s ; ll n ; char x){
| ^
a.cc: In function 'int main()':
a.cc:103:40: error: 'f' was not declared in this scope
103 | string a = split ( s ,s.size()/2-1,f);
| ^
|
s011988672 | p03672 | Java | import java.util.*;
class Main {
public static int main(String[] args){
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
sc.close();
Map<Character,Integer> chars = new LinkedHashMap<>();
for (int i=0; i<s.length(); i++){
if (chars.containsKey(s.charAt(i))){
chars.replace(s.charAt(i), chars.get(s.charAt(i)), chars.get(s.charAt(i))+1);
}
else{
chars.put(s.charAt(i),1);
}
}
for (int i=s.length(); i>=0; i--){
Boolean flag = true;
for (Integer j : chars.values()){
if (j%2 == 1) {
flag = false;
break;
}
}
if (flag){
System.out.println(i);
return 0;
}
chars.replace(s.charAt(i),chars.get(s.charAt(i)),chars.get(s.charAt(i))-1);
}
}
} | Main.java:31: error: missing return statement
}
^
1 error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.