submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s970655234
p03862
Java
class UnionFind { private int[] data; public UnionFind(int size) { data = new int[size]; clear(); } public UnionFind(final UnionFind uf) { data = uf.data.clone(); } public void copyFrom(final UnionFind uf) { System.arraycopy(uf.data, 0, data, 0, data.length); } public void clear() { Arrays.fill(data, -1); } public int root(int x) { return data[x] < 0 ? x : (data[x] = root(data[x])); } public void union(int x, int y) { if((x = root(x)) != (y = root(y))) { if(data[y] < data[x]) { final int t = x; x = y; y = t; } data[x] += data[y]; data[y] = x; } } public boolean same(int x, int y) { return root(x) == root(y); } public int size(int x) { return -data[root(x)]; } }
Main.java:18: error: cannot find symbol Arrays.fill(data, -1); ^ symbol: variable Arrays location: class UnionFind 1 error
s501865282
p03862
Java
package main import "fmt" type long int64 func Min(x,y long) long { if x < y { return x } return y } func main() { var N,x,ans,i long var a [100000]long fmt.Scan(&N,&x) for i=0;i<N;i++ { fmt.Scan(&a[i]) } for i=1;i<N;i++ { var diff long = a[i-1]+a[i]-x if diff > 0 { ans += diff min := Min(diff,a[i]) a[i] -= min diff -= min if diff > 0 { a[i-1]-=diff } } } fmt.Println(ans) }
Main.java:1: error: ';' expected package main ^ Main.java:3: error: <identifier> expected import "fmt" ^ Main.java:17: error: class, interface, enum, or record expected for i=0;i<N;i++ { ^ Main.java:17: error: class, interface, enum, or record expected for i=0;i<N;i++ { ^ Main.java:21: error: class, interface, enum, or record expected for i=1;i<N;i++ { ^ Main.java:21: error: class, interface, enum, or record expected for i=1;i<N;i++ { ^ 6 errors
s259541951
p03862
Java
package main import "fmt" type long int64 func Min(x,y long) long { if x < y { return x } return y } func main() { var N,x,ans,i long var a [100000]long fmt.Scan(&N,&x) for i=0;i<N;i++ { fmt.Scan(&a[i]) } for i=1;i<N;i++ { var diff long = a[i-1]+a[i]-x if diff > 0 { ans += diff min := Min(diff,a[i]) a[i] -= min diff -= min if diff > 0 { a[i-1]-=diff } } } fmt.Println(ans) }
Main.java:1: error: ';' expected package main ^ Main.java:3: error: <identifier> expected import "fmt" ^ Main.java:17: error: class, interface, enum, or record expected for i=0;i<N;i++ { ^ Main.java:17: error: class, interface, enum, or record expected for i=0;i<N;i++ { ^ Main.java:21: error: class, interface, enum, or record expected for i=1;i<N;i++ { ^ Main.java:21: error: class, interface, enum, or record expected for i=1;i<N;i++ { ^ 6 errors
s848593421
p03862
Java
package main import "fmt" type long int64 func Min(x,y long) long { if x < y { return x } return y } func main() { var N,x,ans,i long var a [100000]long fmt.Scan(&N,&x) for i=0;i<N;i++ { fmt.Scan(&a[i]) } for i=1;i<N;i++ { var diff long = a[i-1]+a[i]-x if diff > 0 { ans += diff min := Min(diff,a[i]) a[i] -= min diff -= min if diff > 0 { a[i-1]-=diff } } } fmt.Println(ans) }
Main.java:1: error: ';' expected package main ^ Main.java:3: error: <identifier> expected import "fmt" ^ Main.java:17: error: class, interface, enum, or record expected for i=0;i<N;i++ { ^ Main.java:17: error: class, interface, enum, or record expected for i=0;i<N;i++ { ^ Main.java:21: error: class, interface, enum, or record expected for i=1;i<N;i++ { ^ Main.java:21: error: class, interface, enum, or record expected for i=1;i<N;i++ { ^ 6 errors
s878152459
p03862
C++
#include <bits/stdc++.h> using namespace std; void test3(){ int n,x; //while(cin>>n>>x){ long long ret=0; cin>>n>>x; vector<int> a(n); for(int i=0;i<n;i++) cin>>a[i]; int r=x; for(int i=0;i<n;i++){ if(a[i]>r) { ret=ret+a[i]-r; //cout<<ret<<" "; a[i]=r; } r=x-a[i]; //cout<<r<<" "; } coutl<<ret<<endl; // } return; } int main() { //freopen("data","r",stdin); test3(); return 0; }
a.cc: In function 'void test3()': a.cc:20:9: error: 'coutl' was not declared in this scope 20 | coutl<<ret<<endl; | ^~~~~
s102061993
p03862
C++
#include <iostream> #include <algorithm> using namespace std; int main() { long long n, x, a[100005], ans = 0; cin >> n >> x >> a[0]; for (int i = 1; i < n; ++i) { cin >> a[i]; int d = a[i] + a[i - 1] - x; if (d > 0) { a[i] = max(a[i] - d, 0); ans += d; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:35: error: no matching function for call to 'max(long long int, int)' 14 | a[i] = max(a[i] - d, 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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:14:35: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 14 | a[i] = max(a[i] - d, 0); | ~~~^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:14:35: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 14 | a[i] = max(a[i] - d, 0); | ~~~^~~~~~~~~~~~~
s990219502
p03862
C++
#include <algorithm> #include <iostream> using namespace std; int main() { long long int N; long long int x; long long int candy[100000] = {0}; cin >> N >> x; for (int i = 0; i < N; i++) { cin >> candy[i]; } long long int counter = 0; for (int i = 0; i < N; i++) { while (candy[i] + candy[i - 1] > x) { long long int tmp; tmp = candy[i] + candy[i - 1] - x; counter += tmp; candy[i] = candy[i] - min(tmp, a[i]); } } cout << counter << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:38: error: 'a' was not declared in this scope 20 | candy[i] = candy[i] - min(tmp, a[i]); | ^
s535246410
p03862
C++
#include<iostream> #include <string> #include <algorithm> using namespace std; int main(){ unsigned long N,x,i,temp; unsigned long array[100000]; unsigned long long sum =0; cin >>N>>x >>array[0]; if(array[0]>x){ array[0]=x; sum += x-array[0]; } for(i = 0 ; i< N; i++){ cin >> array[i]; } for(i = 0 ; i< N-1; i++){ temp = array[i]; if((array[i]+array[i+1])>x){ sum += array[i]+array[i+1]-sum; array[i+1] = min(0, x-array[i)]; if(array[i]>x){ array[i] = x; } } cout << sum; return 0; }
a.cc:16:13: error: extended character   is not valid in an identifier 16 | for(i = 0 ; i< N; i++){ | ^ a.cc:19:13: error: extended character   is not valid in an identifier 19 | for(i = 0 ; i< N-1; i++){ | ^ a.cc: In function 'int main()': a.cc:16:13: error: unable to find numeric literal operator 'operator""\U00003000' 16 | for(i = 0 ; i< N; i++){ | ^~~ a.cc:19:13: error: unable to find numeric literal operator 'operator""\U00003000' 19 | for(i = 0 ; i< N-1; i++){ | ^~~ a.cc:23:37: error: expected ']' before ')' token 23 | array[i+1] = min(0, x-array[i)]; | ^ | ] a.cc:23:24: error: no matching function for call to 'min(int, long unsigned int)' 23 | array[i+1] = min(0, x-array[i)]; | ~~~^~~~~~~~~~~~~~ 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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:23:24: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long unsigned int') 23 | array[i+1] = min(0, x-array[i)]; | ~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:23:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 23 | array[i+1] = min(0, x-array[i)]; | ~~~^~~~~~~~~~~~~~ a.cc:30:6: error: expected '}' at end of input 30 | } | ^ a.cc:6:15: note: to match this '{' 6 | int main(){ | ^
s091669704
p03862
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long ans = 0; int N = Integer.parseInt(sc.next()); int x = Integer.parseInt(sc.next()); int[] a = new int[N+1]; while(true){ a[cnt] = Integer.parseInt(sc.next()); cnt++; if(cnt==N)break; } if (a[0] > x) { ans += a[0] - x; a[0] = x; } for(int i=0;i<N;i++){ if(a[i]+a[i+1]>x){ int t = a[i] + a[i+1]-x; ans+=t; a[i+1] -= t; } } System.out.print(ans); System.out.println(); } }
Main.java:14: error: cannot find symbol a[cnt] = Integer.parseInt(sc.next()); ^ symbol: variable cnt location: class Main Main.java:15: error: cannot find symbol cnt++; ^ symbol: variable cnt location: class Main Main.java:16: error: cannot find symbol if(cnt==N)break; ^ symbol: variable cnt location: class Main 3 errors
s207041290
p03862
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <set> #include <map> #include <cmath> //ranker using namespace std; #define REPS(i, a, n) for (int i = (a); i < (n); ++i) #define REP(i, n) REPS(i, 0, n) #define RREP(i, n) REPS(i, 1, n + 1) #define DEPS(i, a, n) for (int i = (a); i >= n; --i) #define DEP(i, n) DEPS(i, n, 0) using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using pii = pair<int, int>; using pis = pair<int, string>; using psi = pair<string, int>; using D = double; int main(){ cin.tie(0); ios::sync_with_stdio(false); long long int N, x; cin >> N >> x; long long int a[N]; REP(i, N) cin >> a[i]; long long int tot=0; REPS(i, 1, N){ if(a[i]+a[i-1]>x){ long long int temp; temp = a[i]+a[i-1]-x; tot += temp; a[i+1]=a[i+1]-min(temp, a[i+1]); } cout << tot << endl; return 0; }
a.cc: In function 'int main()': a.cc:51:2: error: expected '}' at end of input 51 | } | ^ a.cc:28:11: note: to match this '{' 28 | int main(){ | ^
s264348403
p03862
C++
#include <iostream> #include <cstdio> #include <string> #include <algorithm> using namespace std; typedef long long int ll; ll n, x; ll first, second; ll ans; ll a[100005]; int main() { cin >> n >> x; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 1; i < n; i++) { if (a[i] + a[i-1] > x) { ans += a[i] + a[i-1] - x; a[i] -= ((a[i] + a[i-1] -x); } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:40: error: expected ')' before ';' token 23 | a[i] -= ((a[i] + a[i-1] -x); | ~ ^ | )
s845575741
p03862
Java
import java.util.Scanner; /** * @Author oreid * @Release 04/12/2016 */ public class MainA3 { static long[] row; public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int x = scanner.nextInt(); int opertations = 0; row = new long[n]; for (int i = 0; i < n ; i++) { row[i] = scanner.nextInt(); } scanner.close(); for (int i = 1; i < n; i++) { while(row[i -1] + row[i] > x){ if(row[i -1] > row[i]){ row[i-1] -= 1; }else{ row[i] -= 1; } opertations++; } } System.out.print(opertations + ""); } }
Main.java:7: error: class MainA3 is public, should be declared in a file named MainA3.java public class MainA3 { ^ 1 error
s466542810
p03862
Java
import java.util.Scanner; public class Q3 { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); long value = sc.nextLong(); long sum = sc.nextLong(); long m = 0; long eat = 0; long[] arr = new long[(int) value]; for(int i = 0; i< arr.length; i++){ arr[i] = sc.nextLong(); } sc.close(); for(int i=0; i <arr.length-1;i++){ if(arr[i] + arr[i+1] >sum){ m = arr[i+1]; arr[i+1] = sum - arr[i]; eat += m - arr[i+1]; } } System.out.println(eat); } }
Main.java:3: error: class Q3 is public, should be declared in a file named Q3.java public class Q3 { ^ 1 error
s715532674
p03862
C
#include <stdio.h> int main (void) { int a[100050]; int x; int N; int i; int count = 0; scanf("%d",&N); scanf("%d",&x); for(i=0;i<N;i++) scanf("%d",&a[i]); for(i=0;i<=N-1;i++){ if(a[i]+a[i+1] > x){ if(a[i]>=a[i+1]){ count = count+ a[i] -x; a[i] = a[i+1] -x; }else{ count = count + a[i+1] -x; a[i+1] =a[i] -x; } } //printf("%d\n",count); } /*for(i=0;i<N;i++){ printf("%d",a[i]);*/ } printf("\n"); printf("%d\n",count); return 0; }
main.c:29:12: error: expected declaration specifiers or '...' before string constant 29 | printf("\n"); | ^~~~ main.c:30:12: error: expected declaration specifiers or '...' before string constant 30 | printf("%d\n",count); | ^~~~~~ main.c:30:19: error: unknown type name 'count' 30 | printf("%d\n",count); | ^~~~~ main.c:31:5: error: expected identifier or '(' before 'return' 31 | return 0; | ^~~~~~ main.c:34:1: error: expected identifier or '(' before '}' token 34 | } | ^
s348490244
p03862
C++
/** * @Author Mehdi Maick * Created on 04/12/2016. */ import java.util.*; import java.io.*; import static java.lang.Math.*; public class Main { public static void solve(FastReader fs, PrintWriter pw) { int n = fs.nextInt(); long x = fs.nextLong(); long[] tab = fs.nextLongArray(n); long ans = 0; long sum = tab[0]; for (int i = 1; i < n; i++) { sum += tab[i]; if (tab[i] + tab[i - 1] > x) { long diff = ((tab[i] + tab[i - 1]) - x); if (tab[i] >= tab[i - 1]) { tab[i] = tab[i] - diff; ans += diff; } else { tab[i - 1] = tab[i - 1] - diff; ans += diff; } } } if(x == 0){ pw.println(sum); }else { pw.println(ans); } } public static void main(String[] args) throws Exception { FastReader fs = new FastReader(System.in); PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); solve(fs, pw); fs.close(); pw.close(); } static class FastReader { BufferedReader reader; StringTokenizer st; FastReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream)); st = null; } String next() { while (st == null || !st.hasMoreTokens()) { try { String line = reader.readLine(); if (line == null) { return null; } st = new StringTokenizer(line); } catch (Exception e) { throw new RuntimeException(); } } return st.nextToken(); } String nextLine() { String s = null; try { s = reader.readLine(); } catch (IOException e) { e.printStackTrace(); } return s; } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } char nextChar() { return next().charAt(0); } int[] nextIntArray(int n) { int[] arr = new int[n]; int i = 0; while (i < n) { arr[i++] = nextInt(); } return arr; } long[] nextLongArray(int n) { long[] arr = new long[n]; int i = 0; while (i < n) { arr[i++] = nextLong(); } return arr; } int[] nextIntArrayOneBased(int n) { int[] arr = new int[n + 1]; int i = 1; while (i <= n) { arr[i++] = nextInt(); } return arr; } long[] nextLongArrayOneBased(int n) { long[] arr = new long[n + 1]; int i = 1; while (i <= n) { arr[i++] = nextLong(); } return arr; } void close() { try { reader.close(); } catch (IOException e) { System.err.println("There's been an error trying closing the reader "); e.printStackTrace(); } } } }
a.cc:6:1: error: 'import' does not name a type 6 | import java.util.*; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import java.io.*; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:9:1: error: 'import' does not name a type 9 | import static java.lang.Math.*; | ^~~~~~ a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:11:1: error: expected unqualified-id before 'public' 11 | public class Main { | ^~~~~~
s295799974
p03862
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int x=sc.nextInt(); int a[]=new int[n]; for (int i = 0; i < n; i++) { a[i]=sc.nextInt(); } long ans=0; if(a[0]>x){ ans+=a[0]-x; a[0]-=ans; } for (int i = 0; i < n-1; i++) { if(a[i]+a[i+1]>x){ ans+=Math.min(a[i]+a[i+1]-x,a[i+1]); a[i+1]-=Math.min(a[i]+a[i+1]-x,a[i+1]);; } } System.out.println(ans); }
Main.java:28: error: reached end of file while parsing } ^ 1 error
s074114951
p03862
C++
5 9 3 1 4 1 5
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 9 | ^
s773541602
p03862
Java
/** * Created by sonetsuyoshi on 2016/07/31. */ public class Main { static public void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); long x = scanner.nextLong(); long[] arr = new long[N]; for(int i = 0; i < N; i++) { arr[i] = scanner.nextLong(); } long count = 0; for(int i = 0; i < N - 2; i++) { long s1 = arr[i] + arr[i + 1]; if(s1 > x) { if(s1 - x <= arr[i + 1]) { count += s1 - x; arr[i + 1] -= s1 - x; } else { arr[i + 1] = 0; count += s1 - x -arr[i + 1]; arr[i] -= s1 - x - arr[i + 1]; } } } if(arr[N - 2] + arr[N - 1] > x) { count += arr[N - 2] + arr[N - 1] - x; } System.out.println(count); } }
Main.java:8: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:8: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s269360211
p03863
C++
#include<bits/stdc++.h> using namespace std; using LL = long long; using ULL = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int main(){ string S; cin>>S; int N=S.size(); string ans; if(S.front()==S.back()){ ans = (x%2==1) ? "Second" : "First"; } else{ ans = (N%2==1) ? "First" : "Second"; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:14:10: error: 'x' was not declared in this scope 14 | ans = (x%2==1) ? "Second" : "First"; | ^
s630250188
p03863
C++
ada#include<bits/stdc++.h> using namespace std; #define int long long #define double long double #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) #define fi first #define se second #define sz size() #define bgn begin() #define en end() #define pb push_back #define pop() pop_back() #define V vector #define P pair #define yuko(a) setprecision(a) #define uni(a) a.erase(unique(a.begin(),a.end()),a.end()) #define Q queue #define pri priority_queue #define Pri priority_queue<int,vector<int>,greater<int>> #define PriP priority_queue<P<int,int>,vector<P<int,int>>,greater<P<int,int>>> #define ff first.first #define fs first.second #define sf second.first #define ss second.second #define all(a) (a).begin(),(a).end() #define elif else if int low(V<int> &a,int b){ auto c=lower_bound(a.begin(),a.end(),b); int d=c-a.bgn; return d; } int upp(V<int> &a,int b){ auto c=upper_bound(a.begin(),a.end(),b); int d=c-a.bgn; return d; } template<class T> void cou(vector<vector<T>> a){ int b=a.size(); int c=a[0].size(); fo(i,b){ fo(j,c){ cout<<a[i][j]; if(j==c-1) cout<<endl; else cout<<' '; } } } int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int a){ return a*(a+1)/2; } int gcm(int a,int b){ if(a%b==0) return b; return gcm(b,a%b); } bool prime(int a){ if(a<2) return false; else if(a==2) return true; else if(a%2==0) return false; for(int i=3;i<=sqrt(a)+1;i+=2){ if (a%i==0) return false; } return true; } struct Union{ vector<int> par; Union(int a){ par=vector<int>(a,-1); } int find(int a){ if(par[a]<0) return a; else return par[a]=find(par[a]); } bool same(int a,int b){ return find(a)==find(b); } int Size(int a){ return -par[find(a)]; } void unite(int a,int b){ a=find(a); b=find(b); if(a==b) return; if(Size(b)>Size(a)) swap<int>(a,b); par[a]+=par[b]; par[b]=a; } }; int ketas(int a){ string b=to_string(a); int c=0; fo(i,keta(a)){ c+=b[i]-'0'; } return c; } bool fe(int a,int b){ a%=10; b%=10; if(a==0) a=10; if(b==0) b=10; if(a>b) return true; else return false; } int INF=1000000007; struct edge{int s,t,d; }; V<int> mojisyu(string a){ V<int> b(26,0); fo(i,a.sz){ b[a[i]-'a']++; } return b; } int wa2(int a){ if(a%2==1) return a/2; return a/2-1; } /*signed main(){ int a,b,c; cin>>a>>b>>c; V<V<edge>> d(a); fo(i,b){ edge e; cin>>e.s>>e.t>>e.d; d[e.s].pb(e); } V<int> e(a,INF); e[c]=0; priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f; f.push({0,c}); int h=INF; while(!f.empty()){ P<int,int> g; g=f.top(); f.pop(); int v = g.second, i = g.first; for(edge l : d[v]){ if(e[l.t] > i + l.d){ e[l.t] = i + l.d; f.push({i+l.d , l.t}); } } } fo(i,a){ if(e[i]==INF) cout<<"INF"<<endl; else cout<<e[i]<<endl; } } ?*/ int nCr(int n,int r){ int a=1; r=min(r,n-r); for(int i=n;i>n-r;i--){ a*=i; a/=n-i+1; } return a; } /*void sea(int x,int y){ if(x<0||a<=x||y<0||b<=y||c[x][y]=='#') return; if(d[x][y]) return; d[x][y]++; sea(x+1,y); sea(x-1,y); sea(x,y+1); sea(x,y-1); }*/ int kaijou(int a){ int b=1; fo(i,a) b*=i+1; return b; } int nPr(int a,int b){ if(a<b) return 0; if(b==0) return 1; int c=1; for(int i=a;i>a-b;i--){ c*=i; c%=INF; } return c; } long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } // a^{-1} mod を計算する long long modinv(long long a, long long mod) { return modpow(a, mod - 2, mod); } int lcm(int a,int b){ int c=modinv(gcm(a,b),INF); return ((a*c)%INF)*(b%INF)%INF; } int MOD=INF; int fac[1000010], finv[1000010], inv[1000010]; // テーブルを作る前処理 //先にCOMinit()で前処理をする //ABC145D void COMinit() { fac[0]=fac[1]=1; finv[0]=finv[1]=1; inv[1]=1; for(int i=2;i<1000010;i++){ fac[i]=fac[i-1]*i%MOD; inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD; finv[i]=finv[i-1]*inv[i]%MOD; } } // 二項係数計算 int COM(int n,int k){ if(n<k) return 0; if(n<0||k<0) return 0; return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD; } bool naka(int a,int b,V<V<char>> c){ return (a>=0&&b>=0&&a<c.sz&&b<c[0].sz); } V<P<int,int>> mawari8={{0,-1},{0,1},{1,0},{-1,0},{-1,-1},{1,1},{1,-1},{-1,-1}}; int inf=1000000000000000007; V<P<int,int>> mawari4={{0,-1},{0,1},{1,0},{-1,0}}; //最短経路の表 a(全部INFで初期化) //縦横 x,y //迷路 f //スタートsx,sy //ゴールgx,gy //文字はgから使おうね /*int bfs_haba(){ Q<P<int,int>> b; a[sx][sy]=0; b.push({sx,sy}); while(!b.empty()){ P<int,int> c=b.front(); b.pop(); if(c.fi==gx&&c.se==gy){ break; } fo(i,4){ int d=c.fi+mawari4[i].fi; int e=c.se+mawari4[i].se; if(0<=d&&0<=e&&d<x&&e<y&&f[d][e]!='#'&&a[d][e]==INF){ b.push({d,e}); a[d][e]=1+a[c.fi][c.se]; } } } return a[gx][gy]; }*/ V<int> onajibubun(string a){ V<int> b(a.sz); for(int i=1,j=0;i<a.sz;i++){ if(i+b[i-j]<j+b[j]) b[i]=b[i-j]; else{ int c=max<int>(0,j+b[j]-i); while(i+c<a.sz&&a[c]==a[i+c]) c++; b[i]=c; j=i; } } b[0]=a.sz; return b; } //各頂点ごとにどこに辺が出てるかの表がc //各頂点ごとの色を表すV<int>(頂点数max)のcolorを用意する //aはどこ塗るか、bは何で塗るかなので、(0,1,c)でよぶとおけ V<int> color(200005); bool nibu_hantei(int a,int b,V<V<int>> c){ color[a]=b; fo(i,c[a].sz){ if(b==color[c[a][i]]) return false; if(color[c[a][i]]==0&&!nibu_hantei(c[a][i],-b,c)) return false; } return true; } //aは頂点数 //nibu_hanteiの上にcolorを用意する //各頂点ごとにどこに辺が出てるかの表がc bool renketujanai_nibu_hantei(int a,V<V<int>> c){ fo(i,a){ if(color[i]==0){ if(!nibu_hantei(i,1,c)) return false; } } return true; } struct segmin{ vector<int> seg; int b; segmin(V<int> a){ b=1; while(b<a.sz) b*=2; seg=vector<int>(2*b-1,inf); fo(i,a.sz){ seg[i+b-1]=a[i]; } for(int i=b-2;i>=0;i--){ seg[i]=min(seg[2*i+1],seg[2*i+2]); } } void update(int i,int a){ i+=b-1; seg[i]=a; while(i){ i=(i-1)/2; seg[i]=min(seg[2*i+1],seg[2*i+2]); } } //最初呼び出すときは要求区間x,y+1(yは添え字+1)とa=0,l=0,r=INFで //l,rは探すところ int getmin(int x,int y,int a,int l,int r){ if(r==INF) r=b; if(r<=x||y<=l) return INF; if(x<=l&&r<=y) return seg[a]; int a1=getmin(x,y,2*a+1,l,(l+r)/2); int a2=getmin(x,y,2*a+2,(l+r)/2,r); return min(a1,a2); } }; struct segadd{ vector<int> seg; int b; segadd(V<int> a){ b=1; while(b<a.sz) b*=2; seg=vector<int>(2*b-1,0); fo(i,a.sz){ seg[i+b-1]=a[i]; } for(int i=b-2;i>=0;i--){ seg[i]=seg[2*i+1]+seg[2*i+2]; } } void update(int i,int a){ i+=b-1; seg[i]=a; while(i){ i=(i-1)/2; seg[i]=seg[2*i+1]+seg[2*i+2]; } } //最初呼び出すときは要求区間x,y+1(yは添え字+1)とa=0,l=0,r=INFで //l,rは探すところ int getadd(int x,int y,int a,int l,int r){ if(r==INF) r=b; if(r<=x||y<=l) return 0; if(x<=l&&r<=y) return seg[a]; int a1=getadd(x,y,2*a+1,l,(l+r)/2); int a2=getadd(x,y,2*a+2,(l+r)/2,r); return a1+a2; } }; struct sege{ vector<P<int,V<int>>> seg; int b; sege(string a){ b=1; while(b<a.sz) b*=2; seg=vector<P<int,V<int>>>(2*b-1); fo(i,a.sz){ seg[i+b-1].fi=1; seg[i+b-1].se.pb(a[i]-'a'); } for(int i=b-2;i>=0;i--){ V<int> d=seg[2*i+1].se; fo(j,seg[2*i+2].se.sz){ d.pb(seg[2*i+2].se[j]); } Sort(d); uni(d); seg[i].se=d; seg[i].fi=d.sz; } } V<int> mu; void update(int i,char a){ i+=b-1; seg[i].se=mu; seg[i].se.pb(a-'a'); seg[i].fi=1; while(i){ i=(i-1)/2; V<int> d=seg[2*i+1].se; fo(j,seg[2*i+2].se.sz){ d.pb(seg[2*i+2].se[j]); } Sort(d); uni(d); seg[i].se=d; seg[i].fi=d.sz; } } void unko(){ fo(i,2*b-1) cout<<seg[i].fi<<' '; } //最初呼び出すときは要求区間x,y+1(yは添え字+1)とa=0,l=0,r=INFで //l,rは探すところ P<int,V<int>> gete(int x,int y,int a,int l,int r){ if(r==INF) r=b; if(r<=x||y<=l) return {0,mu}; if(x<=l&&r<=y) return seg[a]; P<int,V<int>> a1=gete(x,y,2*a+1,l,(l+r)/2); P<int,V<int>> a2=gete(x,y,2*a+2,(l+r)/2,r); fo(i,a2.se.sz) a1.se.pb(a2.se[i]); Sort(a1.se); uni(a1.se); return {a1.se.sz,a1.se}; } };/* signed main(){ int a,b,c; cin>>a>>b>>c; V<V<edge>> d(a); fo(i,b){ edge e; cin>>e.s>>e.t>>e.d; d[e.s].pb(e); } V<int> e(a,INF); e[c]=0; priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f; f.push({0,c}); int h=INF; while(!f.empty()){ P<int,int> g; g=f.top(); f.pop(); int v = g.second, i = g.first; for(edge l : d[v]){ if(e[l.t] > i + l.d){ e[l.t] = i + l.d; f.push({i+l.d , l.t}); } } } fo(i,a){ if(e[i]==INF) cout<<"INF"<<endl; else cout<<e[i]<<endl; } }*/ //aのb乗mod c int kurikaesijijou(int a,int b,int c){ a%=c; b%=c; if(b==0) return 1; if(b%2==0){ int d=kurikaesijijou(a,b/2,c); d%=c; return d*d%c; } return a*kurikaesijijou(a,b-1,c)%c; } int waINF(int a){ if(a>=0) return a%INF; return (a+INF*INF)%INF; } /*void soinsuu_init(int a){ }*/ //aは辺のvector,bは最短距離の表 bool find_negative_roop(V<P<P<int,int>,int>> a,V<int> b){ V<int> d(b.sz,1),e; fo(i,3*b.sz){ fo(j,a.sz){ P<P<int,int>,int> c=a[j]; if(b[c.ff]!=inf&&b[c.fs]>b[c.ff]+c.se){ b[c.fs]=b[c.ff]+c.se; if(i>=b.sz-1&&d[c.ff]){ d[c.ff]=0; e.pb(c.ff) } if(i>=b.sz-1&&d[c.fs]){ d[c.fs]=0; e.pb(c.fs); } } } } Union f(b.sz); fo(i,e.sz-1){ f.unite(e[i],e[i+1]); } fo(j,b.sz){ fo(i,a.sz){ if(f.same(a[i].ff,e[0])){ f.unite(e[0],a[i].fs); } } } if(f.same(e[0],b.sz-1)) return 1; return 0; } signed main(){ string a; cin>>a; V<int> b=mojisyu(a); Sort(b); if(b[25]==1){ if(a.sz%2) cout<<"First"<<endl; else cout<<"Second"<<endl; return 0; } if(a[0]==a[a.sz-1]){ if(a.sz%2==0) cout<<"First"<<endl; else cout<<"Second"<<endl; return 0; } if(a.sz%2) cout<<"First"<<endl; else cout<<"Second"<<endl; }
a.cc:1:4: error: stray '#' in program 1 | ada#include<bits/stdc++.h> | ^ a.cc:1:1: error: 'ada' does not name a type 1 | ada#include<bits/stdc++.h> | ^~~ a.cc:15:11: error: 'vector' was not declared in this scope 15 | #define V vector | ^~~~~~ a.cc:29:9: note: in expansion of macro 'V' 29 | int low(V<int> &a,int b){ | ^ a.cc:3:13: error: expected primary-expression before 'long' 3 | #define int long long | ^~~~ a.cc:29:11: note: in expansion of macro 'int' 29 | int low(V<int> &a,int b){ | ^~~ a.cc:3:13: error: expected primary-expression before 'long' 3 | #define int long long | ^~~~ a.cc:29:19: note: in expansion of macro 'int' 29 | int low(V<int> &a,int b){ | ^~~ a.cc:29:24: error: expression list treated as compound expression in initializer [-fpermissive] 29 | int low(V<int> &a,int b){ | ^ a.cc:15:11: error: 'vector' was not declared in this scope 15 | #define V vector | ^~~~~~ a.cc:34:9: note: in expansion of macro 'V' 34 | int upp(V<int> &a,int b){ | ^ a.cc:3:13: error: expected primary-expression before 'long' 3 | #define int long long | ^~~~ a.cc:34:11: note: in expansion of macro 'int' 34 | int upp(V<int> &a,int b){ | ^~~ a.cc:3:13: error: expected primary-expression before 'long' 3 | #define int long long | ^~~~ a.cc:34:19: note: in expansion of macro 'int' 34 | int upp(V<int> &a,int b){ | ^~~ a.cc:34:24: error: expression list treated as compound expression in initializer [-fpermissive] 34 | int upp(V<int> &a,int b){ | ^ a.cc:40:7: error: variable or field 'cou' declared void 40 | void cou(vector<vector<T>> a){ | ^~~ a.cc:40:11: error: 'vector' was not declared in this scope 40 | void cou(vector<vector<T>> a){ | ^~~~~~ a.cc:40:18: error: 'vector' was not declared in this scope 40 | void cou(vector<vector<T>> a){ | ^~~~~~ a.cc:40:26: error: expected primary-expression before '>>' token 40 | void cou(vector<vector<T>> a){ | ^~ a.cc:40:29: error: 'a' was not declared in this scope 40 | void cou(vector<vector<T>> a){ | ^ a.cc: In function 'long long int keta(long long int)': a.cc:61:5: error: 'log10' was not declared in this scope 61 | b=log10(b); | ^~~~~ a.cc: In function 'bool prime(long long int)': a.cc:80:18: error: 'sqrt' was not declared in this scope 80 | for(int i=3;i<=sqrt(a)+1;i+=2){ | ^~~~ a.cc: At global scope: a.cc:87:3: error: 'vector' does not name a type 87 | vector<int> par; | ^~~~~~ a.cc: In constructor 'Union::Union(long long int)': a.cc:89:3: error: 'par' was not declared in this scope 89 | par=vector<int>(a,-1); | ^~~ a.cc:89:7: error: 'vector' was not declared in this scope 89 | par=vector<int>(a,-1); | ^~~~~~ a.cc:3:13: error: expected primary-expression before 'long' 3 | #define int long long | ^~~~ a.cc:89:14: note: in expansion of macro 'int' 89 | par=vector<int>(a,-1); | ^~~ a.cc: In member function 'long long int Union::find(long long int)': a.cc:92:8: error: 'par' was not declared in this scope 92 | if(par[a]<0) | ^~~ a.cc: In member function 'long long int Union::Size(long long int)': a.cc:101:13: error: 'par' was not declared in this scope 101 | return -par[find(a)]; | ^~~ a.cc: In member function 'void Union::unite(long long int, long long int)': a.cc:109:7: error: 'swap' was not declared in this scope 109 | swap<int>(a,b); | ^~~~ a.cc:3:13: error: expected primary-expression before 'long' 3 | #define int long long | ^~~~ a.cc:109:12: note: in expansion of macro 'int' 109 | swap<int>(a,b); | ^~~ a.cc:110:5: error: 'par' was not declared in this scope 110 | par[a]+=par[b]; | ^~~ a.cc: In function 'long long int ketas(long long int)': a.cc:115:3: error: 'string' was not declared in this scope 115 | string b=to_string(a); | ^~~~~~ a.cc:118:8: error: 'b' was not declared in this scope 118 | c+=b[i]-'0'; | ^ a.cc: At global scope: a.cc:15:11: error: 'vector' does not name a type 15 | #define V vector | ^~~~~~ a.cc:136:1: note: in expansion of macro 'V' 136 | V<int> mojisyu(string a){ | ^ a.cc: In function 'long long int nCr(long long int, long long int)': a.cc:184:5: error: 'min' was not declared in this scope 184 | r=min(r,n-r); | ^~~ a.cc: At global scope: a.cc:15:11: error: 'vector' has not been declared 15 | #define V vector | ^~~~~~ a.cc:262:23: note: in expansion of macro 'V' 262 | bool naka(int a,int b,V<V<char>> c){ | ^ a.cc:262:24: error: expected ',' or '...' before '<' token 262 | bool naka(int a,int b,V<V<char>> c){ | ^ a.cc: In function 'bool naka(long long int, long long int, int)': a.cc:263:25: error: 'c' was not declared in this scope 263 | return (a>=0&&b>=0&&a<c.sz&&b<c[0].sz); | ^ a.cc: At global scope: a.cc:15:11: error: 'vector' does not name a type 15 | #define V vector | ^~~~~~ a.cc:266:1: note: in expansion of macro 'V' 266 | V<P<int,int>> mawari8={{0,-1},{0,1},{1,0},{-1,0},{-1,-1},{1,1},{1,-1},{-1,-1}}; | ^ a.cc:15:11: error: 'vector' does not name a type 15 | #define V vector | ^~~~~~ a.cc:269:1: note: in expansion of macro 'V' 269 | V<P<int,int>> mawari4={{0,-1},{0,1},{1,0},{-1,0}}; | ^ a.cc:15:11: error: 'vector' does not name a type 15 | #define V vector | ^~~~~~ a.cc:297:1: note: in expansion of macro 'V' 297 | V<int> onajibubun(string a){ | ^ a.cc:15:11: error: 'vector' does not name a type 15 | #define V vector | ^~~~~~ a.cc:316:1: note: in expansion of macro 'V' 316 | V<int> color(200005); | ^ a.cc:15:11: error: 'vector' has not been declared 15 | #define V vector | ^~~~~~ a.cc:317:30: note: in expansion of macro 'V' 317 | bool nibu_hantei(int a,int b,V<V<int>> c){ | ^ a.cc:317:31: error: expected ',' or '...' before '<' token 317 | bool nibu_hantei(int a,int b,V<V<int>> c){ | ^ a.cc: In function 'bool nibu_hantei(long long int, long long int, int)': a.cc:318:3: error: 'color' was not declared in this scope 318 | color[a]=b; | ^~~~~ a.cc:319:8: error: 'c' was not declared in this scope 319 | fo(i,c[a].sz){ | ^ a.cc:5:31: note: in definition of macro 'fo' 5 | #define fo(a,b) for(int a=0;a<b;a++) | ^ a.cc: At global scope: a.cc:15:11: error: 'vector' has not been declared 15 | #define V vector | ^~~~~~ a.cc:330:37: note: in expansion of macro 'V' 330 | bool renketujanai_nibu_hantei(int a,V<V<int>> c){ | ^ a.cc:330:38: error: expected ',' or '...' before '<' token 330 | bool renketujanai_nibu_hantei(int a,V<V<int>> c){ | ^ a.cc: In function 'bool renketujanai_nibu_hantei(long long int, int)': a.cc:332:8: error: 'color' was not declared in this scope 332 | if(color[i]==0){ | ^~~~~ a.cc:333:27: error: 'c' was not declared in this scope 333 | if(!nibu_hantei(i,1,c)) | ^ a.cc: At global scope: a.cc:340:3: error: 'vector' does not name a type 340 | vector<int> seg; | ^~~~~~ a.cc:342:11: error: expected ')' before '<' token 342 | segmin(V<int> a){ | ~ ^ a.cc: In member function 'void segmin::update(long long int, long long int)': a.cc:356:5: error: 'seg' was not declared in this scope; did you mean 'se'? 356 | seg[i]=a; | ^~~ | se a.cc:359:14: error: 'min' was not declared in this scope 359 | seg[i]=min(seg[2*i+1],seg[2*i+2]); | ^~~ a.cc: In member function 'long long int segmin::getmin(long long int, long long int, long long int, long long int, long long int)': a.cc:370:14: error: 'seg' was not declared in this scope; did you mean 'se'? 370 | return seg[a]; | ^~~ | se a.cc:373:12: error: 'min' was not declared in this scope 373 | return min(a1,a2); | ^~~ a.cc: At global scope: a.cc:377:3: error: 'vector' does not name a type 377 | vector<int> seg; | ^~~~~~ a.cc:379:11: error: expected ')' before '<' token 379 | segadd(V<int> a){ | ~ ^ a.cc: In member function 'void segadd::update(long long int, long long int)': a.cc:393:5: error: 'seg' was not declared in this scope; did you mean 'se'? 393 | seg[i]=a; | ^~~ | se a.cc: In member function 'long long int segadd::getadd(long long int, long long int, long long int, long long int, long long int)': a.cc:407:14: error: 'seg' was not declared in this scope; did you mean 'se'? 407 | return seg[a]; | ^~~ | se a.cc: At global scope: a.cc:414:3: error: 'vector' does not name a type 414 | vector<P<int,V<int>>> seg; | ^~~~~~ a.cc:416:14: error: expected ')' before 'a' 416 | sege(string a){ | ~ ^~ | ) a.cc:15:11: error: 'vector' does not name a type 15 | #define V vector | ^~~~~~ a.cc:436:3: note: in expansion of macro 'V' 436 | V<int> mu; | ^ a.cc:16:11: error: 'pair' does not name a type 16 | #define P pair | ^~~~ a.cc:460:3: note: in expansion of macro 'P' 460 | P<int,V<int>> gete(int x,int y,int a,int l,int r){ | ^ a.cc: In member function 'void sege::update(long long int, char)': a.cc:439:5: error: 'seg' was not declared in this scope; did you mean 'sege'?
s595927425
p03863
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; cin >> s; if (s[0] = s[s.length()-1]){ cout << "Second" << end; } else{ cout << "First" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:26: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 10 | cout << "Second" << end; | ~~~~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::nullptr_t' 306 | operator<<(nullpt
s461439694
p03863
C++
s = gets.chomp ca = s.size()%2 == 0 and s[0] == s[-1] cb = s.size()%2 != 0 and s[0] != s[-1] ans = 'Second' if ca or cb ans = 'First' end puts ans
a.cc:6:7: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes 6 | ans = 'Second' | ^~~~~~~~ a.cc:8:11: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 8 | ans = 'First' | ^~~~~~~ a.cc:1:1: error: 's' does not name a type 1 | s = gets.chomp | ^
s562507641
p03863
C++
#include<bits/stdc++.h> using namespace std; int main() { string a; getline(std::cin,a); bool f1=a.size()%2==1; bool f2=a[0]==a[a.size()-1]; std::cout<<f1^f2?"First":"Second"; return 0; }
a.cc: In function 'int main()': a.cc:9:16: error: no match for 'operator^' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'bool') 9 | std::cout<<f1^f2?"First":"Second"; | ~~~~~~~~~~~~~^~~ | | | | | bool | std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>} a.cc:9:16: note: candidate: 'operator^(int, int)' (built-in) 9 | std::cout<<f1^f2?"First":"Second"; | ~~~~~~~~~~~~~^~~ a.cc:9:16: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bitset:1577:5: note: candidate: 'template<long unsigned int _Nb> std::bitset<_Nb> std::operator^(const bitset<_Nb>&, const bitset<_Nb>&)' 1577 | operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bitset:1577:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::bitset<_Nb>' 9 | std::cout<<f1^f2?"First":"Second"; | ^~ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 9 | std::cout<<f1^f2?"First":"Second"; | ^~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 9 | std::cout<<f1^f2?"First":"Second"; | ^~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:9:17: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool' 9 | std::cout<<f1^f2?"First":"Second"; | ^~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 9 | std::cout<<f1^f2?"First":"Second"; | ^~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:9:17: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool' 9 | std::cout<<f1^f2?"First":"Second"; | ^~ /usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const valarray<_Tp>&, const valarray<_Tp>&)' 1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::valarray<_Tp>' 9 | std::cout<<f1^f2?"First":"Second"; | ^~ /usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::valarray<_Tp>' 9 | std::cout<<f1^f2?"First":"Second"; | ^~ /usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed: a.cc:9:17: note: mismatched types 'const std::valarray<_Tp>' and 'bool' 9 | std::cout<<f1^f2?"First":"Second"; | ^~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:146:3: note: candidate: 'constexpr std::byte std::operator^(byte, byte)' 146 | operator^(byte __l, byte __r) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:146:18: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::byte' 146 | operator^(byte __l, byte __r) noexcept | ~~~~~^~~ In file included from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/bits/ios_base.h:94:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator^(_Ios_Fmtflags, _Ios_Fmtflags)' 94 | operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:94:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::_Ios_Fmtflags' 94 | operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:144:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator^(_Ios_Openmode, _Ios_Openmode)' 144 | operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:144:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::_Ios_Openmode' 144 | operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:191:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator^(_Ios_Iostate, _Ios_Iostate)' 191 | operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:191:26: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::_Ios_Iostate' 191 | operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:176: /usr/include/c++/14/future:170:20: note: candidate: 'constexpr std::launch std::operator^(launch, launch)' 170 | constexpr launch operator^(launch __x, launch __y) noexcept |
s646293607
p03863
C++
#include <bits/stdc++.h> using namespace std; signed main () { ios_base::sync_with_stdio(false); cin.tie(NULL); string s; cin >> s; if (bool(s & 1) ^ (s.front() == s.back())) cout << "Second\n"; else cout << "First\n"; }
a.cc: In function 'int main()': a.cc:10:20: error: no match for 'operator&' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 10 | if (bool(s & 1) ^ (s.front() == s.back())) | ~ ^ ~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bitset:1557:5: note: candidate: 'template<long unsigned int _Nb> std::bitset<_Nb> std::operator&(const bitset<_Nb>&, const bitset<_Nb>&)' 1557 | operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bitset:1557:5: note: template argument deduction/substitution failed: a.cc:10:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::bitset<_Nb>' 10 | if (bool(s & 1) ^ (s.front() == s.back())) | ^ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:411:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__bitwise_and, typename _Dom1::value_type>::result_type> std::operator&(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 411 | _DEFINE_EXPR_BINARY_OPERATOR(&, struct std::__bitwise_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:411:5: note: template argument deduction/substitution failed: a.cc:10:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 10 | if (bool(s & 1) ^ (s.front() == s.back())) | ^ /usr/include/c++/14/bits/valarray_after.h:411:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_and, typename _Dom1::value_type>::result_type> std::operator&(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 411 | _DEFINE_EXPR_BINARY_OPERATOR(&, struct std::__bitwise_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:411:5: note: template argument deduction/substitution failed: a.cc:10:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 10 | if (bool(s & 1) ^ (s.front() == s.back())) | ^ /usr/include/c++/14/bits/valarray_after.h:411:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_and, typename _Dom1::value_type>::result_type> std::operator&(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 411 | _DEFINE_EXPR_BINARY_OPERATOR(&, struct std::__bitwise_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:411:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 10 | if (bool(s & 1) ^ (s.front() == s.back())) | ^ /usr/include/c++/14/bits/valarray_after.h:411:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_and, typename _Dom1::value_type>::result_type> std::operator&(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 411 | _DEFINE_EXPR_BINARY_OPERATOR(&, struct std::__bitwise_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:411:5: note: template argument deduction/substitution failed: a.cc:10:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 10 | if (bool(s & 1) ^ (s.front() == s.back())) | ^ /usr/include/c++/14/bits/valarray_after.h:411:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_and, typename _Dom1::value_type>::result_type> std::operator&(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 411 | _DEFINE_EXPR_BINARY_OPERATOR(&, struct std::__bitwise_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:411:5: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 10 | if (bool(s & 1) ^ (s.front() == s.back())) | ^ /usr/include/c++/14/valarray:1202:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_and, _Tp>::result_type> std::operator&(const valarray<_Tp>&, const valarray<_Tp>&)' 1202 | _DEFINE_BINARY_OPERATOR(&, __bitwise_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1202:1: note: template argument deduction/substitution failed: a.cc:10:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 10 | if (bool(s & 1) ^ (s.front() == s.back())) | ^ /usr/include/c++/14/valarray:1202:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__bitwise_and, _Tp>::result_type> std::operator&(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1202 | _DEFINE_BINARY_OPERATOR(&, __bitwise_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1202:1: note: template argument deduction/substitution failed: a.cc:10:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 10 | if (bool(s & 1) ^ (s.front() == s.back())) | ^ /usr/include/c++/14/valarray:1202:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_and, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_and, _Tp>::result_type> std::operator&(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1202 | _DEFINE_BINARY_OPERATOR(&, __bitwise_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1202:1: note: template argument deduction/substitution failed: a.cc:10:22: note: mismatched types 'const std::valarray<_Tp>' and 'int' 10 | if (bool(s & 1) ^ (s.front() == s.back())) | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:141:3: note: candidate: 'constexpr std::byte std::operator&(byte, byte)' 141 | operator&(byte __l, byte __r) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:141:18: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::byte' 141 | operator&(byte __l, byte __r) noexcept | ~~~~~^~~ In file included from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/bits/ios_base.h:84:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator&(_Ios_Fmtflags, _Ios_Fmtflags)' 84 | operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:84:27: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::_Ios_Fmtflags' 84 | operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:134:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator&(_Ios_Openmode, _Ios_Openmode)' 134 | operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:134:27: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::_Ios_Openmode' 134 | operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:181:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator&(_Ios_Iostate, _Ios_Iostate)' 181 | operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:181:26: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::_Ios_Iostate' 181 | operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/14/bits/shared_ptr_atomic.h:33, from /usr/include/c++/14/memory:81, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/atomic_base.h:109:3: note: candidate: 'constexpr std::memory_order std::operator&(memory_order, __memory_order_modifier)' 109 | operator&(memory_order __m, __memory_order_modifier __mod) noexcept | ^~~~~~~~ /usr/include/c++/14/bits/atomic_base.h:109:26: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>
s036857386
p03863
C++
.
a.cc:1:1: error: expected unqualified-id before '.' token 1 | . | ^
s601121854
p03863
C++
#include <bits/stdc++.h> using namespace std; #define vit vector<int>::iterator #define pb push_back #define ppb pop_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define forn(i, n) for(int i = 0; i < int(n); i++) #define fr first #define sc second #define skip continue #define PI 3.14159265 typedef unsigned long long ull; typedef long long ll; typedef unsigned int ui; typedef long double ld; typedef vector<int> vi; typedef vector<long long> vll; typedef vector<bool> vb; const int INF = 1e9 + 5; const long long MAXN=2e5 + 5;; void faster(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } bool cmp(const string& a, const string& b) { return (a + b) < (b + a); } vector<int> Reversed(const vector<int>& s){ vector<int> d = s; reverse(all(d)); return d; } void solve(){ string s; cin >> s; int l = s.size(); if(s[0] == s[l - 1]){ if(t % 2 == 0) cout << "First"; else cout << "Second"; } else{ if(t % 2 == 0) cout << "Second"; else cout << "First"; } } int main(){ //freopen("slalom.in","r",stdin); //freopen("slalom.out","w",stdout); //faster(); int n = 1; //cin >> n; while(n--){ solve(); cout << endl; } //fclose(stdout); }
a.cc: In function 'void solve()': a.cc:48:12: error: 't' was not declared in this scope 48 | if(t % 2 == 0) | ^ a.cc:53:12: error: 't' was not declared in this scope 53 | if(t % 2 == 0) | ^
s310068857
p03863
C++
#include <iostream> #include <cstdio> #include <set> #include <list> #include <vector> #include <stack> #include <queue> #include <map> #include <string> #include <sstream> #include <algorithm> #include <cstring> #include <cstdlib> #include <cctype> #include <cmath> #include <fstream> #include <iomanip> //#include <unordered_map> using namespace std; #define dbg(x) cerr << #x " = " << x << endl; typedef pair<int, int> P; typedef long long ll; #define FIN freopen("in.txt", "r", stdin); int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int ans = -1; string op; cin >> op; int n = op.size(); int ans = 0; if(op[0] == op[n - 1]) { ans = n - 3; } else { ans = n - 2; } if(ans % 2) { cout << "First" << endl; } else { cout << "Second" << endl; } }
a.cc: In function 'int main()': a.cc:34:9: error: redeclaration of 'int ans' 34 | int ans = 0; | ^~~ a.cc:30:9: note: 'int ans' previously declared here 30 | int ans = -1; | ^~~
s060896520
p03863
C++
#include <bits/stdc++.h> using namespace std; void solve(std::string s) { if(s.size()%2 == 0 or s[0] == s[s.size()-1])cout<<"Second"; else cout<<"First" } // Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You // use the default template now. You can remove this line by using your custom // template) int main() { std::string s; std::cin >> s; solve(s); return 0; }
a.cc: In function 'void solve(std::string)': a.cc:6:21: error: expected ';' before '}' token 6 | else cout<<"First" | ^ | ; 7 | } | ~
s928327586
p03863
C++
#include <cstring> #include <iostream> #include <numeric> #include <bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; if(s.size()%2==0) cout<<"First"<<endl; else cout<<"Second"<<endl;
a.cc: In function 'int main()': a.cc:12:22: error: expected '}' at end of input 12 | cout<<"Second"<<endl; | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s488080134
p03863
C++
#include<bits/stdc++.h> using namespace std; #define mod 10000007 #define ff first #define ss second #define ll long long #define int long long #define pii pair<ll,ll> #define vi vector<ll> #define mii map<ll,ll> #define pb push_back #define mp make_pair #define sp(x,y) fixed<<setprecision(y)<<x #define mk(arr,n,type) type *arr=new type[n]; #define w(x) ll x; cin>>x; while(x--) #define endl '\n' #define str string #define all(v) v.begin(),v.end() void kehsihba() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } char str[10000+5]; int_32 main() { scanf("%s",str); int len=strlen(str); int num=len-2; if(str[0]!=str[len-1]){ if(num%2) printf("First\n"); else printf("Second\n"); } else{ if(num%2) printf("Second\n"); else printf("First\n"); } return 0; }
a.cc:27:1: error: 'int_32' does not name a type 27 | int_32 main() { | ^~~~~~
s099578647
p03863
C++
#include<bits/stdc++.h> using namespace std; #define mod 10000007 #define ff first #define ss second #define ll long long #define int long long #define pii pair<ll,ll> #define vi vector<ll> #define mii map<ll,ll> #define pb push_back #define mp make_pair #define sp(x,y) fixed<<setprecision(y)<<x #define mk(arr,n,type) type *arr=new type[n]; #define w(x) ll x; cin>>x; while(x--) #define endl '\n' #define str string #define all(v) v.begin(),v.end() void kehsihba() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } char str[N]; int_32 main() { scanf("%s",str); int len=strlen(str); int num=len-2; if(str[0]!=str[len-1]){ if(num%2) printf("First\n"); else printf("Second\n"); } else{ if(num%2) printf("Second\n"); else printf("First\n"); } return 0; }
a.cc:26:10: error: 'N' was not declared in this scope 26 | char str[N]; | ^ a.cc:27:1: error: 'int_32' does not name a type 27 | int_32 main() { | ^~~~~~
s327839859
p03863
C++
#include<bits/stdc++.h> using namespace std; #define mod 10000007 #define ff first #define ss second #define ll long long #define int long long #define pii pair<ll,ll> #define vi vector<ll> #define mii map<ll,ll> #define pb push_back #define mp make_pair #define sp(x,y) fixed<<setprecision(y)<<x #define mk(arr,n,type) type *arr=new type[n]; #define w(x) ll x; cin>>x; while(x--) #define endl '\n' #define str string #define all(v) v.begin(),v.end() void kehsihba() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } int main() { scanf("%s",str); int len=strlen(str); int num=len-2; if(str[0]!=str[len-1]){ if(num%2) printf("First\n"); else printf("Second\n"); } else{ if(num%2) printf("Second\n"); else printf("First\n"); } return 0; }
cc1plus: error: '::main' must return 'int' a.cc: In function 'int main()': a.cc:27:19: error: expected primary-expression before ')' token 27 | scanf("%s",str); | ^ a.cc:28:23: error: expected primary-expression before ')' token 28 | int len=strlen(str); | ^ a.cc:31:11: error: expected unqualified-id before '[' token 31 | if(str[0]!=str[len-1]){ | ^
s839810438
p03863
C++
#include<iostream> #include<string> #include<stdio.h> main(){ string c;std::cin>>c; int len=c.length(); if(c[0]==c[l-1]){ if(len%2==0) puts("First"); else puts("Second"); } else{ if(len%2==0) puts("Second"); else puts("First"); } return 0; }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:5:5: error: 'string' was not declared in this scope 5 | string c;std::cin>>c; | ^~~~~~ a.cc:5:5: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included 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/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:5:24: error: 'c' was not declared in this scope 5 | string c;std::cin>>c; | ^ a.cc:7:16: error: 'l' was not declared in this scope 7 | if(c[0]==c[l-1]){ | ^
s100910274
p03863
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; string s; int len; int main() { cin >> s; len = s.size(); if (s[0] == s[len - 1]) { if (len % 2) printf("Second\n"); else printf("First\n"); } else { if (len % 2) printf("First\n"); else printf("Second\n") } return 0; }
a.cc: In function 'int main()': a.cc:17:32: error: expected ';' before '}' token 17 | else printf("Second\n") | ^ | ; 18 | } | ~
s191947291
p03863
C++
#include <bits/stdc++.h> using namespace std; bool isok (const string &s) { int n = s.length(); bool ok = false; for (int i = 1; i < n-1; i++) { ok |= (s[i-1] != s[i+1]); } return ok; } bool isok2 (const string &s) { map<char, int> mp; int one = 0; for (const char &c : s) mp[c]++; for (const auto& e : mp) { if (e.second == 1) one++; } return (mp.size() = 3 && one == 1); } int main() { string s; cin >> s; int n = s.length(); if (((n&1) && isok(s)) || (n % 2 == 0 && isok2(s))) { cout << "First" << endl; } else { cout << "Second" << endl; } return 0; }
a.cc: In function 'bool isok2(const std::string&)': a.cc:20:20: error: lvalue required as left operand of assignment 20 | return (mp.size() = 3 && one == 1); | ~~~~~~~^~
s345171723
p03863
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<iomanip> #include<math.h> #include<complex> #include<queue> #include<deque> #include<stack> #include<map> #include<set> #include<bitset> #include<functional> #include<assert.h> #include<numeric> using namespace std; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) #define pll pair<ll,ll> #define pint pll using ll = long long; const int inf=1e9+7; const ll longinf=1LL<<60 ; const ll mod=1e9+7 ; bool IsFirst(string s){ int cnt=0; int n=s.size(); if(n==2 && s[0]!=s[1])return false; rep(i,n-1){ if(s[i]==s[i+1]){ return true; } } for(int i=1;i<n-1;i++){ string temp=s.substr(0,i)+s.substr(i+1,n-i-1); if(!IsFirst(temp))return true; } return false; } int main(){ /* for(int i=0;i<50049;i++){ int temp=i; string t; t+='a'; while(temp){ t+='a'+temp%3; temp/=3; } if(IsFirst(t));//cout << t << ' ' << "First" << endl; else if(t.size()>=6)cout << t << ' ' << "Second" << endl; } */ string t; cin >> t; bool ok=true; int m=t.size(); rep(i,m-1)if(s[i]==s[i+1])ok=false; if(ok)cout << "First" << endl; else cout << "Second" << endl; return 0;}
a.cc: In function 'int main()': a.cc:61:16: error: 's' was not declared in this scope 61 | rep(i,m-1)if(s[i]==s[i+1])ok=false; | ^
s303437008
p03863
C
#include<stdio.h> #include<stdlib.h> #include<string.h> void fun(char *); void fun(char *s) { int len=strlen(s); if(s[0]==s[len-1]) { if(len%2==0) { printf("First\n"); } else { printf("Second\n"); } } return; else { if(len%2==0) { printf("Second\n"); } else { printf("First\n"); } } } int main() { char a[10010]; scanf("%s",a); fun(a); return 0; }
main.c: In function 'fun': main.c:20:5: error: 'else' without a previous 'if' 20 | else | ^~~~
s199851644
p03863
C++
#include<bits/stdc++.h> string s; int main(){ std::cin>>s; puts(((s[0]==s[s.length()-1])^(s.length()%2))?"First":"Second"); }
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'? 2 | string s; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:4:15: error: 's' was not declared in this scope 4 | std::cin>>s; | ^
s412948423
p03863
C++
#include<stdio.h> #include<string.h> char s[1000010];int main(){int len;scanf("%s",s);len=strlen(s);return 0&printf("%s",((s[0]==s[s.length()-1])^(s.length()%2))?"First":"Second");}
a.cc: In function 'int main()': a.cc:3:97: error: request for member 'length' in 's', which is of non-class type 'char [1000010]' 3 | char s[1000010];int main(){int len;scanf("%s",s);len=strlen(s);return 0&printf("%s",((s[0]==s[s.length()-1])^(s.length()%2))?"First":"Second");} | ^~~~~~ a.cc:3:113: error: request for member 'length' in 's', which is of non-class type 'char [1000010]' 3 | char s[1000010];int main(){int len;scanf("%s",s);len=strlen(s);return 0&printf("%s",((s[0]==s[s.length()-1])^(s.length()%2))?"First":"Second");} | ^~~~~~
s636563904
p03863
C++
#include <bits/stdc++.h> using namespace std; #define REP(i,a) for(int i = 0; i < (a); i++) #define ALL(a) (a).begin(),(a).end() typedef long long ll; typedef pair<int, int> P; const int INF = 1e9; const long long LINF = 1e18; const long long MOD = 1e9 + 7; signed main(){ string s; cin >> s; int n = s.size(); if(s[0] == s[n - 1]) n--; if(n % 2 == 0) cout << "Second" << endl; else cout << "First" << endl; return 0; }z
a.cc:19:2: error: 'z' does not name a type 19 | }z | ^
s327185147
p03863
C++
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int n = s.length(); if(((s[0] == s[n-1]) && (a % 2 == 1)) || ((s[0] != s[n-1]) && (a % 2 == 0))) cout<<"Second\n"; else cout<<"First\n"; return 0; }
a.cc: In function 'int main()': a.cc:9:34: error: 'a' was not declared in this scope 9 | if(((s[0] == s[n-1]) && (a % 2 == 1)) || ((s[0] != s[n-1]) && (a % 2 == 0))) | ^
s574805416
p03863
C++
#include<bits/stdc++.h> using namespace std; void fun(int i, string s, int &count) { if((s.length() > 2) && (s[a-1] != a[i+1])) { s.erase(1, 1); count++; fun(s.length()/2, s, count); } } int main() { string s; cin>>s; int count = 0; fun(s.length()/2, s, count); if(count % 2 == 0) cout<<"Second\n"; else cout<<"First\n"; return 0; }
a.cc: In function 'void fun(int, std::string, int&)': a.cc:6:35: error: 'a' was not declared in this scope 6 | if((s.length() > 2) && (s[a-1] != a[i+1])) | ^
s413715893
p03863
C++
#include <bits/stdc++.h> string s; int main(void){ std::cin>>s; return 0&(int)printf("%s",((s[0]==s[s.size()-1])^(s.length()%2))?"First\n":"Second\n\r"); }
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'? 2 | string s; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:4:15: error: 's' was not declared in this scope 4 | std::cin>>s; | ^
s259640249
p03863
C++
#include "cstdio" #include "string" #include "iostream" using namespace std; int main(){ string s; cin>>s; int x=s.size(); if(s[0]==s[x-1]) if(x%2==0){ printf("FIrst\n");return 0; } else{ printf("Second\n");return 0; } else{ if(x%2==0){ printf("Second\n");return 0; } else { printf("FIrst\n");return 0; } }
a.cc: In function 'int main()': a.cc:23:10: error: expected '}' at end of input 23 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s434387992
p03863
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; bool a=false,b=false; if(s.size()%2==0){ a=true; if(s[0]==s[s.size()-1]){ b=true; } if(a^b){ cout << "Second" << endl; } else{ cout << "First" << endl; } }
a.cc: In function 'int main()': a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s116036969
p03863
C++
#include <bits/stdc++.h> #define SORT(x) sort((x).begin(),(x).end()) #define ALL(x) x.begin(),x.end() #define db(x) cout<<#x<<"="<<x<<endl #define rep(i, n) for(int i = 0; i < n; i++) #define reps(i, m, n) for(int i = m; i < n; i++) #define repr(i, m, n) for(int i = m; i >= n; i--) #define INF (1e9) #define PI (acos(-1)) #define MOD 1000000007 using namespace std; typedef long long ll; void Main(){ string S; cin>>S; char c[2]; c[0]=S[0]; c[1]=S[S.length()-1]; ct=0; ct2 =1; reps(i,1,S.length()-1){ if(S[i]==ct2){ ct2=1-ct2; } else ct++; } cout << (ct%2==0 ? "Second": "First") <<"\n"; } //----------------------------------- int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << fixed << setprecision(15); Main(); } //-----------------------------------
a.cc: In function 'void Main()': a.cc:27:3: error: 'ct' was not declared in this scope; did you mean 'c'? 27 | ct=0; | ^~ | c a.cc:29:3: error: 'ct2' was not declared in this scope 29 | ct2 =1; | ^~~
s544351232
p03863
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<n; i++); int main(){ string s; cin >> s; if(s.length()%2 == 0){ if(s[0] == s[s.length()-1]) cout << "Second"; else cout << "First"; } else{ if(s[0] == s[s.length()-1]) cout << "Second"; else cout << "First"; }
a.cc: In function 'int main()': a.cc:13:6: error: expected '}' at end of input 13 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s546962352
p03863
C++
=#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int l = s.length(); if (s[0] == s[l - 1]) { if (l % 2 == 0) return cout << "First" << endl, 0; else return cout << "Second" << endl, 0; } else { if (l % 2 == 0) return cout << "Second" << endl, 0; else return cout << "First" << endl, 0; } }
a.cc:1:2: error: stray '#' in program 1 | =#include <iostream> | ^ a.cc:1:1: error: expected unqualified-id before '=' token 1 | =#include <iostream> | ^ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/char_traits.h:50: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared 144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type 146 | static _GLIBCXX14_CONSTEXPR std::size_t | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared 150 | find(const char_type* __s, std::size_t __n, const char_type& __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared 153 | move(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared 156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared 159 | assign(char_type* __s, std::size_t __n, char_type __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared 187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n) | ^~~ /usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)': /usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~ | __n /usr/include/c++/14/bits/char_traits.h: At global scope: /usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std'
s400321713
p03863
C++
#include <bits/stdc++.h> using namespace std; char s[10000001]; int main(){ gets(s); if(s[0]==s[l-1]) if(l%2==0) cout<<"First"<<endl; else cout<<"Second"<<endl; else if(l%2==0) cout<<"Second"<<endl; else cout<<"First"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 5 | gets(s); | ^~~~ | getw a.cc:8:9: error: 'else' without a previous 'if' 8 | else cout<<"Second"<<endl; | ^~~~ a.cc:9:5: error: 'else' without a previous 'if' 9 | else | ^~~~ a.cc:10:12: error: 'l' was not declared in this scope 10 | if(l%2==0) cout<<"Second"<<endl; | ^
s644263789
p03863
C++
//file_name:ABC48_D.cpp #include <bits/stdc++.h> #define fi first #define se second #define rep(i,n) for(int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = 1; i <= (n); ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) #define srep(i,s,t) for (int i = s; i < t; ++i) #define rng(a) a.begin(),a.end() #define maxs(x,y) (x = max(x,y)) #define mins(x,y) (x = min(x,y)) #define limit(x,l,r) max(l,min(x,r)) #define lims(x,l,r) (x = max(l,min(x,r))) #define isin(x,l,r) ((l) <= (x) && (x) < (r)) #define pb push_back #define sz(x) (int)(x).size() #define pcnt __builtin_popcountll #define uni(x) x.erase(unique(rng(x)),x.end()) #define snuke srand((unsigned)clock()+(unsigned)time(NULL)); #define show(x) cout<<#x<<" = "<<x<<endl; #define PQ(T) priority_queue<T,v(T),greater<T> > #define bn(x) ((1<<x)-1) #define dup(x,y) (((x)+(y)-1)/(y)) #define newline puts("") #define v(T) vector<T> #define vv(T) v(v(T)) using namespace std; typedef long long int ll; typedef unsigned uint; typedef unsigned long long ull; typedef pair<int,int> P; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<P> vp; inline int in() { int x; scanf("%d",&x); return x;} template<typename T>inline istream& operator>>(istream&i,v(T)&v) {rep(j,sz(v))i>>v[j];return i;} template<typename T>string join(const v(T)&v) {stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);} template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v) {if(sz(v))o<<join(v);return o;} template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v) {return i>>v.fi>>v.se;} template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v) {return o<<v.fi<<","<<v.se;} template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;} const double eps = 1e-10; const ll LINF = 1001002003004005006ll; const int INF = 1001001001; #define dame { puts("-1"); return 0;} #define yn {puts("Yes");}else{puts("No");} const int MX = 200005; // int scan /* int x; scanf("%d",&x); int y; scanf("%d",&y); int z; scanf("%d",&z); // matrix scan /* ll a[n] = {}; rep(i,n){ scanf("%lld",&a[i]); } */ // string scan /* string s; cin >> s; */ int main() { string s; cin >> s; int flag = 0; flag += s.size()%2; if(s[0]!=s[s.size()-1]){ flag++; } if(f%2==0){ cout << "First" << endl; }else{ cout << "Second" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:88:8: error: 'f' was not declared in this scope 88 | if(f%2==0){ | ^
s462616751
p03863
C++
#include<bits/stdc++.h> using namespace std; string a; int b; int main() { cin>>a; b=a.size(); if(a[0]==a[l-1]) { if(b%2==0) { cout<<"First"<<endl; return 0; } else { cout<<"Second"<<endl; return 0; } } else { if(b%2==0){ cout<<"Second"<<endl; return 0; } else { cout<<"First"<<endl; return 0; } } }
a.cc: In function 'int main()': a.cc:9:12: error: 'l' was not declared in this scope 9 | if(a[0]==a[l-1]) | ^
s379799767
p03863
C++
#include<bits/stdc++.h> using namespace std; string s; int main() { cin>>s; if(s[0]==s[s.size-1]){ if(s.size()%2==0){ cout<<"First"<<endl; } else{ cout<<"Second"<<endl; } } else{ if(s.size()%2!=0){ cout<<"First"<<endl; } else{ cout<<"Second"<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:7:22: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 7 | if(s[0]==s[s.size-1]){ | ~~^~~~ | ()
s766217215
p03863
C++
#include<bits/stdc++.h using namespace std; int main() { string s; cin>>s; int l=s.length(); if(s[0]==s[l-1]) { if(l%2==0) { cout<<"First"<<endl; } else { cout<<"Second"<<endl; } } else { if(l%2==0) { cout<<"Second"<<endl; } else { cout<<"First"<<endl; } } return 0; }
a.cc:1:23: error: missing terminating > character 1 | #include<bits/stdc++.h | ^
s383765698
p03863
C++
#include<bits/stdc++.h> using namespace std; string s; int main(){ cin>>s; if(s[0]==s[s.length()-1]){ if(s.length()%2==0){ cout<<"First"<<endl; return 0; } else{ cout<<"Second"<<endl; return 0; } } else{ if(s.length%2==0){ cout<<"Second"<<endl; return 0; } else{ cout<<"First"<<endl; return 0; } } }
a.cc: In function 'int main()': a.cc:17:14: 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 | if(s.length%2==0){ | ~~^~~~~~ | ()
s424086767
p03863
C++
#include<iostream> #include<string> using namespace std; string s; int a; int main() { cin>>s; l=s.length(); if(s[0]==s[a-1]) { if(a%2==0)cout<<"First"<<endl; else cout<<"Second"<<endl; return 0; } else { if(a%2==0)cout<<"Second"<<endl; else cout<<"First"<<endl; return 0; } }0
a.cc: In function 'int main()': a.cc:9:5: error: 'l' was not declared in this scope 9 | l=s.length(); | ^ a.cc: At global scope: a.cc:22:2: error: expected unqualified-id before numeric constant 22 | }0 | ^
s266445964
p03863
C++
#include<iostream> #include<string> using namespace std; string s; int a; int main() { cin>>s; l=s.length(); if(s[0]==s[a-1]) { if(l%2==0)cout<<"First"<<endl; else cout<<"Second"<<endl; return 0; } else { if(l%2==0)cout<<"Second"<<endl; else cout<<"First"<<endl; return 0; } }
a.cc: In function 'int main()': a.cc:9:5: error: 'l' was not declared in this scope 9 | l=s.length(); | ^
s042473567
p03863
C++
# include <bits/stdc++.h> # define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i) # define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i) # define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i) # define rreps(i, n) for(int i=((int)(n)); i>0; --i) # define ALL(x) (x).begin(), (x).end() # define SZ(x) ((int)(x).size()) # define pb push_back # define optimize_cin() cin.tie(0); ios::sync_with_stdio(false) using namespace std; using lint = long long; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } int main() { string s; cin >> s; if (!(SZ(s) & 0x1)) { cout << "Second" << "\n"; } else { lint med = (lint)S.size()/ 2; s.erase(s.begin() + med); char left = s[med - 1]; char right = s[med]; if (left == right) { cout << "Second" << "\n"; } else { cout << "First" << "\n"; } } return 0; }
a.cc: In function 'int main()': a.cc:24:26: error: 'S' was not declared in this scope 24 | lint med = (lint)S.size()/ 2; | ^
s090566169
p03863
C++
#include<bits/stdc++.h> using namespace std; bool a[27][100002],m[27],mm=10000000; int main(){ string s; cin>>s; for(int i=0;i<s.size();i++){ a[i][s[i]-'a']=1; } for(int j=0;j<26;j++){ m[j]=2; int t=10000000; for(int i=0;i<n;i++){ if(t[j][i]&&t<10000000){ m[j]=min(t,m[j]); t=0; }else{ t++; } } mm=min(m[j],mm); } if(mm==10000000){ mm=s.size(); } mm%=2; if(mm){ cout<<"First"; }else{ cout<<"Second"; } return 0; }
a.cc: In function 'int main()': a.cc:13:31: error: 'n' was not declared in this scope 13 | for(int i=0;i<n;i++){ | ^ a.cc:14:29: error: invalid types 'int[int]' for array subscript 14 | if(t[j][i]&&t<10000000){ | ^ a.cc:15:41: error: no matching function for call to 'min(int&, bool&)' 15 | m[j]=min(t,m[j]); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:15:41: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'bool') 15 | m[j]=min(t,m[j]); | ~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:15:41: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 15 | m[j]=min(t,m[j]); | ~~~^~~~~~~~
s106495982
p03863
C++
#include <bits/stdc++.h> typedef long long ll; const int INF=1e9,MOD=1e9+7,ohara=1e6; const ll LINF=1e18; using namespace std; #define rep(i,n) for(ll (i)=0;(i)<(int)(n);(i)++) #define rrep(i,a,b) for(ll i=(a);i<(b);i++) #define rrrep(i,a,b) for(ll i=(a);i>=(b);i--) #define all(v) (v).begin(), (v).end() #define pb(q) push_back(q) #define Size(n) (n).size() #define Cout(x) cout<<(x)<<endl ll n,cnt,ans,a,b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos; int dy[]={1,0,-1,0}; int dx[]={0,1,0,-1}; //int dy[]={-1,0,1,-1,1,-1,0,1}; //int dx[]={-1,-1,-1,0,0,1,1,1}; string alph("abcdefghijklmnopqrstuvwxyz"),s; bool fl; struct edge{int to,cost;}; //-------------------------↓↓↓↓↓↓------------------------ int main(void){ cin.tie(0); ios::sync_with_stdio(false); cin>>s; if(s[i]==s[Size(s)-1]){ pos=Size(s)-2; if(pos%2==1)Cout("Second"); else Cout("First"); } else{ pos=Size(s)-2; if(pos%2==1)Cout("First"); else Cout("Second"); } return 0; }
a.cc: In function 'int main()': a.cc:31:10: error: 'i' was not declared in this scope 31 | if(s[i]==s[Size(s)-1]){ | ^
s136373630
p03863
C++
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; int n,m,c[190901],ans; char a[100011]; int main() { scanf("%s",a); m=strlen(a); if(a[0]==a[m-1]) { if(m%2==1)printf("Second"); else printf("First"); } else { if(m%2==0)printf("Second"); else printf("First"); } } }
a.cc:23:1: error: expected declaration before '}' token 23 | } | ^
s178897754
p03863
C++
#include<bits/stdc++.h> using namespace std; char s[100001]; int main() { gets(s); int len=strlen(s); int len1=len-2,le; for(int i=1;i<=len;i++) { if(s[i]==s[i+2]&&(s[i]!=s[i+1])) { len1--; le=len1; } } if((len1-le)%2==0)cout<<"Second"; else cout<<"First"; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s841854672
p03863
C++
#include<bits/stdc++.h> using namespace std; char s[100001]; int main() { gets(s); int len=strlen(s); int len1=len-2,le; for(int i=1;i<=len;i++) { if(s[i]==s[i+2]&&(s[i]!=s[i+1])) { if(len1==1) { cout<<"First"; return 0; } else { len1--; le=len1; } } } if((len1-le)%2==1)cout<<"Second"; else cout<<"First"; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s348089512
p03863
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; if(s.size()%1.5==0) cout<<"First"; else cout<<"Second"; return 0; }
a.cc: In function 'int main()': a.cc:6:20: error: invalid operands of types 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'double' to binary 'operator%' 6 | if(s.size()%1.5==0) cout<<"First"; | ~~~~~~~~^~~~ | | | | | double | std::__cxx11::basic_string<char>::size_type {aka long unsigned int}
s175535572
p03863
C++
#include<bits/stdc++.h> using namespace std; char s[100001]; int main() { gets(s); int len=strlen(s); if(s[0]==s[len-1]) if(len%2==1)cout<<"Second"; else cout<<"First"; else if(len%2==1)cout<<"First"; else cout<<"Second"; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s297515606
p03863
C++
#include<iostream> #include<cstdio> #include<string> #include<cstring> using namespace std; char a[100010]; int len; int main() { cin>>s; len=strlen(s);len--; int m=0; while(1) //for(int k=1;k<=2;k++) { int n=m; for(int i=1;i<len;i++) { if(s[i]=='.') continue; char a='c',b='c'; for(int j=i-1;j>=0;j++) { if(s[j]!='.') {a=s[j];break;} } for(int j=i+1;j<=len;j++) { if(s[j]!='.') {b=s[j];break;} } if(a!=b) { s[i]='.'; m++; break; } } if(n==m) break; } if(m%2==0) cout<<"Second"; else cout<<"First"; return 0; }
a.cc: In function 'int main()': a.cc:10:10: error: 's' was not declared in this scope 10 | cin>>s; | ^
s939123877
p03863
C++
#include<bits/stdc++.h> using namespace std; bool f=0; long long z; char s[100004]; int main(){ gets(s); int lens=strlen(s); for(long long i=0;i<lens;i++) { if(s[i]!=s[i+1]) f=1; } if(f==1) { if(s[0]!=s[lens-1]) z=lens-2; else z=lens-3; } else z=0; if(z%2==1) puts("First"); else puts("second"); return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s631423720
p03863
C++
#include<bits/stdc++.h> using namespace std; bool f=0; long long z; char s[100004]; int main(){ gets(s); int lens=strlen(s); for(long long i=0;i<lens;i++) { if(s[i]!=s[i+1]) f=1; } if(f==1) { if(s[0]!=s[lens=1]) z=lens-2; else z=lens-3; } else z=0; if(z%2==1) puts("First"); else puts("second"); return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s735772070
p03863
C++
#include<bits/stdc++.h> using namespace std; bool f=0; int z; char s[100004]; int main(){ gets(s); int lens=strlen(s); for(int i=0;i<lens;i++) { if(s[i]!=s[i+1]) f=1; } if(f==1) { if(s[0]!=s[lens=1]) z=lens-2; else z=lens-3; } else z=0; if(z%2==1) puts("First"); else puts("second"); return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s241303623
p03863
C++
#include<bits/stdc++.h> using namespace std; bool f=0; int f; char s[100004]; int main(){ gets(s); int lens=strlen(s); for(int i=0;i<lens;i++) { if(s[i]!=s[i+1]) f=1; } if(f==1) { if(s[0]!=s[lens=1]) f=lens-2; else f=lens-3; } else f=0; if(f%2==1) puts("First"); else puts("second"); return 0; }
a.cc:4:5: error: conflicting declaration 'int f' 4 | int f; | ^ a.cc:3:6: note: previous declaration as 'bool f' 3 | bool f=0; | ^ a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s716197951
p03863
C++
#include<cstdio> #include<cstring> using namespace std; char s[1000005]; bool bo; long long ji; int main(){ scanf("%s",&s); long long len=strlen(s); for(long long i=0;i<len-1;i++) { if(s[i]!=s[i+1])bo=1;} if(bo==1){ if(s[0]!=s[len-1]) ji=len-2; else ji=len-3;} else ji=0; if(ji%2==1)cout<<"First"; else cout<<"Second"; return 0; }
a.cc: In function 'int main()': a.cc:18:36: error: 'cout' was not declared in this scope 18 | if(ji%2==1)cout<<"First"; | ^~~~ a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<cstring> +++ |+#include <iostream> 3 | using namespace std; a.cc:19:30: error: 'cout' was not declared in this scope 19 | else cout<<"Second"; | ^~~~ a.cc:19:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s484461489
p03863
C++
#include<bits/stdc++.h> using namespace std; char s[100007]; int i,t; long find(int lena) { int max=0; int b=-1; for(i=1;i<=lena/2;i++) { for(t=lena-2;t>i;t--) { if(s[i]==s[t]) { b=t-i; } } max=max>b?max:b; } if(b==-1) max=1; return max; } int main(){ gets(s); int lena=strlen(s); if(find(lena)%2==0) cout<<"Second"; else cout<<"First"; return 0; }
a.cc: In function 'int main()': a.cc:24:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 24 | gets(s); | ^~~~ | getw
s077284444
p03863
C++
#include<bits/stdc++.h> using namespace std; char s[100007]; int i,t; long find(int lena) { int max=0; int b=-1; for(i=1;i<=lena/2;i++) { for(t=lena-2;t>i;t--) { if(s[i]==s[t]) { b=t-i; } } max=max>b?max:b; } if(b==-1) max=1; return max; } int main(){ gets(s); int lena=strlen(s); if(find(lena)%2==0) cout<<"Second"; else cout<<"First"; return 0; }
a.cc: In function 'int main()': a.cc:24:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 24 | gets(s); | ^~~~ | getw
s224855474
p03863
C++
#include<bits/stdc++.h> using namespace std; char s[100000000]; int main() { gets(s); cout<<"First"<<endl; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s497656671
p03863
C++
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
a.cc:1:1: error: 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh' does not name a type 1 | hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s760581024
p03863
C++
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
a.cc:1:1: error: 'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh' does not name a type 1 | hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s972837081
p03863
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; cin>>s; cout<<(s[0]==s[s.size()-1])?"Second":"First"<<endl; }
a.cc: In function 'int main()': a.cc:8:47: error: invalid operands of types 'const char [6]' and '<unresolved overloaded function type>' to binary 'operator<<' 8 | cout<<(s[0]==s[s.size()-1])?"Second":"First"<<endl; | ~~~~~~~^~~~~~
s597804071
p03863
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; cin>>s; cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; }
a.cc: In function 'int main()': a.cc:8:13: error: no match for 'operator!=' (operand types are 'std::basic_ostream<char>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}) 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; a.cc:8:13: note: candidate: 'operator!=(int, int)' (built-in) a.cc:8:13: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int' In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'const std::fpos<_StateT>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'const std::allocator<_CharT>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:8:27: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:8:27: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>' 8 | cout<<s[0]!=s[s.size()-1]?"First":"Second"<<endl; | ^ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46: /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::basic_ostream<char>' is not derived from 'const
s418614063
p03863
C++
#include <iostream> #include <algorithm> #include <string.h> #include <queue> #include <vector> #include <set> #include <utility> #include <string> #include <cstdio> #include <cmath> #include <cstring> #include <stack> #define N 100010 using namespace std; char str[N]; int main() { gets(str); int len = strlen(str); if (str[0]==str[len-1]) { if (len%2) { printf("Second\n"); } else { printf("First\n"); } } else { if (len%2) { printf("First\n"); } else { printf("Second\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:21:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 21 | gets(str); | ^~~~ | getw
s322313702
p03863
C++
#include <iostream> #include <algorithm> #include <string.h> #include <queue> #include <vector> #include <set> #include <utility> #include <string> #include <cstdio> #include <cmath> #include <cstring> #include <stack> #define N 100010 using namespace std; char str[N]; int main() { gets(str); int len = strlen(str); if (str[0]==str[len-1]) { if (len%2) { printf("Second\n"); } else { printf("First\n"); } } else { if (len%2) { printf("First\n"); } else { printf("Second\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:21:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 21 | gets(str); | ^~~~ | getw
s446420348
p03863
C++
#include <iostream> #include <algorithm> #include <queue> #include <vector> #include <set> #include <utility> #include <string> #include <cstdio> #include <cmath> #include <cstring> #include <stack> #define N 100010 using namespace std; char str[N]; int main() { gets(str); int len = strlen(str); if (str[0]==str[len-1]) { if (len%2) { printf("Second\n"); } else { printf("First\n"); } } else { if (len%2) { printf("First\n"); } else { printf("Second\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:20:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 20 | gets(str); | ^~~~ | getw
s476260245
p03863
C++
#include<stdio.h> #include<string.h> #include<math.h> #define N 100010 using namespace std; int main() { char x[N]; gets(x); int m,n,sum=0; m=strlen(x); for(int i=1;i<m-1;i++) { if(x[i-1]!=x[i+1]) { sum++; } } if(sum==0) { printf("Second\n"); return 0; } n=sum%2; if(x[0]!=x[m-1]) { if(n) { printf("First"); } else printf("Second"); } if(x[0]==x[m-1]) { if(n) { printf("Second"); } else printf("First"); } return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(x); | ^~~~ | getw
s128520021
p03863
C++
#include<stdio.h> #include<string.h> #include<math.h> #define N 100010 int main() { char x[N]; gets(x); int m,n,sum=0; m=strlen(x); for(int i=1;i<m-1;i++) { if(x[i-1]!=x[i+1]) { sum++; } } if(sum==0) { printf("Second\n"); return 0; } n=sum%2; if(x[0]!=x[m-1]) { if(n) { printf("First"); } else printf("Second"); } if(x[0]==x[m-1]) { if(n) { printf("Second"); } else printf("First"); } return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(x); | ^~~~ | getw
s381363643
p03863
C++
abcab
a.cc:1:1: error: 'abcab' does not name a type 1 | abcab | ^~~~~
s267334114
p03863
C++
#include <iostream> #include<cstdlib> #include<queue> #include<set> #include<vector> #include<string> #include<algorithm> #include<stack> #include<map> #include<deque> #include<cstdio> using namespace std; #define rep(i,a) for(int i=0;i<a;i++) #define mp make_pair #define pb push_back #define ll __int64 //#define __int64 long long #define P pair<ll,ll> const ll mod=1000000007; string s; int main(){ cin>>s; bool ok=0; for(int i=1;i<s.size()-1;i++)if(s[i-1]!=s[i+1])ok=1; if(!ok)cout<<"Second"; else{ if(s.size()%2)cout<<"First"; else cout<<"Second"; } cout<<endl; return 0; }
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'? 16 | #define ll __int64 | ^~~~~~~ a.cc:19:7: note: in expansion of macro 'll' 19 | const ll mod=1000000007; | ^~
s882035198
p03863
Java
#include<iostream> #include <math.h> #include <bits/stdc++.h> #define ll long long #define inf 0x3f3f3f3f #define maxn 310000 using namespace std; int vis[maxn]; char s[111111]; int main() { int i,j,n,jj=0,sum=0,k,flag; cin>>s; n=strlen(s); for(i=1;i<n-1;i++) { if(s[i-1]!=s[i+1]) jj++; } printf("%s\n",jj%2?"First":"Second"); return 0; }
Main.java:1: error: illegal character: '#' #include<iostream> ^ Main.java:2: error: illegal character: '#' #include <math.h> ^ Main.java:3: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:4: error: illegal character: '#' #define ll long long ^ Main.java:5: error: illegal character: '#' #define inf 0x3f3f3f3f ^ Main.java:6: error: illegal character: '#' #define maxn 310000 ^ Main.java:8: error: class, interface, enum, or record expected int vis[maxn]; ^ Main.java:9: error: class, interface, enum, or record expected char s[111111]; ^ Main.java:13: error: not a statement cin>>s; ^ Main.java:10: error: unnamed classes are a preview feature and are disabled by default. int main() ^ (use --enable-preview to enable unnamed classes) 10 errors
s016655908
p03863
Java
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String s = scanner.next(); int length = s.length(); StringBuilder sb = new StringBuilder(s); int turn = 0; // 偶数 = 高橋, 奇数 = 青木 int i = 1; while (i < length - 1) { System.out.println(i + " : " + sb.toString()); if (sb.length() <= 2) { // とれない // System.out.println("とれない"); // give up System.out.println((turn % 2 == 0) ? "Second" : "First"); return; } if (sb.charAt(i - 1) == sb.charAt(i + 1)) { // とれない // System.out.println("とれない"); if (i >= length - 2) { // give up System.out.println((turn % 2 == 0) ? "Second" : "First"); return; } i++; } else { // とれる // System.out.println("とれる"); sb.deleteCharAt(i); i = 1; turn++; } } } }
Main.java:4: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s162503353
p03863
Java
import java.util.Scanner; public class Main5 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String s = scanner.next(); int length = s.length(); StringBuilder sb = new StringBuilder(s); int turn = 0; // 偶数 = 高橋, 奇数 = 青木 int i = 1; while (i < length - 1) { System.out.println(i + " : " + sb.toString()); if (sb.length() <= 2) { // とれない // System.out.println("とれない"); // give up System.out.println((turn % 2 == 0) ? "Second" : "First"); return; } if (sb.charAt(i - 1) == sb.charAt(i + 1)) { // とれない // System.out.println("とれない"); if (i >= length - 2) { // give up System.out.println((turn % 2 == 0) ? "Second" : "First"); return; } i++; } else { // とれる // System.out.println("とれる"); sb.deleteCharAt(i); i = 1; turn++; } } } }
Main.java:3: error: class Main5 is public, should be declared in a file named Main5.java public class Main5 { ^ 1 error
s180985929
p03863
C++
#include <iostream> #include <cstdlib> #include <algorithm> #include <cstdio> #include <cmath> #include <cstring> using namespace std; char s[100005]; int main() { scanf("%s",s); int len=strlen(s); if ((len&1)!=(s[0]==s[len-1])) printf("First\n"); else printf("Second\n"); return 0; } #include <iostream> #include <cstdlib> #include <algorithm> #include <cstdio> #include <cmath> #include <cstring> using namespace std; char s[100005]; int main() { scanf("%s",s); int len=strlen(s); if ((len&1)!=(s[0]==s[len-1])) printf("First\n"); else printf("Second\n"); return 0; }
a.cc:29:6: error: redefinition of 'char s [100005]' 29 | char s[100005]; | ^ a.cc:10:6: note: 'char s [100005]' previously declared here 10 | char s[100005]; | ^ a.cc:31:5: error: redefinition of 'int main()' 31 | int main() { | ^~~~ a.cc:12:5: note: 'int main()' previously defined here 12 | int main() { | ^~~~
s634115439
p03863
C++
s = input() print('Second' if (s[0] == s[-1]) != (len(s) % 2 == 0) else 'First')
a.cc:2:7: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes 2 | print('Second' if (s[0] == s[-1]) != (len(s) % 2 == 0) else 'First') | ^~~~~~~~ a.cc:2:61: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 2 | print('Second' if (s[0] == s[-1]) != (len(s) % 2 == 0) else 'First') | ^~~~~~~ a.cc:1:1: error: 's' does not name a type 1 | s = input() | ^
s988853837
p03863
C++
asdfaf
a.cc:1:1: error: 'asdfaf' does not name a type 1 | asdfaf | ^~~~~~
s350919914
p03863
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; cout << ((s.size() & 1) ^ (s[0] == s.back()) ? "First\n" : "Second\n") }
a.cc: In function 'int main()': a.cc:7:79: error: expected ';' before '}' token 7 | cout << ((s.size() & 1) ^ (s[0] == s.back()) ? "First\n" : "Second\n") | ^ | ; 8 | } | ~
s096930069
p03863
C++
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <string> #include <cstdio> using namespace std; #define rep(i, n) for (int i = 0; i<(n); i++) int main() { string s; cin >> s; s.size % 2 ^ s.begin() == s.end() ? cout << "First" << endl : cout << "Second" << endl; }
a.cc: In function 'int main()': a.cc:14:11: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 14 | s.size % 2 ^ s.begin() == s.end() ? cout << "First" << endl : cout << "Second" << endl; | ~~^~~~ | ()
s552459894
p03863
C++
#include <cstdio> #include <string> #include <stack> #include <iostream> using namespace std; string S; int ans = -1, s = 0, e = -1; int main() { cin>>S; for(int i = 1 ; i < S.size() ; i++ ) if( S[i] == S[0] ) e = i; if( e >= 0 ) ans = e-s-2; e = S.size()-1, s = -1; for(int i = S.size()-2 ; i >= 0 ; i-- ) if( S[i] == S[S.size()-1] ) s = i; if( s >= 0 ) ans = e-s-2; if( ans == -1 ) ans = S.size() - 2;abc if( ans%2 ) cout<<"First"; else cout<<"Second"; }
a.cc: In function 'int main()': a.cc:20:40: error: 'abc' was not declared in this scope; did you mean 'abs'? 20 | if( ans == -1 ) ans = S.size() - 2;abc | ^~~ | abs a.cc:22:5: error: 'else' without a previous 'if' 22 | else cout<<"Second"; | ^~~~
s604562354
p03864
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), x = sc.nextInt(), a[] = new int[n]; for (int i = 0; i < n; i++) a[i] = sc.nextInt(); long cnt = 0; cnt += Math.max(0, a[0]-x); //First element int current = a[0]-cnt; for (int i = 1; i < n; i++) { cnt += Math.max(0, current+a[i]-x); current = a[i]-Math.max(0, current+a[i]-x); } System.out.println(cnt); } }
Main.java:12: error: incompatible types: possible lossy conversion from long to int int current = a[0]-cnt; ^ 1 error
s621806635
p03864
Java
import java.util.Scanner; public class VJ397313A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), x = sc.nextInt(), a[] = new int[n]; for (int i = 0; i < n; i++) a[i] = sc.nextInt(); int cnt = 0; cnt += Math.max(0, a[0]-x); //First element int current = a[0]-cnt; for (int i = 1; i < n; i++) { int temp = cnt; cnt += Math.max(0, current+a[i]-x); current = a[i]-(cnt-temp); } System.out.println(cnt); } }
Main.java:3: error: class VJ397313A is public, should be declared in a file named VJ397313A.java public class VJ397313A { ^ 1 error
s019702477
p03864
C
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main(void){ int num_box; int limit; int *num_C; scanf("%d %d",&num_box,&limit); num_C=(int *)malloc(sizeof(int)*num_box); for(int i=0;i<num_box;i++) scanf("%d",&num_C); int ans=0; if(num_C[0]>limit) { ans=num_C[0]-limit; num_C[0]=limit; } for(int i=1;i<num_box;i++){ int sub_sum=num_C[i-1]+num_C[i]; if(sub_sum>limit){ ans+=sub_sum-limit; num_C[i]-=sub_sum-limit; } } pritnf("%d\n",ans); return 0; }
main.c: In function 'main': main.c:33:5: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration] 33 | pritnf("%d\n",ans); | ^~~~~~ | printf
s500374531
p03864
C++
#include <bits/stdc++.h> using namespace::std; #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() typedef long long ll; typedef array<int, 3> tri; typedef long double ld; template <class T> istream& operator>>(istream& I, vector<T>& v) {for (T &e: v) I >> e; return I;} template <class T> ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;} void _main() { int n, x; cin >> n >> x; vector<int> a(n); cin >> a; ll ans = 0; for (int i = ; i + 1 < n; i++) { if(a[i] + a[i + 1] > x) { int temp = a[i] + a[i + 1] - x; ans += temp, a[i + 1] -= temp; } } cout << ans; } signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen("input.txt", "r", stdin); int _t = 1; // cin >> _t; while (_t--) _main(); return 0; }
a.cc: In function 'void _main()': a.cc:21:22: error: expected primary-expression before ';' token 21 | for (int i = ; i + 1 < n; i++) { | ^
s318339599
p03864
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define mp make_pair #define pb push_back #define pi pair<ll,ll> #define ff first #define ss second #define MAX 100005 const ll MOD = 1000000007; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int t=1; //cin>>t; while(t--){ ll n,x; cin>>n>>x; ll sum=0; ll a[n]; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=2;i<=n;i++) { ll t=a[i]+a[i-1]; if(t<=x) continue; t-=x; sum+=t; //ll mintake=min(a[i],t); a[i]-=t; } cout<<sum<<endl; } }#include <bits/stdc++.h> using namespace std; typedef long long ll; #define mp make_pair #define pb push_back #define pi pair<ll,ll> #define ff first #define ss second #define MAX 100005 const ll MOD = 1000000007; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int t=1; //cin>>t; while(t--){ ll n,x; cin>>n>>x; ll sum=0; ll a[n]; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=2;i<=n;i++) { ll t=a[i]+a[i-1]; if(t<=x) continue; t-=x; sum+=t; //ll mintake=min(a[i],t); a[i]-=t; } cout<<sum<<endl; } }
a.cc:37:2: error: stray '#' in program 37 | }#include <bits/stdc++.h> | ^ a.cc:37:3: error: 'include' does not name a type 37 | }#include <bits/stdc++.h> | ^~~~~~~ a.cc:47:10: error: redefinition of 'const ll MOD' 47 | const ll MOD = 1000000007; | ^~~ a.cc:11:10: note: 'const ll MOD' previously defined here 11 | const ll MOD = 1000000007; | ^~~ a.cc:49:5: error: redefinition of 'int main()' 49 | int main(){ | ^~~~ a.cc:13:5: note: 'int main()' previously defined here 13 | int main(){ | ^~~~
s099041738
p03864
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define mp make_pair #define pb push_back #define pi pair<ll,ll> #define ff first #define ss second #define MAX 100005 const ll MOD = 1000000007; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int t=1; //cin>>t; while(t--){ ll n,x; cin>>n>>x; ll sum=0; ll a[n]; for(itn i=1;i<=n;i++) cin>>a[i]; for(int i=2;i<=n;i++) { ll t=a[i]+a[i-1]; if(t<=x) continue; t-=x; sum+=t; ll mintake=min(a[i],t); a[i]-=mintake; } cout<<sum<<endl; } }
a.cc: In function 'int main()': a.cc:23:14: error: 'itn' was not declared in this scope; did you mean 'int'? 23 | for(itn i=1;i<=n;i++) cin>>a[i]; | ^~~ | int a.cc:23:22: error: 'i' was not declared in this scope 23 | for(itn i=1;i<=n;i++) cin>>a[i]; | ^
s352691202
p03864
C++
// https://atcoder.jp/contests/arc064/tasks/arc064_a #include <bits/stdc++.h> using namespace std; #define watch(x) cerr << (#x) << " is " << (x) << endl; #define int long long #define endl '\n' signed main() { ios::sync_with_stdio(0); cin.sync_with_stdio(0); cin.tie(0); int N, x; cin >> N >> x; vector<int> a(N+5); for(int i = 1; i <= N; i++) { cin >> a[i]; } int ans = 0; for(int i = 1; i <= N; i++) { ans += max(0, (a[i]+a[i-1])-x); a[i] -= max(0, (a[i]+a[i-1])-x); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:24:19: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)' 24 | ans += max(0, (a[i]+a[i-1])-x); | ~~~^~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:3: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:24:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}) 24 | ans += max(0, (a[i]+a[i-1])-x); | ~~~^~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:24:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 24 | ans += max(0, (a[i]+a[i-1])-x); | ~~~^~~~~~~~~~~~~~~~~~~~ a.cc:25:20: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)' 25 | a[i] -= max(0, (a[i]+a[i-1])-x); | ~~~^~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:25:20: note: deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}) 25 | a[i] -= max(0, (a[i]+a[i-1])-x); | ~~~^~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:25:20: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 25 | a[i] -= max(0, (a[i]+a[i-1])-x); | ~~~^~~~~~~~~~~~~~~~~~~~