submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s841707192
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
string sa,sb,sc;
cin >> sa >> sb >> sc;
reverse(sa.begin(),sa.end());
reverse(sb.begin(),sb.end());
reverse(sc.begin(),sc.end());
char next='a';
while(!(sa.length()==0 || sb.length()==0 sc.length()==0)){
if(next=='a'){
next=sa[sa.length()-1];
sa.pop_back();
}
if(next=='b'){
next=sb[sb.length()-1];
sb.pop_back();
}
if(next=='c'){
next=sc[sc.length()-1];
sc.pop_back();
}
}
if(sa.length()==0)cout << 'A' << endl;
if(sb.length()==0)cout << 'B' << endl;
if(sc.length()==0)cout << 'C' << endl;
}
|
a.cc: In function 'int main()':
a.cc:11:43: error: expected ')' before 'sc'
11 | while(!(sa.length()==0 || sb.length()==0 sc.length()==0)){
| ~ ^~~
| )
a.cc:24:4: error: expected ')' before 'if'
24 | }
| ^
| )
25 | if(sa.length()==0)cout << 'A' << endl;
| ~~
a.cc:11:8: note: to match this '('
11 | while(!(sa.length()==0 || sb.length()==0 sc.length()==0)){
| ^
|
s320163600
|
p03998
|
C++
|
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int main() {
string SA, SB, SC;
cin >> SA >> SB >> SC;
int SAL = SA.size();
int SBL = SB.size();
int SCL = SC.size();
int x = 0; y = 0; z = 0;
int winA = 0; winB = 0; winC = 0;
char next = 'a';
while(1) {
if(next == 'a') {
x++;
if(SAL < x) {
winA = 1;
break;
}
next = SA[x-1];
}
else if(next == 'b') {
y++;
if(SBL < y) {
winB = 1;
break;
}
next = SB[y-1];
}
else if(next == 'c') {
z++;
if(SCL < z) {
winC = 1;
break;
}
next = SC[z-1];
}
}
if(winA == 1) {
cout << 'A';
}
else if(winB == 1) {
cout << 'B';
}
else if(winC == 1) {
cout << 'C';
}
cout << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:17: error: 'y' was not declared in this scope
17 | int x = 0; y = 0; z = 0;
| ^
a.cc:17:25: error: 'z' was not declared in this scope
17 | int x = 0; y = 0; z = 0;
| ^
a.cc:18:19: error: 'winB' was not declared in this scope; did you mean 'winA'?
18 | int winA = 0; winB = 0; winC = 0;
| ^~~~
| winA
a.cc:18:29: error: 'winC' was not declared in this scope; did you mean 'winA'?
18 | int winA = 0; winB = 0; winC = 0;
| ^~~~
| winA
|
s502682061
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
//vector…可変長、データの大きさに合わせてサイズを変える
//list…双方向リスト、要素を挿入、削除の多いとき
//forward_list
//array…固定長配列
//set…集合
//multiset
//bitset…2進数、固定長ビット列
//map…連想配列、キーと値を関連付ける
//multimap
//deque
//stack…FILO
//queue…FIFO
//priority_queue…格納された最大値から順に取り出す
//pair…二つの値を一組
//tuple…複数の値を一組
template<typename T>
void remove(std::vector<T>& vector, char index) {
vector.erase(vector.begin() + index);
}
template<class T>
T ma(std::vector<T> &v) {
T maxi = 0;
for(auto &i:v) maxi = max(maxi, i);
return maxi;
}
template<class T>
T mi(std::vector<T> &v) {
T mini = 0;
for(auto &i:v) mini = min(mini, i);
return mini;
}
template <class T>
T pow(T x, T y, T n = numeric_limits<T>::max()) {
if(y == 0) return 1;
if(y % 2 == 0) return pow((x * x) % n, y / 2);
return (x * pow(x, y - 1)) % n;
}
#define rep(i, n, m) for (int i = n; i <= m; i++)
#define Rep(i, n, m) for (int i = m; i >= 1; i--)
typedef long long ll;
typedef unsigned long long ull;
/*
int gcd(int x, int y) {
if (x < y) swap(x, y);
return !y ? x : gcd(x % y, y);
}
*/
int main() {
vector<string> C(3);
rep(i, 0, 2) cin >> C[i];
int i = 0;
do {
j = C[i].front() - 'a';
C[i].erase(C[i].begin());
if (C[i].empty()) {
break;
}
i = j;
} while (true);
switch (i) {
case 0:
cout << 'A' << endl;
return 0;
case 1:
cout << 'B' << endl;
return 0;
case 2:
cout << 'C' << endl;
return 0;
}
}
|
a.cc: In function 'int main()':
a.cc:64:9: error: 'j' was not declared in this scope
64 | j = C[i].front() - 'a';
| ^
|
s713751455
|
p03998
|
C++
|
using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
string a,b,c;
cin>>a>>b>>c;
char scan ='a';
int cnt1=1,cnt2=0,cnt3=0;
if(a=='a'){
cout<<'A'<<endl;
return 0;
}
rep(i,a.size()+b.size()+c.size()){
if(scan=='a'){
scan=a[cnt1];
cnt1++;
if(cnt1==a.size()){
cout<<'A'<<endl;
return 0;
}
}
if(scan=='b'){
scan=b[cnt2];
cnt2++;
if(cnt2==b.size()){
cout<<'B'<<endl;
return 0;
}
}
if(scan=='c'){
scan=c[cnt3];
cnt3++;
if(cnt3==c.size()){
cout<<'C'<<endl;
return 0;
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:27:7: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
27 | if(a=='a'){
| ~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:2:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
27 | if(a=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
27 | if(a=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
27 | if(a=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
27 | if(a=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
27 | if(a=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
27 | if(a=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
27 | if(a=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
27 | if(a=='a'){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
27 | if(a=='a'){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
27 | if(a=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
27 | if(a=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
27 | if(a=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
27 | if(a=='a'){
| ^~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
27 | if(a=='a'){
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
27 | if(a=='a'){
| ^~~
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:629: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> >)'
629 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed:
a.cc:27:9: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
27 | if(a=='a'){
| ^~~
/usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
637 | operator==(basic_string_vie
|
s340091049
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
vector<string> s(3);
for(auto&& u:s)cin>>u;
vector<int> t(3,0);
// rep(i,3)t[i]=s[i].size();
int x=0;
while(t[x]<s[x].size()){
t[x]++;
c=s[x][t[x]-1];
}
cout<<"ABC"[x]<<endl;
}
|
a.cc: In function 'int main()':
a.cc:14:3: error: 'c' was not declared in this scope
14 | c=s[x][t[x]-1];
| ^
|
s721171338
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector <string> A;
vector <string> B;
vector <string> C;
cin >> A >> B >> C;
char next = 'A', winner;
while(true) {
if(next == 'A') {
next = A.front();
A.erase(A.begin());
if(A.size() == 0) {
winner = 'A';
break;
}
} else if(next == 'B') {
next = B.front();
B.erase(B.begin());
if(B.size() == 0) {
winner = 'B';
break
}
} else {
next = C.front();
C.erase(C.begin());
if(C.size() == 0) {
winner = 'C';
break;
}
}
}
cout << winner << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
8 | cin >> A >> B >> C;
| ~~~ ^~ ~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _
|
s728090422
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector <string> A, B, C;
cin >> A >> B >> C;
char next = 'A', winner;
while(true) {
if(next == 'A') {
next = A.front();
A.erase(A.begin());
if(A.size() == 0) {
winner = 'A';
break;
}
} else if(next == 'B') {
next = B.front();
B.erase(B.begin());
if(B.size() == 0) {
winner = 'B';
break
}
} else {
next = C.front();
C.erase(C.begin());
if(C.size() == 0) {
winner = 'C';
break;
}
}
}
cout << winner << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
6 | cin >> A >> B >> C;
| ~~~ ^~ ~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _
|
s266496026
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(void){
string s[3];
cin>>s[0]>>s[1]>>s[2];
int p[3]={},q=0;
while(p[q]!=s[q].size()){
p[q]++;
q=s[q][p[q]-1]-'a';
}
cout<<(char)('A'+q)<<enld;
}
|
a.cc: In function 'int main()':
a.cc:12:24: error: 'enld' was not declared in this scope
12 | cout<<(char)('A'+q)<<enld;
| ^~~~
|
s704093794
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
char a[110],b[110],c[110];
int ax=0,bx=-1,cx=-1;
char cc;
int main()
{
gets(a);
gets(b);
gets(c);
cc=a[ax];
while(1)
{
if(cc=='a')
{
ax++;
if(a[ax]=='\0')
{
cout<<"A";
return 0;
}
cc=a[ax];
}
else
{
if(cc=='b')
{
bx++;
if(b[bx]=='\0')
{
cout<<"B";
return 0;
}
cc=b[bx];
}
else if(cc=='c')
{
cx++;
if(c[cx]=='\0')
{
cout<<"C";
return 0;
}
cc=c[cx];
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(a);
| ^~~~
| getw
|
s199167624
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
char a[110],b[110],c[110];
int ax=0,bx=-1,cx=-1;
char cc;
int main()
{
gets(a);
gets(b);
gets(c);
cc=a[ax];
while(1)
{
if(cc=='a')
{
ax++;
if(a[ax]=='\0')
{
cout<<"A";
return 0;
}
cc=a[ax];
}
else
{
if(cc=='b')
{
bx++;
if(b[bx]=='\0')
{
cout<<"B";
return 0;
}
cc=b[bx];
}
else if(cc=='c')
{
cx++;
if(c[cx]=='\0')
{
cout<<"C";
return 0;
}
cc=c[cx];
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(a);
| ^~~~
| getw
|
s393270378
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
string SA,SB,SC,S;
cin>>SA>>SB>>SC;
S=SA;
for(int i=0;i<1000;i++){
if(S.at(i)=='a'){
if(SA.size()>0){
SA.erase(SA.begin()+0)
S=SA;
continue;
}
if(SA.size()==0){
cout<<'A'<<endl;
break;
}
}
if(S.at(i)=='b'){
if(SB.size()>0){
SB.erase(SB.begin()+0)
S=SB;
continue;
}
if(SB.size()==0){
cout<<'B'<<endl;
break;
}
}
if(S.at(i)=='c'){
if(SC.size()>0){
SC.erase(SC.begin()+0)
S=SC;
continue;
}
if(SC.size()==0){
cout<<'C'<<endl;
break;
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:11:37: error: expected ';' before 'S'
11 | SA.erase(SA.begin()+0)
| ^
| ;
12 | S=SA;
| ~
a.cc:23:37: error: expected ';' before 'S'
23 | SB.erase(SB.begin()+0)
| ^
| ;
24 | S=SB;
| ~
a.cc:35:37: error: expected ';' before 'S'
35 | SC.erase(SC.begin()+0)
| ^
| ;
36 | S=SC;
| ~
|
s500803144
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
string SA,SB,SC.S;
cin>>SA>>SB>>SC;
S=SA
for(int i=0;i<1000;i++){
if(S.at(i)=='a'){
if(SA.size()>0){
SA.erase(SA.begin()+0)
S=SA;
continue;
}
if(SA.size()==0){
cout<<'A'<<endl;
break;
}
}
if(S.at(i)=='b'){
if(SB.size()>0){
SB.erase(SB.begin()+0)
S=SB;
continue;
}
if(SB.size()==0){
cout<<'B'<<endl;
break;
}
}
if(S.at(i)=='c'){
if(SC.size()>0){
SC.erase(SC.begin()+0)
S=SC;
continue;
}
if(SC.size()==0){
cout<<'C'<<endl;
break;
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:5:24: error: expected initializer before '.' token
5 | string SA,SB,SC.S;
| ^
a.cc:6:18: error: 'SC' was not declared in this scope; did you mean 'SB'?
6 | cin>>SA>>SB>>SC;
| ^~
| SB
a.cc:7:5: error: 'S' was not declared in this scope; did you mean 'SB'?
7 | S=SA
| ^
| SB
a.cc:8:17: error: 'i' was not declared in this scope
8 | for(int i=0;i<1000;i++){
| ^
|
s300815066
|
p03998
|
C++
|
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
string A,B,C; cin >> A >> B >> C;
char x = A[0];
while()
{ if(x == 'a'){
if( A.size() == 0){ cout << 'A' << endl; return 0;}
x = A[0]; A = A.substr(1,A.size() - 1);}
else if(x == 'b'){
if(B.size() == 0){ cout << 'B' << endl; return 0;}
x = B[0]; B = B.substr(1,B.size() - 1);}
else if(x == 'c'){
if(C.size() == 0){ cout << 'C' << endl; return 0;}
x = C[0]; C = C.substr(1,C.size() - 1);}
}
}
|
a.cc: In function 'int main()':
a.cc:13:9: error: expected primary-expression before ')' token
13 | while()
| ^
|
s565912423
|
p03998
|
C++
|
int main(){
string A,B,C;
cin>>A>>B>>C;
char c=A[0];
A.erase(0,1);
while(1){
if(c=='a'){
if(A.size()==0){
cout<<'A'<<endl;
return 0;
}
c=A[0]; A.erase(0,1);
}else if(c=='b'){
if(B.size()==0){
cout<<'B'<<endl;
return 0;
}
c=B[0]; B.erase(0,1);
}else{
if(C.size()==0){
cout<<'C'<<endl;
return 0;
}
c=C[0]; C.erase(0,1);
}
}
}
|
a.cc: In function 'int main()':
a.cc:2:3: error: 'string' was not declared in this scope
2 | string A,B,C;
| ^~~~~~
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin>>A>>B>>C;
| ^~~
a.cc:3:8: error: 'A' was not declared in this scope
3 | cin>>A>>B>>C;
| ^
a.cc:3:11: error: 'B' was not declared in this scope
3 | cin>>A>>B>>C;
| ^
a.cc:3:14: error: 'C' was not declared in this scope
3 | cin>>A>>B>>C;
| ^
a.cc:9:9: error: 'cout' was not declared in this scope
9 | cout<<'A'<<endl;
| ^~~~
a.cc:9:20: error: 'endl' was not declared in this scope
9 | cout<<'A'<<endl;
| ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope
15 | cout<<'B'<<endl;
| ^~~~
a.cc:15:20: error: 'endl' was not declared in this scope
15 | cout<<'B'<<endl;
| ^~~~
a.cc:21:9: error: 'cout' was not declared in this scope
21 | cout<<'C'<<endl;
| ^~~~
a.cc:21:20: error: 'endl' was not declared in this scope
21 | cout<<'C'<<endl;
| ^~~~
|
s965850994
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
string sa,sb,sc;
cin >> sa >> sb >> sc;
int turn=0;
while(1){
if(turn == 0){
if(sa.size() == 0) break;
char a = sa.at(0);
sa.erase(sa.begin + 0);
if(a == 'b'){
turn = 1;
}else if(a == 'c'){
turn = 2;
}
}else if(turn == 1){
if(sb.size() == 0) break;
char a = sb.at(0);
sb.erase(sb.begin + 0);
if(a == 'a'){
turn = 0;
}else if(a == 'c'){
turn = 2;
}
}else if(turn == 2){
if(sc.size() == 0) break;
char a = sc.at(0);
sc.erase(sc.begin + 0);
if(a == 'a'){
turn = 0;
}else if(a == 'b'){
turn = 1;
}
}
}
if(turn == 0){
cout << 'A' << endl;
}else if(turn == 1){
cout << 'B' << endl;
}else if(turn == 2){
cout << 'C' << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:13:25: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
13 | sa.erase(sa.begin + 0);
| ~~~~~~~~ ^ ~
| | |
| | int
| <unresolved overloaded function type>
a.cc:22:25: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
22 | sb.erase(sb.begin + 0);
| ~~~~~~~~ ^ ~
| | |
| | int
| <unresolved overloaded function type>
a.cc:31:25: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
31 | sc.erase(sc.begin + 0);
| ~~~~~~~~ ^ ~
| | |
| | int
| <unresolved overloaded function type>
|
s572750417
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
string a,b,c;
void charlie_chance()
{
if(c.empty())
{cout<<"C\n";return;}
c.pop_back();
switch(c[c.size()-1])
{
case 'a': alice_chance(); break;
case 'b' : bob_chance(); break;
case 'c' : charlie_chance(); break;
}
}
void bob_chance()
{
if(b.empty())
{cout<<"B\n";return;}
b.pop_back();
switch(b[b.size()-1])
{
case 'a': alice_chance(); break;
case 'b' : bob_chance(); break;
case 'c' : charlie_chance(); break;
}
}
void alice_chance()
{
if(a.empty())
{cout<<"A\n";return;}
a.pop_back();
switch(a[a.size()-1])
{
case 'a': alice_chance(); break;
case 'b' : bob_chance(); break;
case 'c' : charlie_chance(); break;
}
}
int main()
{
cin>>a>>b>>c;
alice_chance();
return 0;
}
|
a.cc: In function 'void charlie_chance()':
a.cc:11:15: error: 'alice_chance' was not declared in this scope; did you mean 'charlie_chance'?
11 | case 'a': alice_chance(); break;
| ^~~~~~~~~~~~
| charlie_chance
a.cc:12:16: error: 'bob_chance' was not declared in this scope
12 | case 'b' : bob_chance(); break;
| ^~~~~~~~~~
a.cc: In function 'void bob_chance()':
a.cc:24:15: error: 'alice_chance' was not declared in this scope; did you mean 'charlie_chance'?
24 | case 'a': alice_chance(); break;
| ^~~~~~~~~~~~
| charlie_chance
|
s584392629
|
p03998
|
C++
|
ci++;
}
}
if ( len_a < 0 ) cout << "A\n";
else if ( len_b< 0 ) cout << "B/n";
else cout << "C\n";
return 0;
}
|
a.cc:1:7: error: 'ci' does not name a type
1 | ci++;
| ^~
a.cc:2:5: error: expected declaration before '}' token
2 | }
| ^
a.cc:3:3: error: expected declaration before '}' token
3 | }
| ^
a.cc:5:3: error: expected unqualified-id before 'if'
5 | if ( len_a < 0 ) cout << "A\n";
| ^~
a.cc:6:3: error: expected unqualified-id before 'else'
6 | else if ( len_b< 0 ) cout << "B/n";
| ^~~~
a.cc:7:3: error: expected unqualified-id before 'else'
7 | else cout << "C\n";
| ^~~~
a.cc:9:3: error: expected unqualified-id before 'return'
9 | return 0;
| ^~~~~~
a.cc:11:1: error: expected declaration before '}' token
11 | }
| ^
|
s076371657
|
p03998
|
C++
|
#include <iostream>
using namespace std;
int main(){
string s[3];
cin >> s[0] >> s[1] >> s[2];
int n[3],t[3];
for(int i=0;i<3;i++) n[i]=s[i].size(); t[i]=s[i].size();
int now=0;
while(n[0]&&n[1]&&n[2]){
n[now]--;
if(s[now].at(t[now]-n[now]-1)=='a') now=0;
else if(s[now].at(t[now]-n[now]-1)=='b') now=1;
else now=2;
}
if(now==0) cout << "A" << endl;
else if(now==1) cout << "B" << endl;
else cout << "C" << endl;
}
|
a.cc: In function 'int main()':
a.cc:8:44: error: 'i' was not declared in this scope
8 | for(int i=0;i<3;i++) n[i]=s[i].size(); t[i]=s[i].size();
| ^
|
s876699232
|
p03998
|
C++
|
#include <iostream>
using namespace std;
int main(){
string s[3];
cin >> s[0] >> s[1] >> s[2];
int n[3],t[3]
for(int i=0;i<3;i++) n[i]=s[i].size(); t[i]=s[i].size();
int now=0;
while(n[0]&&n[1]&&n[2]){
n[now]--;
if(s[now].at(t[now]-n[now]-1)=='a') now=0;
else if(s[now].at(t[now]-n[now]-1)=='b') now=1;
else now=2;
}
if(now==0) cout << "A" << endl;
else if(now==1) cout << "B" << endl;
else cout << "C" << endl;
}
|
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'for'
8 | for(int i=0;i<3;i++) n[i]=s[i].size(); t[i]=s[i].size();
| ^~~
a.cc:8:15: error: 'i' was not declared in this scope
8 | for(int i=0;i<3;i++) n[i]=s[i].size(); t[i]=s[i].size();
| ^
a.cc:8:42: error: 't' was not declared in this scope
8 | for(int i=0;i<3;i++) n[i]=s[i].size(); t[i]=s[i].size();
| ^
|
s150506860
|
p03998
|
C++
|
#include <iostream>
using namespace std;
int main(){
string s[3]
cin >> s[0] >> s[1] >> s[2];
int n[3],t[3]
for(int i=0;i<3;i++) n[i]=s[i].size(); t[i]=s[i].size();
int now=0;
while(n[0]&&n[1]&&n[2]){
n[now]--;
if(s[now].at(t[now]-n[now]-1)=='a') now=0;
else if(s[now].at(t[now]-n[now]-1)=='b') now=1;
else now=2;
}
if(now==0) cout << "A" << endl;
else if(now==1) cout << "B" << endl;
else cout << "C" << endl;
}
|
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
6 | cin >> s[0] >> s[1] >> s[2];
| ^~~
a.cc:8:3: error: expected initializer before 'for'
8 | for(int i=0;i<3;i++) n[i]=s[i].size(); t[i]=s[i].size();
| ^~~
a.cc:8:15: error: 'i' was not declared in this scope
8 | for(int i=0;i<3;i++) n[i]=s[i].size(); t[i]=s[i].size();
| ^
a.cc:8:42: error: 't' was not declared in this scope
8 | for(int i=0;i<3;i++) n[i]=s[i].size(); t[i]=s[i].size();
| ^
a.cc:8:47: error: 's' was not declared in this scope
8 | for(int i=0;i<3;i++) n[i]=s[i].size(); t[i]=s[i].size();
| ^
|
s514748388
|
p03998
|
C++
|
#include <iostream>
using namespace std;
int main(){
string a,b,c;
int a_count = 0;
int b_count = 0;
int c_count = 0;
char turn = 'a';
cin >> a >> b >> c;
while(true){
if(turn == 'a'){
if(a_count == a.length()-1){
cout >> "A" >> endl;
break;
}
turn = a[a_count];
a_count++;
}else if(turn == 'b'){
if(b_count == b.length()-1){
cout >> "B" >> endl;
break;
}
turn = b[b_count];
b_count++;
}else{
if(c_count == c.length()-1){
cout >> "C" >> endl;
break;
}
turn = c[c_count];
c_count++;
}
}
}
|
a.cc: In function 'int main()':
a.cc:16:22: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]')
16 | cout >> "A" >> endl;
| ~~~~ ^~ ~~~
| | |
| | const char [2]
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/string:55,
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:2:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:16:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
16 | cout >> "A" >> endl;
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:16:17: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
16 | cout >> "A" >> endl;
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:16:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
16 | cout >> "A" >> endl;
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:16:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
16 | cout >> "A" >> endl;
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:16:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
16 | cout >> "A" >> endl;
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:16:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
16 | cout >> "A" >> endl;
| ^~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:16:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
16 | cout >> "A" >> endl;
| ^~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:16:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
16 | cout >> "A" >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = const char (&)[2]]':
a.cc:16:25: required from here
16 | cout >> "A" >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
a.cc:23:22: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]')
23 | cout >> "B" >> endl;
| ~~~~ ^~ ~~~
| | |
| | const char [2]
| std::ostream {aka std::basic_ostream<char>}
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:23:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
23 | cout >> "B" >> endl;
| ^~~
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:23:17: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
23 | cout >> "B" >> endl;
| ^~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:23:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
23 | cout >> "B" >> endl;
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:23:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
23 | cout >> "B" >> endl;
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:23:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
23 | cout >> "B" >> endl;
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:23:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
|
s331606099
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
string S[3];
cin >> S[0] >> S[1] >> S[2];
int now = 0;
while(1){
if(S[now].size() == 0){
printf("%c\n", (char)((int)'a' + now));
return 0;
}
else{
now = S[now][S[now].size() - 1] - (int)'a';
S[now].pop_buck();
}
}
}
|
a.cc: In function 'int main()':
a.cc:15:32: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_buck'; did you mean 'pop_back'?
15 | S[now].pop_buck();
| ^~~~~~~~
| pop_back
|
s470168007
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int play (int X, string a, string b, string c, string A, string B, stringC) {
if (X == a) {
X = A[1];
A.erase[1];
if (A.size() == 0) {
cout << A << endl;
break;
}
}
if (X == b) {
X = B[1];
B.erase[1];
if (B.size() == 0) {
cout << B << endl;
break;
}
}
if (X == c) {
X = C[1];
C.erase[1];
if (C.size() == 0) {
cout << C << endl;
break;
}
}
play();
return X;
}
int main() {
string A, B, C;
cin >> A >> B >> C;
A.erase[1];
X = a;
play();
return 0;
}
|
a.cc:4:68: error: 'stringC' has not been declared
4 | int play (int X, string a, string b, string c, string A, string B, stringC) {
| ^~~~~~~
a.cc: In function 'int play(int, std::string, std::string, std::string, std::string, std::string, int)':
a.cc:5:9: error: no match for 'operator==' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
5 | if (X == a) {
| ~ ^~ ~
| | |
| int std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::__cxx11::match_results<_BiIter, _Alloc>' and 'int'
5 | if (X == a) {
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
5 | if (X == a) {
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
5 | if (X == a) {
| ^
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::fpos<_StateT>' and 'int'
5 | if (X == a) {
| ^
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::allocator<_CharT>' and 'int'
5 | if (X == a) {
| ^
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:629: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> >)'
629 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
637 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed:
a.cc:5:12: not
|
s538830087
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int play (int X, string a, b, c, A, B, C) {
if (X == a) {
X = A[1];
A.erase[1];
if (A.size() == 0) {
cout << A << endl;
break;
}
}
if (X == b) {
X = B[1];
B.erase[1];
if (B.size() == 0) {
cout << B << endl;
break;
}
}
if (X == c) {
X = C[1];
C.erase[1];
if (C.size() == 0) {
cout << C << endl;
break;
}
}
play();
return X;
}
int main() {
string A, B, C;
cin >> A >> B >> C;
A.erase[1];
X = a;
play();
return 0;
}
|
a.cc:4:28: error: 'b' has not been declared
4 | int play (int X, string a, b, c, A, B, C) {
| ^
a.cc:4:31: error: 'c' has not been declared
4 | int play (int X, string a, b, c, A, B, C) {
| ^
a.cc:4:34: error: 'A' has not been declared
4 | int play (int X, string a, b, c, A, B, C) {
| ^
a.cc:4:37: error: 'B' has not been declared
4 | int play (int X, string a, b, c, A, B, C) {
| ^
a.cc:4:40: error: 'C' has not been declared
4 | int play (int X, string a, b, c, A, B, C) {
| ^
a.cc: In function 'int play(int, std::string, int, int, int, int, int)':
a.cc:5:9: error: no match for 'operator==' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
5 | if (X == a) {
| ~ ^~ ~
| | |
| int std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::__cxx11::match_results<_BiIter, _Alloc>' and 'int'
5 | if (X == a) {
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
5 | if (X == a) {
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
5 | if (X == a) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
5 | if (X == a) {
| ^
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::fpos<_StateT>' and 'int'
5 | if (X == a) {
| ^
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'const std::allocator<_CharT>' and 'int'
5 | if (X == a) {
| ^
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:629: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> >)'
629 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed:
a.cc:5:12: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and
|
s627639274
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int play (int X) {
if (X == a) {
X = A[1];
A.erase[1];
if (A.size() == 0) {
cout << A << endl;
break;
}
}
if (X == b) {
X = B[1];
B.erase[1];
if (B.size() == 0) {
cout << B << endl;
break;
}
}
if (X == c) {
X = C[1];
C.erase[1];
if (C.size() == 0) {
cout << C << endl;
break;
}
}
play(X);
return X;
}
int main() {
string A, B, C;
cin >> A >> B >> C;
A.erase[1];
X = a;
play(X);
return 0;
}
|
a.cc: In function 'int play(int)':
a.cc:5:12: error: 'a' was not declared in this scope
5 | if (X == a) {
| ^
a.cc:6:9: error: 'A' was not declared in this scope
6 | X = A[1];
| ^
a.cc:10:7: error: break statement not within loop or switch
10 | break;
| ^~~~~
a.cc:13:12: error: 'b' was not declared in this scope
13 | if (X == b) {
| ^
a.cc:14:9: error: 'B' was not declared in this scope
14 | X = B[1];
| ^
a.cc:18:7: error: break statement not within loop or switch
18 | break;
| ^~~~~
a.cc:21:14: error: 'c' was not declared in this scope
21 | if (X == c) {
| ^
a.cc:22:9: error: 'C' was not declared in this scope
22 | X = C[1];
| ^
a.cc:26:7: error: break statement not within loop or switch
26 | break;
| ^~~~~
a.cc: In function 'int main()':
a.cc:36:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
36 | A.erase[1];
| ^
a.cc:37:3: error: 'X' was not declared in this scope
37 | X = a;
| ^
a.cc:37:7: error: 'a' was not declared in this scope
37 | X = a;
| ^
|
s965366587
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int X;
int play(X) {
if (X == a) {
X = A[1];
A.erase[1];
if (A.size() == 0) {
cout << A << endl;
break;
}
}
if (X == b) {
X = B[1];
B.erase[1];
if (B.size() == 0) {
cout << B << endl;
break;
}
}
if (X == c) {
X = C[1];
C.erase[1];
if (C.size() == 0) {
cout << C << endl;
break;
}
}
play(X);
}
int main() {
string A, B, C;
cin >> A >> B >> C;
A.erase[1];
X = a;
play(X);
return 0;
}
|
a.cc:4:13: error: expected ',' or ';' before '{' token
4 | int play(X) {
| ^
a.cc: In function 'int main()':
a.cc:36:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
36 | A.erase[1];
| ^
a.cc:37:7: error: 'a' was not declared in this scope
37 | X = a;
| ^
a.cc:38:7: error: 'play' cannot be used as a function
38 | play(X);
| ~~~~^~~
|
s366833361
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int play(X) {
if (X == a) {
X = A[1];
A.erase[1];
if (A.size() == 0) {
cout << A << endl;
break;
}
}
if (X == b) {
X = B[1];
B.erase[1];
if (B.size() == 0) {
cout << B << endl;
break;
}
}
if (X == c) {
X = C[1];
C.erase[1];
if (C.size() == 0) {
cout << C << endl;
break;
}
}
play(X);
}
int main() {
string A, B, C;
cin >> A >> B >> C;
int X;
A.erase[1];
play(a);
return 0;
}
|
a.cc:4:10: error: 'X' was not declared in this scope
4 | int play(X) {
| ^
a.cc: In function 'int main()':
a.cc:37:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
37 | A.erase[1];
| ^
a.cc:39:8: error: 'a' was not declared in this scope
39 | play(a);
| ^
a.cc:39:9: error: 'play' cannot be used as a function
39 | play(a);
| ^
|
s062559877
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int play(X) {
if (X == a) {
X = A[1];
A.erase[1];
if (A.size() == 0) {
cout << A << endl;
break;
}
}
if (X == b) {
X = B[1];
B.erase[1];
if (B.size() == 0) {
cout << B << endl;
break;
}
}
if (X == c) {
X = C[1];
C.erase[1];
if (C.size() == 0) {
cout << C << endl;
break;
}
}
play(X);
}
int main() {
string A, B, C;
cin >> A >> B >> C;
A.erase[1];
play(a);
return 0;
}
|
a.cc:4:10: error: 'X' was not declared in this scope
4 | int play(X) {
| ^
a.cc: In function 'int main()':
a.cc:37:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
37 | A.erase[1];
| ^
a.cc:39:8: error: 'a' was not declared in this scope
39 | play(a);
| ^
a.cc:39:9: error: 'play' cannot be used as a function
39 | play(a);
| ^
|
s648206468
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
vector<string> S(3);
cin >> S[0] >> S[1] >> S[2];
vector<int> index(3, 0);
int next = 0;
while(true){
if(index[next] == S[index].size()){
cout << (char)('A'+index) << endl;
return 0;
}
index[next]++;
next = S[next][index[next]-1] - 'a';
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:24: error: no match for 'operator[]' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and 'std::vector<int>')
10 | if(index[next] == S[index].size()){
| ^
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]'
1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1128:28: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'}
1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; const_reference = const std::__cxx11::basic_string<char>&; size_type = long unsigned int]'
1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1147:28: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'}
1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~^~~
a.cc:11:25: error: no match for 'operator+' (operand types are 'char' and 'std::vector<int>')
11 | cout << (char)('A'+index) << endl;
| ~~~^~~~~~
| | |
| | std::vector<int>
| char
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed:
a.cc:11:26: note: 'std::vector<int>' is not derived from 'const std::reverse_iterator<_Iterator>'
11 | cout << (char)('A'+index) << endl;
| ^~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
1798 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed:
a.cc:11:26: note: 'std::vector<int>' is not derived from 'const std::move_iterator<_IteratorL>'
11 | cout << (char)('A'+index) << endl;
| ^~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed:
a.cc:11:26: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char'
11 | cout << (char)('A'+index) << endl;
| ^~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3616 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed:
a.cc:11:26: note: mismatched types 'const _CharT*' and 'char'
11 | cout << (char)('A'+index) << endl;
| ^~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed:
a.cc:11:26: note: 'std::vector<int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
11 | cout << (char)('A'+index) << endl;
| ^~~~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed:
a.cc:11:26: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char'
11 | cout << (char)('A'+index) << endl;
| ^~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed:
a.cc:11:26: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char'
11 | cout << (char)('A'+index) << endl;
| ^~~~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed:
a.cc:11:26: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char'
11 | cout << (char)('A'+index) << endl;
| ^~~~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed:
a.cc:11:26: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char'
11 | cout << (char)('A'+index) << endl;
| ^~~~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed:
a.cc:11:26: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char'
11 | cout << (char)('A'+index) << endl;
| ^~~~~
/usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3719 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed:
a.cc:11:26: note: mismatched types 'const _CharT*' and 'char'
11 | cout << (char)('A'+index) << endl;
| ^~~~~
/usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3726 | operator+(_CharT __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/sub
|
s972892458
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
string SA, SB, SC;
cin >> SA >> SB >> SC;
char next = SA.pop_front();
while(true){
switch(next){
case 'a':
if(SA.empty()){
cout << 'A' << endl;
return 0;
}
next = SA.pop_front();
break;
case 'b':
if(SB.empty()){
cout << 'B' << endl;
return 0;
}
next = SB.pop_front();
break;
case 'c':
if(SC.empty()){
cout << 'C' << endl;
return 0;
}
next = SC.pop_front();
break;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
7 | char next = SA.pop_front();
| ^~~~~~~~~
a.cc:15:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
15 | next = SA.pop_front();
| ^~~~~~~~~
a.cc:22:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
22 | next = SB.pop_front();
| ^~~~~~~~~
a.cc:29:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
29 | next = SC.pop_front();
| ^~~~~~~~~
|
s333226828
|
p03998
|
Java
|
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.LinkedList;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author dyominov
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
B3CardGameForThreeABCEdit solver = new B3CardGameForThreeABCEdit();
solver.solve(1, in, out);
out.close();
}
static class B3CardGameForThreeABCEdit {
public void solve(int testNumber, InputReader in, PrintWriter out) {
String a = in.next();
String b = in.next();
String c = in.next();
List<Character> listA = new LinkedList<>();
List<Character> listB = new LinkedList<>();
List<Character> listC = new LinkedList<>();
for (char ch : a.toCharArray()) {
listA.add(ch);
}
for (char ch : b.toCharArray()) {
listB.add(ch);
}
for (char ch : c.toCharArray()) {
listC.add(ch);
}
while (true) {
char s = listA.remove(0);
switch (s) {
case 'a': {
if (listC.isEmpty()) {
out.println("A");
return;
}
s = listA.remove(0);
break;
}
case 'b': {
if (listC.isEmpty()) {
out.println("B");
return;
}
s = listB.remove(0);
break;
}
case 'c': {
if (listC.isEmpty()) {
|
Main.java:67: error: reached end of file while parsing
if (listC.isEmpty()) {
^
1 error
|
s237877612
|
p03998
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
string A, B, C;
cin >> A >> B >> C;
char next = 'a';
char ans;
for(;;) {
if(next == 'a') {
next = A.front();
ans = 'A';
if(A.length()) A.pop_front();
else break;
} else if (next == 'b') {
next = B.front();
ans = 'B';
if(B.length()) B.pop_front();
else break;
} else if (next == 'c') {
next = C.front();
ans = 'C';
if(C.length()) C.pop_front();
else break;
} else {
break;
}
}
cout << ans << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:24: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
14 | if(A.length()) A.pop_front();
| ^~~~~~~~~
a.cc:19:24: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
19 | if(B.length()) B.pop_front();
| ^~~~~~~~~
a.cc:24:24: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
24 | if(C.length()) C.pop_front();
| ^~~~~~~~~
|
s029182498
|
p03998
|
C++
|
#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<n;i++)
#define For(i,n1,n2) for(int i=n1;i<n2;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define RREP(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<"\n"
#define all(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
typedef long long ll;
typedef pair<int, int> P;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){if(a<b){a=b;return 1;}return 0;}
int main(){
vector<string> st(3);
REP(i,3){
cin >> st[i];
}
vector<queue<int>> s(3);
REP(i,3){
REP(j,st[i].size()){
s[i].push(st[i][j]-'a');
}
}
int turn = 0;
while(!s[turn].empty()){
int temp = s[turn].pop();
turn = temp;
}
cout << (char)('A'+turn) << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:31:31: error: void value not ignored as it ought to be
31 | int temp = s[turn].pop();
| ~~~~~~~~~~~^~
|
s468104264
|
p03998
|
C++
|
#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<n;i++)
#define For(i,n1,n2) for(int i=n1;i<n2;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define RREP(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<"\n"
#define all(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
typedef long long ll;
typedef pair<int, int> P;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){if(a<b){a=b;return 1;}return 0;}
int main(){
vector<string> st(3);
REP(i,3){
cin >> st[i];
}
vector<queue<int>> s(3);
REP(i,3){
REP(j,st[i].size()){
s[i].push(st[i][j]-'a');
}
}
int turn = 0;
while(!s[turn].empty()){
int temp = s[turn].top();
s[turn].pop();
turn = temp;
}
cout << (char)('A'+turn) << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:31:28: error: '__gnu_cxx::__alloc_traits<std::allocator<std::queue<int> >, std::queue<int> >::value_type' {aka 'class std::queue<int>'} has no member named 'top'; did you mean 'pop'?
31 | int temp = s[turn].top();
| ^~~
| pop
|
s123242753
|
p03998
|
C++
|
#include<iostream>
#include<stdio.h>
#include<cstring>
using namespace std;
int main()
{
char a[110]{}, b[110], c[110];
scanf("%s%s%s", &a, &b, &c);
int al, bl, cl;
al = strlen(a);
bl = strlen(b);
cl = strlen(c);
int ac, bc, cc;
ac = bc = cc = 0;
char temp = a[0];
while (1)
{
if (temp == 'a')
{
++ac;
if (ac == al)
{
cout << "A" << endl;
return 0;
}
temp==a[ac]
}
else if (temp == 'b')
{
++bc;
if (bc == bl)
{
cout << "B" << endl;
return 0;
}
temp == b[bc];
}
else if (temp == 'c')
{
++cc;
if (cc == cl)
{
cout << "C" << endl;
return 0;
}
temp == c[cc];
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:28:36: error: expected ';' before '}' token
28 | temp==a[ac]
| ^
| ;
29 | }
| ~
|
s332265139
|
p03998
|
C++
|
#include<iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<stdio.h>
#include<vector>
#define rep(i,n)for(int i=0;i<n;i++)
//printf("%.yf\n",x); xを小数点以下y桁で
using namespace std;
int main() {
string a, b, c;
cin >> a >> b >> c;
int player = 0;
for (;;) {
if (player == 0) {
if (a.size() == 1) {
cout << "A" << endl;
break;
}
if (a[0] == 'a') {
player = 0;
}
if (a[0] == 'b') {
player = 1;
}
if (a[0] == 'c') {
player = 2;
}
a = a.substr(1, a.size-1);
}if (player == 1) {
if (b.size() == 1) {
cout << "B" << endl;
break;
}
if (b[0] == 'a') {
player = 0;
}
if (b[0] == 'b') {
player = 1;
}
if (b[0] == 'c') {
player = 2;
}
b = b.substr(1, b.size - 1);
}if (player == 2) {
if (c.size() == 1) {
cout << "C" << endl;
break;
}
if (c[0] == 'a') {
player = 0;
}
if (c[0] == 'b') {
player = 1;
}
if (c[0] == 'c') {
player = 2;
}
c = c.substr(1, c.size - 1);
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:29:43: 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 '()' ?)
29 | a = a.substr(1, a.size-1);
| ~~^~~~
| ()
a.cc:44:43: 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 '()' ?)
44 | b = b.substr(1, b.size - 1);
| ~~^~~~
| ()
a.cc:60:43: 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 '()' ?)
60 | c = c.substr(1, c.size - 1);
| ~~^~~~
| ()
|
s022644707
|
p03998
|
C++
|
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
bool prime(int n){
if(n==1){
return false;
}else if(n==2){
return true;
}else{
for(int i=2;i<=sqrt(n);i++){
if(n%i==0){
return false;
}
}
return true;
}
}
long long gcd(long long a, long long b){
if(a<b){
swap(a,b);
}
if(a%b==0){
return b;
}else{
return gcd(b,a%b);
}
}
long long lcm(long long x, long long y){
return (x/gcd(x,y))*y;
}
class UnionFind {
public:
//各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
vector<int> Parent;
//クラスを作るときは、Parentの値を全て-1にする。
//以下のようにすると全てバラバラの頂点として解釈できる。
UnionFind(int N) {
Parent = vector<int>(N, -1);
}
//Aがどのグループに属しているか調べる
int root(int A) {
if (Parent[A] < 0) return A;
return Parent[A] = root(Parent[A]);
}
//自分のいるグループの頂点数を調べる
int size(int A) {
return -Parent[root(A)];//先祖をrootで取っておきたい。
}
//AとBをくっ付ける
bool connect(int A, int B) {
//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
A = root(A);
B = root(B);
if (A == B) {
//すでにくっついてるからくっ付けない
return false;
}
//大きい方(A)に小さいほう(B)をくっ付けたい
//大小が逆だったらAとBをひっくり返す。
if (size(A) < size(B)) swap(A, B);
//Aのサイズを更新する
Parent[A] += Parent[B];
//Bの親をAに変更する
Parent[B] = A;
return true;
}
};
int main(){
string s[2];
REP(i,2){
cin>>s[i];
}
int next=0;
char next_char;
while(s[next].size()){
next_char=s[next][0];
erase(s[next].begin(),s[next].begin()+1);
if(next_char=='a'){
next=0;
}else if(next_char=='b'){
next=1;
}else{
next=2;
}
}
if(next==0){
cout<<"A"<<endl;
}else if(next==1){
cout<<"B"<<endl;
}else{
cout<<"C"<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:95:5: error: 'erase' was not declared in this scope
95 | erase(s[next].begin(),s[next].begin()+1);
| ^~~~~
|
s795226088
|
p03998
|
C++
|
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
bool prime(int n){
if(n==1){
return false;
}else if(n==2){
return true;
}else{
for(int i=2;i<=sqrt(n);i++){
if(n%i==0){
return false;
}
}
return true;
}
}
long long gcd(long long a, long long b){
if(a<b){
swap(a,b);
}
if(a%b==0){
return b;
}else{
return gcd(b,a%b);
}
}
long long lcm(long long x, long long y){
return (x/gcd(x,y))*y;
}
class UnionFind {
public:
//各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
vector<int> Parent;
//クラスを作るときは、Parentの値を全て-1にする。
//以下のようにすると全てバラバラの頂点として解釈できる。
UnionFind(int N) {
Parent = vector<int>(N, -1);
}
//Aがどのグループに属しているか調べる
int root(int A) {
if (Parent[A] < 0) return A;
return Parent[A] = root(Parent[A]);
}
//自分のいるグループの頂点数を調べる
int size(int A) {
return -Parent[root(A)];//先祖をrootで取っておきたい。
}
//AとBをくっ付ける
bool connect(int A, int B) {
//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
A = root(A);
B = root(B);
if (A == B) {
//すでにくっついてるからくっ付けない
return false;
}
//大きい方(A)に小さいほう(B)をくっ付けたい
//大小が逆だったらAとBをひっくり返す。
if (size(A) < size(B)) swap(A, B);
//Aのサイズを更新する
Parent[A] += Parent[B];
//Bの親をAに変更する
Parent[B] = A;
return true;
}
};
int main(){
vector<string> s(2);
REP(i,2){
cin>>s[i];
}
int next=0;
char next_char;
while(s[next].size()){
next_char=s[next][0];
erase(s[next].begin(),s[next].begin()+1);
if(next_char=='a'){
next=0;
}else if(next_char=='b'){
next=1;
}else{
next=2;
}
}
if(next==0){
cout<<"A"<<endl;
}else if(next==1){
cout<<"B"<<endl;
}else{
cout<<"C"<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:95:5: error: 'erase' was not declared in this scope
95 | erase(s[next].begin(),s[next].begin()+1);
| ^~~~~
|
s735872200
|
p03998
|
C++
|
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
bool prime(int n){
if(n==1){
return false;
}else if(n==2){
return true;
}else{
for(int i=2;i<=sqrt(n);i++){
if(n%i==0){
return false;
}
}
return true;
}
}
long long gcd(long long a, long long b){
if(a<b){
swap(a,b);
}
if(a%b==0){
return b;
}else{
return gcd(b,a%b);
}
}
long long lcm(long long x, long long y){
return (x/gcd(x,y))*y;
}
class UnionFind {
public:
//各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
vector<int> Parent;
//クラスを作るときは、Parentの値を全て-1にする。
//以下のようにすると全てバラバラの頂点として解釈できる。
UnionFind(int N) {
Parent = vector<int>(N, -1);
}
//Aがどのグループに属しているか調べる
int root(int A) {
if (Parent[A] < 0) return A;
return Parent[A] = root(Parent[A]);
}
//自分のいるグループの頂点数を調べる
int size(int A) {
return -Parent[root(A)];//先祖をrootで取っておきたい。
}
//AとBをくっ付ける
bool connect(int A, int B) {
//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
A = root(A);
B = root(B);
if (A == B) {
//すでにくっついてるからくっ付けない
return false;
}
//大きい方(A)に小さいほう(B)をくっ付けたい
//大小が逆だったらAとBをひっくり返す。
if (size(A) < size(B)) swap(A, B);
//Aのサイズを更新する
Parent[A] += Parent[B];
//Bの親をAに変更する
Parent[B] = A;
return true;
}
};
int main(){
vector<string> s(2);
REP(i,2){
cin>>s[i];
}
int next=0;
char next_char;
while(s[next].size()){
next_char=s[next][0]
s[next]=s[next].substr(1,s[next].size()-1);
if(next_char=='a'){
next=0;
}else if(next_char=='b'){
next=1;
}else{
next=2;
}
}
if(next==0){
cout<<"A"<<endl;
}else if(next==1){
cout<<"B"<<endl;
}else{
cout<<"C"<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:94:25: error: expected ';' before 's'
94 | next_char=s[next][0]
| ^
| ;
95 | s[next]=s[next].substr(1,s[next].size()-1);
| ~
|
s926453694
|
p03998
|
C++
|
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace std;
bool prime(int n){
if(n==1){
return false;
}else if(n==2){
return true;
}else{
for(int i=2;i<=sqrt(n);i++){
if(n%i==0){
return false;
}
}
return true;
}
}
long long gcd(long long a, long long b){
if(a<b){
swap(a,b);
}
if(a%b==0){
return b;
}else{
return gcd(b,a%b);
}
}
long long lcm(long long x, long long y){
return (x/gcd(x,y))*y;
}
class UnionFind {
public:
//各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
vector<int> Parent;
//クラスを作るときは、Parentの値を全て-1にする。
//以下のようにすると全てバラバラの頂点として解釈できる。
UnionFind(int N) {
Parent = vector<int>(N, -1);
}
//Aがどのグループに属しているか調べる
int root(int A) {
if (Parent[A] < 0) return A;
return Parent[A] = root(Parent[A]);
}
//自分のいるグループの頂点数を調べる
int size(int A) {
return -Parent[root(A)];//先祖をrootで取っておきたい。
}
//AとBをくっ付ける
bool connect(int A, int B) {
//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
A = root(A);
B = root(B);
if (A == B) {
//すでにくっついてるからくっ付けない
return false;
}
//大きい方(A)に小さいほう(B)をくっ付けたい
//大小が逆だったらAとBをひっくり返す。
if (size(A) < size(B)) swap(A, B);
//Aのサイズを更新する
Parent[A] += Parent[B];
//Bの親をAに変更する
Parent[B] = A;
return true;
}
};
int main(){
vector<string> s[2];
REP(i,2){
cin>>s[i];
}
int next=0;
char next_char;
while(s[next].size()){
next_char=s[next][0]
s[next]=s[next].substr(1,s[next].size()-1);
if(next_char=='a'){
next=0;
}else if(next_char=='b'){
next=1;
}else{
next=2;
}
}
if(next==0){
cout<<"A"<<endl;
}else if(next==1){
cout<<"B"<<endl;
}else{
cout<<"C"<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:89:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
89 | cin>>s[i];
| ~~~^~~~~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = ch
|
s807423649
|
p03998
|
C++
|
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
#define elif else if
using namespace std;
string s[4];
int a=0,b=0,c=0,d=0;
signed main(){
rep(i,3){
cin>>s[i];
}
while(){
if(a==0){
a=s[0][b]-97;
b++;
}elif(a==1){
a=s[1][c]-97;
c++;
}else{
a=s[2][d]-97;
d++;
}
if(b==s[0].size()||c==s[1].size()||d==s[2].size()){
cout<<
}
}
|
a.cc: In function 'int main()':
a.cc:12:15: error: expected primary-expression before ')' token
12 | while(){
| ^
a.cc:25:9: error: expected primary-expression before '}' token
25 | }
| ^
a.cc:26:2: error: expected '}' at end of input
26 | }
| ^
a.cc:8:14: note: to match this '{'
8 | signed main(){
| ^
|
s561298102
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
string sa,sb,sc;
cin>>sa>>sb>>sc;
int i=0;j=-1,k=-1;
int na=sa.size(),nb=sb.size(),nc=sc.size();
char ans = 'A';
string cur = a;
int cnt = i;
while(i<na&&j<nb&&k<nc){
if(cur[cnt]=='a'){
i++;
ans='A';
cur=sa;
cnt = i;
}else if(cur[cnt]=='b'){
j++;
ans='B';
cur=sb;
cnt=j;
}else{
k++;
ans='C';
cur=sc;
cnt=k;
}
}
cout<<ans<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:11: error: 'j' was not declared in this scope
8 | int i=0;j=-1,k=-1;
| ^
a.cc:8:16: error: 'k' was not declared in this scope
8 | int i=0;j=-1,k=-1;
| ^
a.cc:11:16: error: 'a' was not declared in this scope; did you mean 'na'?
11 | string cur = a;
| ^
| na
|
s006696898
|
p03998
|
C
|
#include <bits/stdc++.h>
using namespace std;
// gcd(a,b)
int gcd(int a,int b){
return (b == 0) ? a : gcd(b, a % b);
}
// lcm(a,b)
int lcm(int a,int b){
return (a * b) / gcd(a,b);
}
int main(int argc, char const *argv[]){
int player = 0,turn[3] = {0,-1,-1};
char card[3][120];
scanf("%s %s %s",card[0],card[1],card[2]);
for (int i = 0; i < strlen(card[0]) + strlen(card[1]) + strlen(card[2]); ++i){
switch(card[player][turn[player]]){
case 'a':
player = 0;
break;
case 'b':
player = 1;
break;
case 'c':
player = 2;
break;
}
if(++turn[player] > strlen(card[player])){
printf("%c\n", (player + 'A'));
return 0;
}
}
printf("%c\n", (player + 'A'));
return 0;
}
|
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s940142675
|
p03998
|
C++
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <iostream>
#define TLong long long
int main(int argc, char const *argv[]){
int player = 0,turn[3] = {0,0,0};
char card[3][111];
std::cin<<card[0]<<card[1]<<card[2];
// scanf("%s %s %s",card[0],card[1],card[2]);
for (int i = 0; i < strlen(card[0]) + strlen(card[1]) + strlen(card[2]); ++i){
switch(card[player][turn[player]]){
case 'a':
player = 0;
break;
case 'b':
player = 1;
break;
case 'c':
player = 2;
break;
}
if(++turn[player] > strlen(card[player])){
printf("%c\n", (player + 0x41));
return 0;
}
}
printf("%c\n", (player + 0x41));
return 0;
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:13:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'char [111]')
13 | std::cin<<card[0]<<card[1]<<card[2];
| ~~~~~~~~^~~~~~~~~
| | |
| | char [111]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/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:6:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:13:10: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ~~~~~^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = char [111]]':
a.cc:13:21: required from here
13 | std::cin<<card[0]<<card[1]<<card[2];
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
|
s394408538
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
string A,B,C;
cin >> A >> B >> C;
int na=nb=nc=0;
char X=A.at(0);
while(true){
if(X=='a'){
na++;
if(na==A.size()){
cout << "A" << endl;
return 0;
}
else X = A.at(na);
}
else if(X=='b'){
nb++;
if(nb==A.size()){
cout << "B" << endl;
return 0;
}
else X = B.at(nb);
}
else if(X=='c'){
nc++;
if(nc==C.size()){
cout << "C" << endl;
return 0;
}
else X = C.at(nc);
}
}
}
|
a.cc: In function 'int main()':
a.cc:7:10: error: 'nb' was not declared in this scope; did you mean 'na'?
7 | int na=nb=nc=0;
| ^~
| na
a.cc:7:13: error: 'nc' was not declared in this scope; did you mean 'na'?
7 | int na=nb=nc=0;
| ^~
| na
|
s423699799
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
string Aturn(int a,int b,int c,string A,string B, string C)
string Bturn(int a,int b,int c,string A,string B, string C)
string Cturn(int a,int b,int c,string A,string B, string C)
string Aturn(int a,int b,int c,string A,string B, string C){
a++;
if(a+1==A.size()) return "A";
if(A.at(a) == 'a') Aturn(a,b,c,A,B,C);
else if(A.at(a) == 'b') Bturn(a,b,c,A,B,C);
else if(A.at(a) == 'c') Cturn(a,b,c,A,B,C);
}
string Bturn(int a,int b,int c,string A,string B, string C){
b++;
if(b+1==B.size()) return "B";
if(B.at(b) == 'a') Aturn(a,b,c,A,B,C);
else if(B.at(b) == 'b') Bturn(a,b,c,A,B,C);
else if(B.at(b) == 'c') Cturn(a,b,c,A,B,C);
}
string Cturn(int a,int b,int c,string A,string B, string C){
c++;
if(c+1==C.size()) return "C";
if(C.at(c) == 'a') Aturn(a,b,c,A,B,C);
else if(C.at(c) == 'b') Bturn(a,b,c,A,B,C);
else if(C.at(c) == 'c') Cturn(a,b,c,A,B,C);
}
int main(){
string A,B,C;
cin >> A >> B >> C;
cout << Aturn(0,0,0,A,B,C) << endl;
}
|
a.cc:5:1: error: expected initializer before 'string'
5 | string Bturn(int a,int b,int c,string A,string B, string C)
| ^~~~~~
a.cc: In function 'std::string Bturn(int, int, int, std::string, std::string, std::string)':
a.cc:18:22: error: 'Aturn' was not declared in this scope; did you mean 'Bturn'?
18 | if(B.at(b) == 'a') Aturn(a,b,c,A,B,C);
| ^~~~~
| Bturn
a.cc:20:27: error: 'Cturn' was not declared in this scope; did you mean 'Bturn'?
20 | else if(B.at(b) == 'c') Cturn(a,b,c,A,B,C);
| ^~~~~
| Bturn
a.cc: In function 'std::string Cturn(int, int, int, std::string, std::string, std::string)':
a.cc:25:22: error: 'Aturn' was not declared in this scope; did you mean 'Cturn'?
25 | if(C.at(c) == 'a') Aturn(a,b,c,A,B,C);
| ^~~~~
| Cturn
a.cc: In function 'int main()':
a.cc:35:11: error: 'Aturn' was not declared in this scope; did you mean 'Cturn'?
35 | cout << Aturn(0,0,0,A,B,C) << endl;
| ^~~~~
| Cturn
a.cc: In function 'std::string Bturn(int, int, int, std::string, std::string, std::string)':
a.cc:21:1: warning: control reaches end of non-void function [-Wreturn-type]
21 | }
| ^
a.cc: In function 'std::string Cturn(int, int, int, std::string, std::string, std::string)':
a.cc:28:1: warning: control reaches end of non-void function [-Wreturn-type]
28 | }
| ^
|
s988907288
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
string Aturn(int a,int b,int c,string A,string B, string C){
a++;
if(a+1==A.size()) return "A";
if(A.at(a) == 'a') Aturn(a,b,c,A,B,C);
else if(A.at(a) == 'b') Bturn(a,b,c,A,B,C);
else if(A.at(a) == 'c') Cturn(a,b,c,A,B,C);
}
string Bturn(int a,int b,int c,string A,string B, string C){
b++;
if(b+1==B.size()) return "B";
if(B.at(b) == 'a') Aturn(a,b,c,A,B,C);
else if(B.at(b) == 'b') Bturn(a,b,c,A,B,C);
else if(B.at(b) == 'c') Cturn(a,b,c,A,B,C);
}
string Cturn(int a,int b,int c,string A,string B, string C){
c++;
if(c+1==C.size()) return "C";
if(C.at(c) == 'a') Aturn(a,b,c,A,B,C);
else if(C.at(c) == 'b') Bturn(a,b,c,A,B,C);
else if(C.at(c) == 'c') Cturn(a,b,c,A,B,C);
}
int main(){
string A,B,C;
cin >> A >> B >> C;
cout << Aturn(0,0,0,A,B,C) << endl;
}
|
a.cc: In function 'std::string Aturn(int, int, int, std::string, std::string, std::string)':
a.cc:10:27: error: 'Bturn' was not declared in this scope; did you mean 'Aturn'?
10 | else if(A.at(a) == 'b') Bturn(a,b,c,A,B,C);
| ^~~~~
| Aturn
a.cc:11:27: error: 'Cturn' was not declared in this scope; did you mean 'Aturn'?
11 | else if(A.at(a) == 'c') Cturn(a,b,c,A,B,C);
| ^~~~~
| Aturn
a.cc: In function 'std::string Bturn(int, int, int, std::string, std::string, std::string)':
a.cc:18:27: error: 'Cturn' was not declared in this scope; did you mean 'Bturn'?
18 | else if(B.at(b) == 'c') Cturn(a,b,c,A,B,C);
| ^~~~~
| Bturn
a.cc: In function 'std::string Aturn(int, int, int, std::string, std::string, std::string)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
12 | }
| ^
a.cc: In function 'std::string Bturn(int, int, int, std::string, std::string, std::string)':
a.cc:19:1: warning: control reaches end of non-void function [-Wreturn-type]
19 | }
| ^
a.cc: In function 'std::string Cturn(int, int, int, std::string, std::string, std::string)':
a.cc:26:1: warning: control reaches end of non-void function [-Wreturn-type]
26 | }
| ^
|
s807495682
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
string Aturn(int a,int b,int c){
a++;
if(a+1==A.size()) return "A";
if(A.at(a) == 'a') Aturn(a,b,c);
else if(A.at(a) == 'b') Bturn(a,b,c);
else if(A.at(a) == 'c') Cturn(a,b,c);
}
string Bturn(int a,int b,int c){
b++;
if(b+1==B.size()) return "B";
if(B.at(b) == 'a') Aturn(a,b,c);
else if(B.at(b) == 'b') Bturn(a,b,c);
else if(B.at(b) == 'c') Cturn(a,b,c);
}
string Cturn(int a,int b,int c){
c++;
if(c+1==C.size()) return "C";
if(C.at(c) == 'a') Aturn(a,b,c);
else if(C.at(c) == 'b') Bturn(a,b,c);
else if(C.at(c) == 'c') Cturn(a,b,c);
}
int main(){
int a=b=c=0;
string A,B,C;
cin >> A >> B >> C;
cout << Aturn(a,b,c) << endl;
}
|
a.cc: In function 'std::string Aturn(int, int, int)':
a.cc:8:11: error: 'A' was not declared in this scope
8 | if(a+1==A.size()) return "A";
| ^
a.cc:9:6: error: 'A' was not declared in this scope
9 | if(A.at(a) == 'a') Aturn(a,b,c);
| ^
a.cc:10:27: error: 'Bturn' was not declared in this scope; did you mean 'Aturn'?
10 | else if(A.at(a) == 'b') Bturn(a,b,c);
| ^~~~~
| Aturn
a.cc:11:27: error: 'Cturn' was not declared in this scope; did you mean 'Aturn'?
11 | else if(A.at(a) == 'c') Cturn(a,b,c);
| ^~~~~
| Aturn
a.cc: In function 'std::string Bturn(int, int, int)':
a.cc:15:11: error: 'B' was not declared in this scope
15 | if(b+1==B.size()) return "B";
| ^
a.cc:16:6: error: 'B' was not declared in this scope
16 | if(B.at(b) == 'a') Aturn(a,b,c);
| ^
a.cc:18:27: error: 'Cturn' was not declared in this scope; did you mean 'Bturn'?
18 | else if(B.at(b) == 'c') Cturn(a,b,c);
| ^~~~~
| Bturn
a.cc: In function 'std::string Cturn(int, int, int)':
a.cc:22:11: error: 'C' was not declared in this scope
22 | if(c+1==C.size()) return "C";
| ^
a.cc:23:6: error: 'C' was not declared in this scope
23 | if(C.at(c) == 'a') Aturn(a,b,c);
| ^
a.cc: In function 'int main()':
a.cc:29:9: error: 'b' was not declared in this scope
29 | int a=b=c=0;
| ^
a.cc:29:11: error: 'c' was not declared in this scope
29 | int a=b=c=0;
| ^
a.cc: In function 'std::string Aturn(int, int, int)':
a.cc:7:4: warning: control reaches end of non-void function [-Wreturn-type]
7 | a++;
| ~^~
a.cc: In function 'std::string Bturn(int, int, int)':
a.cc:14:4: warning: control reaches end of non-void function [-Wreturn-type]
14 | b++;
| ~^~
a.cc: In function 'std::string Cturn(int, int, int)':
a.cc:21:4: warning: control reaches end of non-void function [-Wreturn-type]
21 | c++;
| ~^~
|
s822977635
|
p03998
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main(){
string a,b,c;
int counta=0,countb=0,countc=0;
int turn=1;
cin>>a>>b>>c;
counta++;
while(1){
if(turn==1){
if(a[counta-1]=='a'){
counta++;
turn=1;
}
else if(a[count-1]=='b'){
countb++;
turn=2;
}else{
countc++;
turn=3;
}
}else if(turn==2){
if(b[counta-1]=='a'){
counta++;
turn=1;
}
else if(b[count-1]=='b'){
countb++;
turn=2;
}else{
countc++;
turn=3;
}
}else{
if(c[counta-1]=='a'){
counta++;
turn=1;
}
else if(c[count-1]=='b'){
countb++;
turn=2;
}else{
countc++;
turn=3;
}
}if(counta==a.size()||countb==b.size()||countc==c.size())break;
}
if(counta==a.size())cout<<'A'<<endl;
else if(countb==b.size())cout<<'B'<<endl;
else cout<<'C'<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:17: error: 'count' was not declared in this scope; did you mean 'countc'?
18 | else if(a[count-1]=='b'){
| ^~~~~
| countc
a.cc:30:17: error: 'count' was not declared in this scope; did you mean 'countc'?
30 | else if(b[count-1]=='b'){
| ^~~~~
| countc
a.cc:42:17: error: 'count' was not declared in this scope; did you mean 'countc'?
42 | else if(c[count-1]=='b'){
| ^~~~~
| countc
|
s782335354
|
p03998
|
C++
|
#include<iostream>
using namespace std;
string a,b,c;
void judge(string s){
if(s.size()==0)return;
if(s[0]=='a'){
s.erase(s.begin());
judge(a);
}
else if(s[0]=='b'){
s.erase(s.begin());
judge(b);
}
else if(s[0]=='c') {
s.erase(s.begin());
judge(c);
}
}
}
int main(){
cin>>a>>b>>c;
judge(a);
if(a.size()==0)cout<<'A'<<endl;
else if(b.size()==0)cout<<'B'<<endl;
else cout<<'C'<<endl;
return 0;
}
|
a.cc:22:1: error: expected declaration before '}' token
22 | }
| ^
|
s024429702
|
p03998
|
C++
|
#include<iostream>
using namespace std;
string a,b,c;
void judge(string s){
if(s.size()==0)return;
if(s[0]=='a'){
s.pop_front();
judge(a);
}
else if(s[0]=='b'){
s.pop_front();
judge(b);
}
else if(s[0]=='c') {
s.pop_front();
judge(c);
}
}
}
int main(){
cin>>a>>b>>c;
judge(a);
if(a.size()==0)cout<<'A'<<endl;
else if(b.size()==0)cout<<'B'<<endl;
else cout<<'C'<<endl;
return 0;
}
|
a.cc: In function 'void judge(std::string)':
a.cc:9:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
9 | s.pop_front();
| ^~~~~~~~~
a.cc:13:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
13 | s.pop_front();
| ^~~~~~~~~
a.cc:17:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop_front'
17 | s.pop_front();
| ^~~~~~~~~
a.cc: At global scope:
a.cc:22:1: error: expected declaration before '}' token
22 | }
| ^
|
s579811156
|
p03998
|
C++
|
//file_name:ABC45_B.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[3];
cin >> s[0] >> s[1] >> s[2];
int x = 0;
int n[3] = {};
while(true){
if(s[x].size()-n[x]==0){
if(x==0){
cout << 'A' << endl;
}
if(x==1){
cout << 'B' << endl;
}
if(x==2){
cout << 'C' << endl;
}
return 0;
}
n[x]++;
if(s[n[x]-1]=='a'){
x = 0;
}else if(s[n[x]-1]=='b'){
x = 1;
}else{
x = 2;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:100:21: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
100 | if(s[n[x]-1]=='a'){
| ~~~~~~~~~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:2:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
100 | if(s[n[x]-1]=='a'){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
100 | if(s[n[x]-1]=='a'){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
100 | if(s[n[x]-1]=='a'){
| ^~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
100 | if(s[n[x]-1]=='a'){
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
100 | if(s[n[x]-1]=='a'){
| ^~~
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:629: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> >)'
629 | operator==(basic_string_view<_CharT, _Trai
|
s369329464
|
p03998
|
C++
|
//file_name:ABC45_B.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[3];
cin >> s[0] >> s[1] >> s[2];
int x = 0;
int n[3] = {};
while(true){
if(s[x].size-n[x]==0){
if(x==0){
cout << 'A' << endl;
}
if(x==1){
cout << 'B' << endl;
}
if(x==2){
cout << 'C' << endl;
}
return 0;
}
n[x]++;
if(s[n[x]-1]=='a'){
x = 0;
}else if(s[n[x]-1]=='b'){
x = 1;
}else{
x = 2;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:87:17: 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 '()' ?)
87 | if(s[x].size-n[x]==0){
| ~~~~~^~~~
| ()
a.cc:100:21: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
100 | if(s[n[x]-1]=='a'){
| ~~~~~~~~~^~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:2:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
100 | if(s[n[x]-1]=='a'){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
100 | if(s[n[x]-1]=='a'){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
100 | if(s[n[x]-1]=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
100 | if(s[n[x]-1]=='a'){
| ^~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
100 | if(s[n[x]-1]=='a'){
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:100:23: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
100 | if(s[n[x]-1]=='a'){
|
s851602704
|
p03998
|
C++
|
#include<bits/stdc++.h>
#define int long long
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
using namespace std;
typedef vector<int> vint;
typedef pair<int,int> pint;
signed main()
{
string A,B,C; cin>>A>>B>>C;
int posA=0,posB=0,posC=0;
int cur=0;
while(true){
if(cur==0 and posA==A.size()){
cout<<'A'<<endl;
break;
if(cur==1 and posB==B.size()){
cout<<'B'<<endl;
break;
}
if(cur==2 and posC==C.size()){
cout<<'C'<<endl;
break;
}
if(cur==0) cur=A[posA++]-'a';
if(cur==1) cur=B[posB++]-'a';
if(cur==2) cur=C[posC++]-'a';
}
}
|
a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
30 | }
| ^
a.cc:10:1: note: to match this '{'
10 | {
| ^
|
s808695693
|
p03998
|
C++
|
#include <iostream>
using namespace std;
int main(){
string s[3];
cin >> s[0] >> s[1] >> s[2];
int x = 0, i[3] = {0};
while(){
if(i[x] == s[x].size()){
char c = 'A' + x;
cout << c << endl;
return 0;
}
if(s[x][i[x]] == 'a'){
i[x]++;
x = 0;
}else if(s[x][i[x]] == 'b'){
i[x]++;
x = 1;
}else if(s[x][i[x]] == 'c'){
i[x]++;
x = 2;
}
}
}
|
a.cc: In function 'int main()':
a.cc:9:9: error: expected primary-expression before ')' token
9 | while(){
| ^
|
s146296081
|
p03998
|
C++
|
#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
static const int giga = pow(10,9);
// double pi = 3.141592653589793238463;
void game(void);
char winner;
string sa, sb, sc;
int main(void){
cin >> sa >> sb >> sc;
game();
cout << winner << endl;
return 0;
}
void game(){
int turn = 0;
int len_a = sa.strlen();
int len_b = sa.strlen();
int len_c = sa.strlen();
int counter_a =0;
int counter_b =0;
int counter_c =0;
if(turn == 0 && counter_a == len_a){
winner = 'A';
return;
} else if(turn == 0 && && counter_a != len_a){
turn = sa[counter_a] - 'a';
counter_a++;
} else if(turn == 1 && counter_b == len_b){
winner = 'B';
return;
} else if(turn == 1 && counter_b != len_b){
turn = sb[counter_b] - 'a';
counter_b++;
} else if(turn == 2 && counter_c == len_c){
winner = 'C';
return;
} else if(turn == 2 && counter_c != len_c){
turn = sc[counter_c] - 'a';
counter_c++;
}
}
|
a.cc: In function 'void game()':
a.cc:38:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'strlen'
38 | int len_a = sa.strlen();
| ^~~~~~
a.cc:39:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'strlen'
39 | int len_b = sa.strlen();
| ^~~~~~
a.cc:40:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'strlen'
40 | int len_c = sa.strlen();
| ^~~~~~
a.cc:47:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
47 | } else if(turn == 0 && && counter_a != len_a){
| ~~~~~~~~~~~~~^~~~~~~~
a.cc:47:29: error: label 'counter_a' used but not defined
47 | } else if(turn == 0 && && counter_a != len_a){
| ^~~~~~~~~
|
s498468216
|
p03998
|
C++
|
#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
static const int giga = pow(10,9);
// double pi = 3.141592653589793238463;
void game(void);
char winner;
int main(void){
string sa, sb, sc;
cin >> sa >> sb >> sc;
game();
cout << winner << endl;
return 0;
}
void game(){
int turn = 0;
int len_a = sa.strlen();
int len_b = sa.strlen();
int len_c = sa.strlen();
int counter_a =0;
int counter_b =0;
int counter_c =0;
if(turn == 0 && counter_a == len_a){
winner = 'A';
return;
} else if(turn == 0 && && counter_a != len_a){
turn = sa[counter_a] - 'a';
counter_a++;
} else if(turn == 1 && counter_b == len_b){
winner = 'B';
return;
} else if(turn == 1 && counter_b == len_b){
turn = sb[counter_b] - 'a';
counter_b++;
} else if(turn == 2 && counter_c == len_c){
winner = 'C';
return;
} else if(turn == 2 && counter_c == len_c){
turn = sc[counter_c] - 'a';
counter_c++;
}
}
|
a.cc: In function 'void game()':
a.cc:37:15: error: 'sa' was not declared in this scope
37 | int len_a = sa.strlen();
| ^~
a.cc:46:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
46 | } else if(turn == 0 && && counter_a != len_a){
| ~~~~~~~~~~~~~^~~~~~~~
a.cc:53:12: error: 'sb' was not declared in this scope
53 | turn = sb[counter_b] - 'a';
| ^~
a.cc:59:12: error: 'sc' was not declared in this scope
59 | turn = sc[counter_c] - 'a';
| ^~
a.cc:46:29: error: label 'counter_a' used but not defined
46 | } else if(turn == 0 && && counter_a != len_a){
| ^~~~~~~~~
|
s959916511
|
p03998
|
C++
|
import sys
SA = str(input())
SB = str(input())
SC = str(input())
turn = "A"
while (1):
if( turn == "A"):
if SA == "":
break
if SA[0] == "a":
turn = "A"
elif SA[0] == "b":
turn = "B"
else:
turn = "C"
SA = SA[1:]
elif( turn == "B"):
if SB == "":
break
if SB[0] == "a":
turn = "A"
elif SB[0] == "b":
turn = "B"
else:
turn = "C"
SB = SB[1:]
else:
if SC == "":
break
if SC[0] == "a":
turn = "A"
elif SC[0] == "b":
turn = "B"
else:
turn = "C"
SC = SC[1:]
print(turn)
|
a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s846460498
|
p03998
|
C++
|
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
string Sa, Sb, Sc, n;
int ai, bi, ci,Dis;
ai = 0;
bi = 0;
ci = 0;
n = "a";
cin >> Sa >> Sb >> Sc;
while (Dis==0){
if (n == "a"){
n = Sa.substr(ai, 1);
ai++;
}
else if (n == "b"){
n = Sb.substr(bi, 1);
bi++;
}
else if(n=="c"){
n = Sc.substr(ci, 1);
ci++;
}
else{
Dis++;
}
}
if (n == "a"){
n = "A";
}
else if (n == "b"){
n = "B";
}
else(n == "c"){
n = "C"
}
cout << n << endl;
}
|
a.cc: In function 'int main()':
a.cc:40:23: error: expected ';' before '{' token
40 | else(n == "c"){
| ^
| ;
a.cc:40:16: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
40 | else(n == "c"){
| ~~~^~~~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
|
s707681784
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
string s[3];
cint>>s[0]>>s[1]>>s[2];
int turn=0;
char c;
while(true){
if(s[turn]==""){
cout<<(char)('A'+turn)<<endl;
}
c=s[turn].at(0);
s[turn]=s[turn].substr(1,s[turn].length()-1);
turn=c-'a';
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:3: error: 'cint' was not declared in this scope; did you mean 'uint'?
6 | cint>>s[0]>>s[1]>>s[2];
| ^~~~
| uint
|
s934671051
|
p03998
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
int x, y, z;
char next = 'A';
string A, B, C;
cin >> A >> B >> C;
while (A.length > x && B.length > y && C.length > z)
{
switch (next)
{
case 'A':
next = A[x];
x++;
case 'B':
next = B[y];
y++;
case 'C':
next = C[z];
z++;
}
}
cout << next << endl;
}
|
a.cc: In function 'int main()':
a.cc:14:18: 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 '()' ?)
14 | while (A.length > x && B.length > y && C.length > z)
| ~~^~~~~~
| ()
a.cc:14:34: 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 '()' ?)
14 | while (A.length > x && B.length > y && C.length > z)
| ~~^~~~~~
| ()
a.cc:14:50: 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 '()' ?)
14 | while (A.length > x && B.length > y && C.length > z)
| ~~^~~~~~
| ()
|
s252539914
|
p03998
|
C
|
#include<stdio.h>
#include<string.h>
int main(void)
{
int Acount = 0,Bcount = 0,Ccount = 0flag = 0;
char A[110],B[110],C[110];
scanf("%s",A); scanf("%s",B); scanf("%s",C);
while(flag != 4)
{
switch(flag)
{
case 0:
if(Acount == strlen(A) - 1){printf("A"); flag = 4; break;}
if(A[Acount] == 'B'){flag = 1;}else{flag = 2;}
Acount++;
break;
case 1:
if(Bcount == strlen(B) - 1){printf("B"); flag = 4; break;}
if(A[Acount] == 'B'){flag = 1;}else{flag = 2;}
Bcount++;
break;
case 2:
if(Ccount == strlen(C) - 1){printf("C"); flag = 4; break;}
if(A[Acount] == 'B'){flag = 1;}else{flag = 2;}
Ccount++;
break;
}
}
return 0;
}
|
main.c: In function 'main':
main.c:6:38: error: invalid suffix "flag" on integer constant
6 | int Acount = 0,Bcount = 0,Ccount = 0flag = 0;
| ^~~~~
main.c:10:9: error: 'flag' undeclared (first use in this function)
10 | while(flag != 4)
| ^~~~
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
|
s659964942
|
p03998
|
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()
{
optimize_cin();
string SA, SB, SC;
cin >> SA >> SB >> SC;
char turn = 'a';
while (true)
{
if (SZ(SA) == 0)
{
cout << "A" << "\n";
break;
}
else if (SZ(SB) == 0)
{
cout << "B" << "\n";
break;
}
else if (SZ(SC) == 0)
{
cout << "C" << "\n";
break;
}
if (turn == 'a')
{
turn = SA.back();
SA.pop_back();
}
else if (turn == 'b')
{
turn = SB.back();
SB.pop_back();
}
else if (turn == 'c')
{
turn = SC.back();
SC.pop_back();
}
}
return 0;
|
a.cc: In function 'int main()':
a.cc:59:14: error: expected '}' at end of input
59 | return 0;
| ^
a.cc:16:1: note: to match this '{'
16 | {
| ^
|
s568599571
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s[3];
REP(i, 3) cin >> s[i];
int mbr_next;
int mbr_prev = 0;
do
{
mbr_next = s[mbr_prev].c_str()[0] - 'a';
s[mbr_prev] = s[mbr_prev].substr(1, s[mbr_prev].size() - 1);
mbr_prev = mbr_next;
}
while(s[mbr_next].size());
if (!s[0].size()) cout << "A" << endl;
else if (!s[1].size()) cout << "B" << endl;
else cout << "C" << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:9: error: 'i' was not declared in this scope
7 | REP(i, 3) cin >> s[i];
| ^
a.cc:7:5: error: 'REP' was not declared in this scope
7 | REP(i, 3) cin >> s[i];
| ^~~
|
s478548692
|
p03998
|
C++
|
#include <iostream>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <cstdlib>
#include <iterator>
#include <algorithm>
#include <functional>
#include <random>
#include <bits/stdc++.h>
#include <stdio.h>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <math.h>
#include <ctime>
#include <cstring>
typedef long long ll;
using namespace std;
#define FOR(i,n) for(ll i=97;i<n;i++)
#define RFOR(i,n) for(ll i=n-1;i>=0;--i)
#define COUT(str) cout << str << endl
string a, b, c;
int main() {
cin >> a >> b >> c;
int ia = 0, ib = 0, ic = 0;
char state = 'a';
while (ia <= a.length() and ib <= b.length() and ic <= c.length())
{
if (state == 'a') {
if (ia == a.length()) {
cout << "A" << nn;
return 0;
}
state = a[ia++];
}
else if (state == 'b') {
if (ib == b.length()) {
cout << "B" << nn;
return 0;
}
state = b[ib++];
}
else if (state == 'c') {
if (ic == c.length()) {
cout << "C" << nn;
return 0;
}
state = c[ic++];
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:47:48: error: 'nn' was not declared in this scope; did you mean 'yn'?
47 | cout << "A" << nn;
| ^~
| yn
a.cc:54:48: error: 'nn' was not declared in this scope; did you mean 'yn'?
54 | cout << "B" << nn;
| ^~
| yn
a.cc:61:48: error: 'nn' was not declared in this scope; did you mean 'yn'?
61 | cout << "C" << nn;
| ^~
| yn
|
s689331677
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main() {
string a, b, c;
cin >> a >> b >> c;
char card=='a';
while () {
if (card = 'a') {
if (a.size() == 0) {
cout << "A" << endl;
return 0;
}
else {
card = a[0];
a = a.substr(1, a.size() - 1);
}
}
if (card = 'b') {
if (b.size() == 0) {
cout << "B" << endl;
return 0;
}
else {
card = b[0];
b = b.substr(1, b.size() - 1);
}
}if (card = 'c') {
if (c.size() == 0) {
cout << "C" << endl;
return 0;
}
else {
card = c[0];
c = c.substr(1, c.size() - 1);
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:6:18: error: expected initializer before '==' token
6 | char card=='a';
| ^~
a.cc:7:16: error: expected primary-expression before ')' token
7 | while () {
| ^
a.cc:8:21: error: 'card' was not declared in this scope
8 | if (card = 'a') {
| ^~~~
a.cc:18:21: error: 'card' was not declared in this scope
18 | if (card = 'b') {
| ^~~~
a.cc:27:22: error: 'card' was not declared in this scope
27 | }if (card = 'c') {
| ^~~~
|
s994449851
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main() {
string a, b, c;
cin >> a >> > b >> c;
char card=='a';
while () {
if (card = 'a') {
if (a.size() == 0) {
cout << "A" << endl;
return 0;
}
else {
card = a[0];
a = a.substr(1, a.size() - 1);
}
}
if (card = 'b') {
if (b.size() == 0) {
cout << "B" << endl;
return 0;
}
else {
card = b[0];
b = b.substr(1, b.size() - 1);
}
}if (card = 'c') {
if (c.size() == 0) {
cout << "C" << endl;
return 0;
}
else {
card = c[0];
c = c.substr(1, c.size() - 1);
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:5:21: error: expected primary-expression before '>' token
5 | cin >> a >> > b >> c;
| ^
a.cc:5:25: error: no match for 'operator>>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
5 | cin >> a >> > b >> c;
| ~ ^~ ~
| | |
| | basic_string<[...]>
| basic_string<[...]>
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:5:23: note: cannot convert 'b' (type 'std::string' {aka 'std::__cxx11::basic_string<char>'}) to type 'std::byte'
5 | cin >> a >> > b >> c;
| ^
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
5 | cin >> a >> > b >> c;
| ^
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
5 | cin >> a >> > b >> c;
| ^
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
5 | cin >> a >> > b >> c;
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<char, _Traits>'
5 | cin >> a >> > b >> c;
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<char, _Traits>'
5 | cin >> a >> > b >> c;
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
5 | cin >> a >> > b >> c;
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<char, _Traits>'
5 | cin >> a >> > b >> c;
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<char, _Traits>'
5 | cin >> a >> > b >> c;
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::__cxx11::basic_string<char>&; _Tp = std::__cxx11::basic_string<char>&]':
a.cc:5:21: required from here
5 | cin >> a >> > b >> c;
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
5 | cin >> a >> > b >> c;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
5 | cin >> a >> > b >> c;
| ^
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
5 | cin >> a >> > b >> c;
| ^
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
5 | cin >> a >> > b >> c;
| ^
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:5:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
5 | cin >> a >> > b >> c;
|
|
s740385023
|
p03998
|
C++
|
include<bits/stdc++.h>
using namespace std;
int main(){
char s1[101],s2[100],s3[100];
deque<char> a;
deque<char> b;
deque<char> c;
scanf("%s",s1);
for (int i=0;i<strlen(s1);i++) a.push_back(s1[i]);
scanf("%s",s2);
for (int i=0;i<strlen(s2);i++) b.push_back(s2[i]);
scanf("%s",s3);
for (int i=0;i<strlen(s3);i++) c.push_back(s3[i]);
int f=0;
for(;;) {
if (f==0) {
if (a.empty()) {
printf("A\n");
break;
}
f=a.front()-'a';
a.pop_front();
} else if (f==1) {
if (b.empty()) {
printf("B\n");
break;
}
f=b.front()-'a';
b.pop_front();
} else {
if (c.empty()) {
printf("C\n");
break;
}
f=c.front()-'a';
c.pop_front();
}
}
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'deque' was not declared in this scope
7 | deque<char> a;
| ^~~~~
a.cc:7:11: error: expected primary-expression before 'char'
7 | deque<char> a;
| ^~~~
a.cc:8:11: error: expected primary-expression before 'char'
8 | deque<char> b;
| ^~~~
a.cc:9:11: error: expected primary-expression before 'char'
9 | deque<char> c;
| ^~~~
a.cc:10:5: error: 'scanf' was not declared in this scope
10 | scanf("%s",s1);
| ^~~~~
a.cc:11:20: error: 'strlen' was not declared in this scope
11 | for (int i=0;i<strlen(s1);i++) a.push_back(s1[i]);
| ^~~~~~
a.cc:1:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
+++ |+#include <cstring>
1 | include<bits/stdc++.h>
a.cc:11:36: error: 'a' was not declared in this scope
11 | for (int i=0;i<strlen(s1);i++) a.push_back(s1[i]);
| ^
a.cc:13:20: error: 'strlen' was not declared in this scope
13 | for (int i=0;i<strlen(s2);i++) b.push_back(s2[i]);
| ^~~~~~
a.cc:13:20: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:13:36: error: 'b' was not declared in this scope
13 | for (int i=0;i<strlen(s2);i++) b.push_back(s2[i]);
| ^
a.cc:15:20: error: 'strlen' was not declared in this scope
15 | for (int i=0;i<strlen(s3);i++) c.push_back(s3[i]);
| ^~~~~~
a.cc:15:20: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:15:36: error: 'c' was not declared in this scope
15 | for (int i=0;i<strlen(s3);i++) c.push_back(s3[i]);
| ^
a.cc:19:17: error: 'a' was not declared in this scope
19 | if (a.empty()) {
| ^
a.cc:20:17: error: 'printf' was not declared in this scope
20 | printf("A\n");
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | include<bits/stdc++.h>
a.cc:23:15: error: 'a' was not declared in this scope
23 | f=a.front()-'a';
| ^
a.cc:26:17: error: 'b' was not declared in this scope
26 | if (b.empty()) {
| ^
a.cc:27:17: error: 'printf' was not declared in this scope
27 | printf("B\n");
| ^~~~~~
a.cc:27:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:30:15: error: 'b' was not declared in this scope
30 | f=b.front()-'a';
| ^
a.cc:33:17: error: 'c' was not declared in this scope
33 | if (c.empty()) {
| ^
a.cc:34:17: error: 'printf' was not declared in this scope
34 | printf("C\n");
| ^~~~~~
a.cc:34:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:37:15: error: 'c' was not declared in this scope
37 | f=c.front()-'a';
| ^
|
s964968377
|
p03998
|
C++
|
#include <iostream>
#include <queue>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){
char sa[105],sb[105],sc[105];
cin>>sa>>sb>>sc;
int now=sa[0];
int a=0,b=0,c=0;
for(int i=0;i<310;i++){
if(now=='a') {a++; now=sa[a]; if(now!='a'&&now!='b'&&now!='c') {cout<<'A';break;}}
else if(now=='b') {b++; now=sb[b]; if(now!='a'&&now!='b'&&now!='c') {cout<<'B';break;}}
else {c++; now=sc[c]; if(now!='a'&&now!='b'&&now!='c') {cout<<'C'; break;}
}
return 0;
}
|
a.cc:8:1: error: extended character is not valid in an identifier
8 | char sa[105],sb[105],sc[105];
| ^
a.cc:9:1: error: extended character is not valid in an identifier
9 | cin>>sa>>sb>>sc;
| ^
a.cc:10:1: error: extended character is not valid in an identifier
10 | int now=sa[0];
| ^
a.cc:11:1: error: extended character is not valid in an identifier
11 | int a=0,b=0,c=0;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
12 | for(int i=0;i<310;i++){
| ^
a.cc:13:1: error: extended character is not valid in an identifier
13 | if(now=='a') {a++; now=sa[a]; if(now!='a'&&now!='b'&&now!='c') {cout<<'A';break;}}
| ^
a.cc:14:1: error: extended character is not valid in an identifier
14 | else if(now=='b') {b++; now=sb[b]; if(now!='a'&&now!='b'&&now!='c') {cout<<'B';break;}}
| ^
a.cc:15:1: error: extended character is not valid in an identifier
15 | else {c++; now=sc[c]; if(now!='a'&&now!='b'&&now!='c') {cout<<'C'; break;}
| ^
a.cc:16:1: error: extended character is not valid in an identifier
16 | }
| ^
a.cc:17:1: error: extended character is not valid in an identifier
17 | return 0;
| ^
a.cc: In function 'int main()':
a.cc:8:1: error: '\U00003000char' was not declared in this scope
8 | char sa[105],sb[105],sc[105];
| ^~~~~~
a.cc:9:1: error: '\U00003000cin' was not declared in this scope
9 | cin>>sa>>sb>>sc;
| ^~~~~
a.cc:9:8: error: 'sa' was not declared in this scope
9 | cin>>sa>>sb>>sc;
| ^~
a.cc:9:12: error: 'sb' was not declared in this scope
9 | cin>>sa>>sb>>sc;
| ^~
a.cc:9:16: error: 'sc' was not declared in this scope
9 | cin>>sa>>sb>>sc;
| ^~
a.cc:10:1: error: '\U00003000int' was not declared in this scope
10 | int now=sa[0];
| ^~~~~
a.cc:11:6: error: expected ';' before 'a'
11 | int a=0,b=0,c=0;
| ^~
| ;
a.cc:12:7: error: expected primary-expression before 'int'
12 | for(int i=0;i<310;i++){
| ^~~
a.cc:12:15: error: 'i' was not declared in this scope
12 | for(int i=0;i<310;i++){
| ^
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:7:15: note: to match this '{'
7 | int main(void){
| ^
|
s575668319
|
p03998
|
C++
|
#! /usr/bin/python3
# 3人でカードゲームイージー / Card Game for Three (ABC Edit)
"""
1≤|SA|≤100
1≤|SB|≤100
1≤|SC|≤100
SA、SB、SC に含まれる文字はそれぞれ a、b、c のいずれか
"""
import sys
test_mode = False
S_A = list(str(input()))
S_B = list(str(input()))
S_C = list(str(input()))
def turn(player):
"""
プレイヤー player のターンを消化する関数
"""
if player == 'a': # Aのターン
card = S_A[0]
del S_A[0]
if test_mode:
print('Aのターン :', card)
if S_A == []:
print('あがり', sys.stderr)
return 'A'
turn(card)
if player == 'b': # Bのターン
card = S_B[0]
del S_B[0]
if test_mode:
print('Bのターン :', card)
if S_B == []:
print('あがり', sys.stderr)
return 'B'
turn(card)
if player == 'c': # Cのターン
card = S_C[0]
del S_C[0]
if test_mode:
print('Cのターン :', card)
if S_C == []:
print('あがり', sys.stderr)
return 'C'
turn(card)
def main():
"""
ゲームの結果を出力
"""
print(turn('a'))
if __name__ == '__main__':
main()
|
a.cc:1:2: error: invalid preprocessing directive #!
1 | #! /usr/bin/python3
| ^
a.cc:2:3: error: "3人でカードゲームイージー" after # is not a positive integer
2 | # 3人でカードゲームイージー / Card Game for Three (ABC Edit)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:3:3: warning: missing terminating " character
3 | """
| ^
a.cc:3:3: error: missing terminating " character
a.cc:4:5: error: extended character ≤ is not valid in an identifier
4 | 1≤|SA|≤100
| ^
a.cc:4:11: error: extended character ≤ is not valid in an identifier
4 | 1≤|SA|≤100
| ^
a.cc:5:5: error: extended character ≤ is not valid in an identifier
5 | 1≤|SB|≤100
| ^
a.cc:5:11: error: extended character ≤ is not valid in an identifier
5 | 1≤|SB|≤100
| ^
a.cc:6:5: error: extended character ≤ is not valid in an identifier
6 | 1≤|SC|≤100
| ^
a.cc:6:11: error: extended character ≤ is not valid in an identifier
6 | 1≤|SC|≤100
| ^
a.cc:7:5: error: extended character 、 is not valid in an identifier
7 | SA、SB、SC に含まれる文字はそれぞれ a、b、c のいずれか
| ^
a.cc:7:5: error: extended character 、 is not valid in an identifier
a.cc:7:41: error: extended character 、 is not valid in an identifier
7 | SA、SB、SC に含まれる文字はそれぞれ a、b、c のいずれか
| ^
a.cc:7:41: error: extended character 、 is not valid in an identifier
a.cc:8:3: warning: missing terminating " character
8 | """
| ^
a.cc:8:3: error: missing terminating " character
a.cc:17:7: warning: missing terminating " character
17 | """
| ^
a.cc:17:7: error: missing terminating " character
a.cc:19:7: warning: missing terminating " character
19 | """
| ^
a.cc:19:7: error: missing terminating " character
a.cc:20:25: error: stray '#' in program
20 | if player == 'a': # Aのターン
| ^
a.cc:24:19: warning: multi-character literal with 15 characters exceeds 'int' size of 4 bytes
24 | print('Aのターン :', card)
| ^~~~~~~~~~~~~
a.cc:26:19: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
26 | print('あがり', sys.stderr)
| ^~~~~~~~
a.cc:30:25: error: stray '#' in program
30 | if player == 'b': # Bのターン
| ^
a.cc:34:19: warning: multi-character literal with 15 characters exceeds 'int' size of 4 bytes
34 | print('Bのターン :', card)
| ^~~~~~~~~~~~~
a.cc:36:19: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
36 | print('あがり', sys.stderr)
| ^~~~~~~~
a.cc:40:25: error: stray '#' in program
40 | if player == 'c': # Cのターン
| ^
a.cc:44:19: warning: multi-character literal with 15 characters exceeds 'int' size of 4 bytes
44 | print('Cのターン :', card)
| ^~~~~~~~~~~~~
a.cc:46:19: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
46 | print('あがり', sys.stderr)
| ^~~~~~~~
a.cc:52:7: warning: missing terminating " character
52 | """
| ^
a.cc:52:7: error: missing terminating " character
a.cc:54:7: warning: missing terminating " character
54 | """
| ^
a.cc:54:7: error: missing terminating " character
a.cc:57:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
57 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:3:1: error: expected unqualified-id before string constant
3 | """
| ^~
|
s359949275
|
p03998
|
C++
|
#include<stdio.h>
int main(void){
char a[100],b[100],c[100];
scanf("%s",a);
scanf("%s",b);
scanf("%s",c);
int ca=0,cb=0,cc=0;
char n="a";
char ans=0;
while(n!=0){
if(n=="a"){
ans="a";
n=a[ca];
ca++;
}else if(n=="b"){
ans="b";
n=b[cb];
cb++;
}else if(n=="c"){
ans="c";
n=c[cc];
cc++;
}
}
printf("%s\n",ans);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:10: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
12 | char n="a";
| ^~~
| |
| const char*
a.cc:17:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | if(n=="a"){
| ~^~~~~
a.cc:18:9: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
18 | ans="a";
| ^~~
| |
| const char*
a.cc:21:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
21 | }else if(n=="b"){
| ~^~~~~
a.cc:22:9: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
22 | ans="b";
| ^~~
| |
| const char*
a.cc:25:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
25 | }else if(n=="c"){
| ~^~~~~
a.cc:26:9: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
26 | ans="c";
| ^~~
| |
| const char*
|
s938905758
|
p03998
|
C++
|
#include<stdio.h>
int main(void){
char a[100],b[100],c[100];
scanf("%s",a);
scanf("%s",b);
scanf("%s",c);
int ca=0,cb=0,cc=0;
int n="a";
char ans=0;
while(n!=0){
if(n=="a"){
ans="a";
n=a[ca];
ca++;
}else if(n=="b"){
ans="b";
n=b[cb];
cb++;
}else if(n=="c"){
ans="c";
n=c[cc];
cc++;
}
}
printf("%s\n",ans);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:9: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
12 | int n="a";
| ^~~
| |
| const char*
a.cc:17:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | if(n=="a"){
| ~^~~~~
a.cc:18:9: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
18 | ans="a";
| ^~~
| |
| const char*
a.cc:21:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
21 | }else if(n=="b"){
| ~^~~~~
a.cc:22:9: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
22 | ans="b";
| ^~~
| |
| const char*
a.cc:25:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
25 | }else if(n=="c"){
| ~^~~~~
a.cc:26:9: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
26 | ans="c";
| ^~~
| |
| const char*
|
s774329402
|
p03998
|
C
|
#include<stdio.h>
#include<string.h>
char s[4][102],x_x;
int len[4],p;
int main()
{
scanf("%s %s %s",s[1],s[2],s[3]);
len[1]=strlen(s[1])-1;
len[2]=strlen(s[2])-1;
len[3]=strlen(s[3])-1;
len[4]=strlen(s[4])-1;
int gun(char x);
gun('a');
}
char gun(char x){
if(x=='a')
p=1;
else if(x=='b')
p=2;
else
p=3;
if(len[p]>=0){
x_x=s[p][len[p]];
s[p][len[p]]='\0';
len[p]--;
gun(x_x);
}
else
printf("%c",x-32);
}
|
main.c:18:6: error: conflicting types for 'gun'; have 'char(char)'
18 | char gun(char x){
| ^~~
main.c:14:13: note: previous declaration of 'gun' with type 'int(char)'
14 | int gun(char x);
| ^~~
|
s893602339
|
p03998
|
C
|
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<iostream>
using namespace std;
int main()
{
int a, b, c;
int la, lb, lc;
int i = 0;
char A[120], B[120], C[120];
cin >> A >> B >> C;
a = b = c = -1;
la = strlen(A);
lb = strlen(B);
lc = strlen(C);
while(1)
{
if(a = la)
{
printf("A\n");
break;
}
else if(b = lb)
{
printf("B\n");
break;
}
else
{
printf("C\n"); break;
}
while(1)
{
if(i == 0)
{
a++;
i = A[i] - 'a';
}
else if(i == 1)
{
b++;
i = B[i] - 'b';
}
else
{
c++;
i = C[i] - 'c';
}
}
}
return 0 ;
}
|
main.c:4:9: fatal error: iostream: No such file or directory
4 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s038871872
|
p03998
|
C++
|
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <cmath>
#include <map>
using ll = long long;
using namespace std;
int main() {
string sa, sb, sc;
cin >> sa >> sb >> sc;
queue<char> qa, qb, qc;
for (int i = 0; i < sa.size(); i++) qa.push(sa[i]);
for (int i = 0; i < sb.size(); i++) qb.push(sb[i]);
for (int i = 0; i < sc.size(); i++) qc.push(sc[i]);
char ans = 'a';
while(true){
if (ans == 'a') {
if (qa.empty()) break;
ans = qa.front();
qa.pop();
}
if (ans == 'b') {
if (qb.empty()) break;
ans = qb.front();
qb.pop();
}
if (ans == 'c') {
if (qc.empty()) break;
ans = qc.front();
qc.pop();
}
}
cout << (char)(ans + 'A' - 'a') << endl;
}
|
a.cc: In function 'int main()':
a.cc:16:3: error: 'queue' was not declared in this scope
16 | queue<char> qa, qb, qc;
| ^~~~~
a.cc:10:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
9 | #include <map>
+++ |+#include <queue>
10 | using ll = long long;
a.cc:16:9: error: expected primary-expression before 'char'
16 | queue<char> qa, qb, qc;
| ^~~~
a.cc:17:39: error: 'qa' was not declared in this scope; did you mean 'sa'?
17 | for (int i = 0; i < sa.size(); i++) qa.push(sa[i]);
| ^~
| sa
a.cc:18:39: error: 'qb' was not declared in this scope; did you mean 'sb'?
18 | for (int i = 0; i < sb.size(); i++) qb.push(sb[i]);
| ^~
| sb
a.cc:19:39: error: 'qc' was not declared in this scope; did you mean 'sc'?
19 | for (int i = 0; i < sc.size(); i++) qc.push(sc[i]);
| ^~
| sc
a.cc:23:11: error: 'qa' was not declared in this scope; did you mean 'sa'?
23 | if (qa.empty()) break;
| ^~
| sa
a.cc:24:13: error: 'qa' was not declared in this scope; did you mean 'sa'?
24 | ans = qa.front();
| ^~
| sa
a.cc:28:11: error: 'qb' was not declared in this scope; did you mean 'sb'?
28 | if (qb.empty()) break;
| ^~
| sb
a.cc:29:13: error: 'qb' was not declared in this scope; did you mean 'sb'?
29 | ans = qb.front();
| ^~
| sb
a.cc:33:11: error: 'qc' was not declared in this scope; did you mean 'sc'?
33 | if (qc.empty()) break;
| ^~
| sc
a.cc:34:13: error: 'qc' was not declared in this scope; did you mean 'sc'?
34 | ans = qc.front();
| ^~
| sc
|
s959412786
|
p03998
|
C++
|
#include<bits\stdc++.h>
using namespace std;
typedef long long ll;
#define put(n) cout<<(n)<<"\n"
#define FOR(i,num,N) for(int(i)=(num);(i)<(N);++(i))
#define RFOR(i,num,N) for(int (i)=(num);(i)>(N);--(i))
#define all(v) (v).begin() , (v).end()
#define rall(v) (v).rbegin() , (v).rend()
int main(){
string s,t,u;
cin>>s>>t>>u;
s += " "; t += " "; u += " ";
reverse(all(s));
reverse(all(t));
reverse(all(u));
char c = s.back(); s.pop_back();
while(s.size() && t.size() && u.size()){
cout<<endl;
if(c == 'a'){c = s.back(); s.pop_back();}
else if(c == 'b'){c = t.back(); t.pop_back();}
else if(c == 'c'){c = u.back(); u.pop_back();}
}
if(!s.size()) puts("A");
else if(!t.size()) puts("B");
else puts("C");
}
|
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s925740025
|
p03998
|
C++
|
#include<cstdio>
std::string s[3];
int T=0,N=0;
int main()
{
std::cin>>s[0]>>s[1]>>s[2];
while(s[N].size())
{
This=N;
N=s[T][0]-'a';
std::s[T].erase(0,1);
}
printf("%c",'A'+N);
}
|
a.cc:2:6: error: 'string' in namespace 'std' does not name a type
2 | std::string s[3];
| ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
1 | #include<cstdio>
+++ |+#include <string>
2 | std::string s[3];
a.cc: In function 'int main()':
a.cc:6:14: error: 'cin' is not a member of 'std'
6 | std::cin>>s[0]>>s[1]>>s[2];
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<cstdio>
+++ |+#include <iostream>
2 | std::string s[3];
a.cc:6:19: error: 's' was not declared in this scope
6 | std::cin>>s[0]>>s[1]>>s[2];
| ^
a.cc:9:9: error: 'This' was not declared in this scope
9 | This=N;
| ^~~~
a.cc:11:14: error: 's' is not a member of 'std'
11 | std::s[T].erase(0,1);
| ^
|
s252569167
|
p03998
|
C++
|
#include<cstdio>
string s[3];
int T=0,N=0;
int main()
{
std::cin>>s[0]>>s[1]>>s[2];
while(s[N].size())
{
This=N;
N=s[T][0]-'a';
s[T].erase(0,1);
}
printf("%c",'A'+N);
}
|
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
2 | string s[3];
| ^~~~~~
| stdin
a.cc: In function 'int main()':
a.cc:6:14: error: 'cin' is not a member of 'std'
6 | std::cin>>s[0]>>s[1]>>s[2];
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<cstdio>
+++ |+#include <iostream>
2 | string s[3];
a.cc:6:19: error: 's' was not declared in this scope
6 | std::cin>>s[0]>>s[1]>>s[2];
| ^
a.cc:9:9: error: 'This' was not declared in this scope
9 | This=N;
| ^~~~
|
s437811227
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
string array[4],name[4];
int i=0,j;
cin>>array[0]>>array[1]>>array[2];
name[0]="A";
name[1]="B";
name[2]="C";
for( ; ; ){
if(array[i].at(0)=='a'){
j=0;
}else if(array[i].at(0)=='b'){
j=1;
}else if(array[i].at(0)=='c'){
j=2;
}
if(array[i].size==0){
cout<<name[i]<<endl;
return 0;
}
array[i].erase(array[i].begin());
i=j;
}
}
|
a.cc: In function 'int main()':
a.cc:19:17: 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 '()' ?)
19 | if(array[i].size==0){
| ~~~~~~~~~^~~~
| ()
|
s676756418
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
string array[4],i=0,j,name[4];
cin>>array[0]>>array[1]>>array[2];
name[0]="A";
name[1]="B";
name[2]="C";
for( ; ; ){
if(array[i].at(0)=='a'){
j=0;
}else if(array[i].at(0)=='b'){
j=1;
}else if(array[i].at(0)=='c'){
j=2;
}
if(array[i].size==0){
cout<<name[i]<<endl;
return 0;
}
array[i].erase(array[i].begin());
i=j;
}
}
|
a.cc: In function 'int main()':
a.cc:11:13: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
11 | if(array[i].at(0)=='a'){
| ^
a.cc:12:9: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
12 | j=0;
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
817 | operator=(const basic_string& __str)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
828 | operator=(const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
840 | operator=(_CharT __c)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
858 | operator=(basic_string&& __str)
| ^~~~~~~~
a.cc:13:19: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
13 | }else if(array[i].at(0)=='b'){
| ^
a.cc:15:19: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
15 | }else if(array[i].at(0)=='c'){
| ^
a.cc:18:13: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
18 | if(array[i].size==0){
| ^
a.cc:19:17: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
19 | cout<<name[i]<<endl;
| ^
a.cc:22:10: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
22 | array[i].erase(array[i].begin());
| ^
a.cc:22:25: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
22 | array[i].erase(array[i].begin());
| ^
|
s074279738
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
string array[4],i=0,j,name[4];
cin>>array[0]>>array[1]>>array[2];
name[0]="A";
name[1]="B";
name[2]="C";
for( ; ; ){
if(array[i]=='a'){
j=0;
}else if(array[i]=='b'){
j=1;
}else if(array[i]=='c'){
j=2;
}
if(array[i].size==0){
cout<<name[i]<<endl;
return 0;
}
array[i].erase(array[i].begin());
i=j;
}
}
|
a.cc: In function 'int main()':
a.cc:11:13: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
11 | if(array[i]=='a'){
| ^
a.cc:12:9: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
12 | j=0;
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
817 | operator=(const basic_string& __str)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
828 | operator=(const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
840 | operator=(_CharT __c)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
858 | operator=(basic_string&& __str)
| ^~~~~~~~
a.cc:13:19: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
13 | }else if(array[i]=='b'){
| ^
a.cc:15:19: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
15 | }else if(array[i]=='c'){
| ^
a.cc:18:13: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
18 | if(array[i].size==0){
| ^
a.cc:19:17: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
19 | cout<<name[i]<<endl;
| ^
a.cc:22:10: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
22 | array[i].erase(array[i].begin());
| ^
a.cc:22:25: error: no match for 'operator[]' (operand types are 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
22 | array[i].erase(array[i].begin());
| ^
|
s308403028
|
p03998
|
C
|
#include<iostream>
int main()
{
char s[3][101];
for(int i = 0; i < 3; i++)
{
std::cin >> s[i];
}
int end[3];
for(int i = 0; i < 3; i++)
{
for(int j = 0;; j++)
{
if(s[i][j] == '\0')
{
end[i] = j;
break;
}
}
}
int num[3] {0, 0, 0};
while(true)
{
static int turn = 0;
switch(s[turn][num[turn]])
{
case 'a':
num[turn]++;
turn = 0;
break;
case 'b':
num[turn]++;
turn = 1;
break;
case 'c':
num[turn]++;
turn = 2;
break;
}
if(num[turn] == end[turn])
{
std::cout << (turn == 0 ? 'A' : turn == 1 ? 'B' : 'C') << std::endl;
break;
}
}
return 0;
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s229719911
|
p03998
|
C++
|
#include<bits/stdc++.h> //Ithea Myse Valgulious
namespace chtholly{
typedef long long ll;
#define re0 register int
#define rec register char
#define rel register ll
#define gc getchar
#define pc putchar
#define p32 pc(' ')
#define pl puts("")
/*By Citrus*/
inline int read(){
int x=0,f=1;char c=gc();
for (;!isdigit(c);c=gc()) f^=c=='-';
for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
return f?x:-x;
}
inline bool read(ll &x){
x=0;int f=1;char c=gc();
for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';
if (!~c) return 0;
for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
return x=f?x:-x,1;
}
template <typename mitsuha>
inline int write(mitsuha x){
if (!x) return pc(48);
if (x<0) x=-x,pc('-');
int bit[20],i,p=0;
for (;x;x/=10) bit[++p]=x%10;
for (i=p;i;--i) pc(bit[i]+48);
}
inline char fuhao(){
char c=gc();
for (;isspace(c);c=gc());
return c;
}
}using namespace chtholly;
using namespace std;
map<char,string> mp;
int main(){
for (char c='a';c<='c';++c) cin>>mp[c];
char r='a';
for (;;){
mp[r].erase(0,1);
if (mp[now].empty()) return pc(r-32),0;
r=mp[r][0];
}
}
|
a.cc: In function 'int main()':
a.cc:46:10: error: 'now' was not declared in this scope; did you mean 'pow'?
46 | if (mp[now].empty()) return pc(r-32),0;
| ^~~
| pow
|
s566337526
|
p03998
|
C++
|
#include "bits/stdc++.h"
using namespace std;
int main() {
string Sa, Sb, Sc;
cin >> Sa >> Sb >> Sc;
transform(Sa.begin(), Sa.end(), Sa.begin(), toupper);
transform(Sb.begin(), Sb.end(), Sb.begin(), toupper);
transform(Sc.begin(), Sc.end(), Sc.begin(), toupper);
char turn = 'A';
while (true) {
if (turn == 'A') {
if (Sa == "") break;
turn = Sa.at(0);
Sa = Sa.substr(1, Sa.size()-1);
}
else if (turn=='B')
{
if (Sb == "") break;
turn = Sb.at(0);
Sb = Sb.substr(1, Sb.size() - 1);
}
else if (turn=='C')
{
if (Sc == "") break;
turn = Sc.at(0);
Sc = Sc.substr(1, Sc.size() - 1);
}
}
cout << turn << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:18: error: no matching function for call to 'transform(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
9 | transform(Sa.begin(), Sa.end(), Sa.begin(), toupper);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4209:5: note: candidate: 'template<class _IIter, class _OIter, class _UnaryOperation> _OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation)'
4209 | transform(_InputIterator __first, _InputIterator __last,
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4209:5: note: template argument deduction/substitution failed:
a.cc:9:18: note: couldn't deduce template parameter '_UnaryOperation'
9 | transform(Sa.begin(), Sa.end(), Sa.begin(), toupper);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note: candidate: 'template<class _IIter1, class _IIter2, class _OIter, class _BinaryOperation> _OIter std::transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation)'
4247 | transform(_InputIterator1 __first1, _InputIterator1 __last1,
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note: candidate expects 5 arguments, 4 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _UnaryOperation)'
156 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
| ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note: candidate expects 5 arguments, 4 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator, class _BinaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator, _BinaryOperation)'
162 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
| ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note: candidate expects 6 arguments, 4 provided
a.cc:10:18: error: no matching function for call to 'transform(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
10 | transform(Sb.begin(), Sb.end(), Sb.begin(), toupper);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4209:5: note: candidate: 'template<class _IIter, class _OIter, class _UnaryOperation> _OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation)'
4209 | transform(_InputIterator __first, _InputIterator __last,
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4209:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: couldn't deduce template parameter '_UnaryOperation'
10 | transform(Sb.begin(), Sb.end(), Sb.begin(), toupper);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note: candidate: 'template<class _IIter1, class _IIter2, class _OIter, class _BinaryOperation> _OIter std::transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation)'
4247 | transform(_InputIterator1 __first1, _InputIterator1 __last1,
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note: candidate expects 5 arguments, 4 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _UnaryOperation)'
156 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
| ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note: candidate expects 5 arguments, 4 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator, class _BinaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator, _BinaryOperation)'
162 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
| ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note: candidate expects 6 arguments, 4 provided
a.cc:11:18: error: no matching function for call to 'transform(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
11 | transform(Sc.begin(), Sc.end(), Sc.begin(), toupper);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4209:5: note: candidate: 'template<class _IIter, class _OIter, class _UnaryOperation> _OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation)'
4209 | transform(_InputIterator __first, _InputIterator __last,
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4209:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: couldn't deduce template parameter '_UnaryOperation'
11 | transform(Sc.begin(), Sc.end(), Sc.begin(), toupper);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note: candidate: 'template<class _IIter1, class _IIter2, class _OIter, class _BinaryOperation> _OIter std::transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation)'
4247 | transform(_InputIterator1 __first1, _InputIterator1 __last1,
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note: candidate expects 5 arguments, 4 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _UnaryOperation)'
156 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
| ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note: candidate expects 5 arguments, 4 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator, class _BinaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator, _BinaryOperation)'
162 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
| ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note: candidate expects 6 arguments, 4 provided
|
s306432235
|
p03998
|
C++
|
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include<bits/stdc++.h>
using namespace std;
using ll =long long;
int main (void) {
vector<string> cards(3);
for (int i=0; i<3; i++) cin >> card[i];
int turn =0;
while(true){
if (card[turn].empty()){
cout << (char)('A'+turn);
break;
}
int next =cards[turn][0]-'a';
cards[turn].erase(0,1);
turn =next;
}
}
|
a.cc: In function 'int main()':
a.cc:12:34: error: 'card' was not declared in this scope; did you mean 'cards'?
12 | for (int i=0; i<3; i++) cin >> card[i];
| ^~~~
| cards
a.cc:16:9: error: 'card' was not declared in this scope; did you mean 'cards'?
16 | if (card[turn].empty()){
| ^~~~
| cards
|
s478290645
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
string S[3];
cin >> S[0] >> S[1] >> S[2];
int i=0;
while(1){
if(S[i].size()==0){
cout << (char)(t+'A');
return 0;
}
char c=S[i][0];
S[i].erase(S[i].begin());
i=c-'a';
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:40: error: 't' was not declared in this scope
11 | cout << (char)(t+'A');
| ^
|
s119726518
|
p03998
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a=0, b=0, c=0;
string A, B, C;
char X='a';
cin >> A >> B >> C;
while(1){
if(X=='a'){
X=A[i];
a++;
if(a==A.size()){
cout << 'A' << endl;
break;
}
} else if(X=='b'){
X=B[b];
b++;
if(b==B.size()){
cout << 'B' << endl;
break;
}
} else if(X=='c'){
X=C[c];
c++;
if(c==C.size()){
cout << 'C' << endl;
break;
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:11:29: error: 'i' was not declared in this scope
11 | X=A[i];
| ^
|
s045709225
|
p03998
|
C++
|
#include <iostream>
using namespace std;
int main(){
int i=0, j=0, k=0;
string SA, SB, SC;
char X='a';
cin >> SA >> SB >> SC;
while(1){
if(X=='a'){
X=a[i];
i++;
if(i==A.size()){
cout << 'A' << endl;
break;
}
} else if(X=='b'){
X=a[j];
j++;
if(j==B.size()){
cout << 'B' << endl;
break;
}
} else if(X=='c'){
X=a[k];
k++;
if(i==C.size()){
cout << 'C' << endl;
break;
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:11:27: error: 'a' was not declared in this scope
11 | X=a[i];
| ^
a.cc:13:31: error: 'A' was not declared in this scope
13 | if(i==A.size()){
| ^
a.cc:18:27: error: 'a' was not declared in this scope
18 | X=a[j];
| ^
a.cc:20:31: error: 'B' was not declared in this scope
20 | if(j==B.size()){
| ^
a.cc:25:27: error: 'a' was not declared in this scope
25 | X=a[k];
| ^
a.cc:27:31: error: 'C' was not declared in this scope
27 | if(i==C.size()){
| ^
|
s175634483
|
p03998
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int i,ia=0,ib=0,ic=0,turna=1,turnb=0,turnc=0;
char sa[101],sb[101],sc[101];
cin>>sa>>sb>>sc;
while(1){
if(turna==1) {
if(sa[ia+1]=='\0') { cout<<"a"<<endl;
return 0;
}
if(sa[ia]=='b') { turna = 0;
turnb =1
}
if(sa[ia]=='c') { turna = 0;
turnc =1
}
ia++;
}
if(turnb==1) {
if(sb[ib+1]=='\0') { cout<<"b"<<endl;
return 0;
}
if(sb[ib]=='a') { turnb = 0;
turna =1
}
if(sb[ib]=='c') { turnb = 0;
turnc =1
}
ib++;
}
if(turnc==1) {
if(sc[ic+1]=='\0') { cout<<"c"<<endl;
return 0;
}
if(sc[ic]=='a') { turnc = 0;
turna =1
}
if(sc[ic]=='b') { turnc = 0;
turnb =1
}
ic++;
}
}
}
|
a.cc: In function 'int main()':
a.cc:13:31: error: expected ';' before '}' token
13 | turnb =1
| ^
| ;
14 | }
| ~
a.cc:16:31: error: expected ';' before '}' token
16 | turnc =1
| ^
| ;
17 | }
| ~
a.cc:25:31: error: expected ';' before '}' token
25 | turna =1
| ^
| ;
26 | }
| ~
a.cc:28:31: error: expected ';' before '}' token
28 | turnc =1
| ^
| ;
29 | }
| ~
a.cc:37:31: error: expected ';' before '}' token
37 | turna =1
| ^
| ;
38 | }
| ~
a.cc:40:31: error: expected ';' before '}' token
40 | turnb =1
| ^
| ;
41 | }
| ~
|
s845352693
|
p03998
|
C++
|
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector< vector<int> > myVector;
int main(){
for(int i = 0; i < 3; i++){
string cards;
cin >> cards; //input
int n = cards.length(); //length
vector<int> myRow(n);
myVector.push_back(myRow);
char char_array[n+1];
strcpy(char_array, cards.c_str());
for(int x = 0; x < int(sizeof(char_array)-1); x++){
//cout << char_array[x] << endl;
if('a' == char_array[x]){
myVector[i].push_back(0);
} else if('b' == char_array[x]) {
myVector[i].push_back(1);
} else if('c' == char_array[x]) {
myVector[i].push_back(2);
}
}
}
//cout << myVector[0].size() << myVector[1].size() << myVector[2].size() << endl;
int cot = 0;
char arr[3] = {'A', 'B', 'C'};
while(true){
if(myVector[cot].size() == 0){
cout << arr[cot] << endl;
exit(1);
}
cot = int(myVector[cot][0]);
myVector[cot].erase(myVector[cot].begin());
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:17: error: 'strcpy' was not declared in this scope
18 | strcpy(char_array, cards.c_str());
| ^~~~~~
a.cc:4:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <vector>
+++ |+#include <cstring>
4 | using namespace std;
|
s306621725
|
p03998
|
C++
|
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}
int main(){
string s[3];
rep(i, 3) cin>>s[i];
rep(i, 3) reverse(all(s[i]));
int p = 0;
while(!s[p].empty()){
int p2 = s[p].back()-'a';
s[p].erase(s.end()-1);
p = p2;
}
cout<<(char)('A'+p)<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:48:18: error: request for member 'end' in 's', which is of non-class type 'std::string [3]' {aka 'std::__cxx11::basic_string<char> [3]'}
48 | s[p].erase(s.end()-1);
| ^~~
|
s696027008
|
p03998
|
C++
|
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}
int main(){
string s[3];
rep(i, 3) cin>>s[i];
rep(i, 3) reverse(all(s));
int p = 0;
while(!s[p].empty()){
int p2 = s[p].back()-'a';
s[p].erase(s.end()-1);
p = p2;
}
cout<<(char)('A'+p)<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:30:20: error: request for member 'begin' in 's', which is of non-class type 'std::string [3]' {aka 'std::__cxx11::basic_string<char> [3]'}
30 | #define all(v) (v).begin(), (v).end()
| ^~~~~
a.cc:44:21: note: in expansion of macro 'all'
44 | rep(i, 3) reverse(all(s));
| ^~~
a.cc:30:33: error: request for member 'end' in 's', which is of non-class type 'std::string [3]' {aka 'std::__cxx11::basic_string<char> [3]'}
30 | #define all(v) (v).begin(), (v).end()
| ^~~
a.cc:44:21: note: in expansion of macro 'all'
44 | rep(i, 3) reverse(all(s));
| ^~~
a.cc:48:18: error: request for member 'end' in 's', which is of non-class type 'std::string [3]' {aka 'std::__cxx11::basic_string<char> [3]'}
48 | s[p].erase(s.end()-1);
| ^~~
|
s281574703
|
p03998
|
C++
|
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;
int main(int argc, char const *argv[]) {
ios_base::sync_with_stdio(false);
queue<int> q[3];
FOR(i, 3) {
string s;
cin >> s;
FOR(j, s.size()) q[i].push(s[j]-'a');
}
int x = 0;
while (!q[x].empty()) {
int next = q[x].top();
q[x].pop();
x = next;
}
cout << (char)('A'+x) << endl;
return 0;
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:19:33: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
19 | int next = q[x].top();
| ^~~
| pop
|
s343706165
|
p03998
|
C++
|
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<functional>
#include<cstring>
using namespace std;
int main(void){
int i,abcp[3],abcl[3],p;
char abc[3][101],x;
for(i=0;i<3;i++){
cin>>abc[i];
abcl[i]=strlen(abc[i]);
abcp[i]=0
}
p=0;
while(1){
if(abcp[p]==abcl[p]) break;
x=abc[p][abcp[p]];
abcp[p]++;
if(x=='a') p=0;
if(x=='b') p=1;
if(x=='c') p=2;
}
if(p==0) cout<<'A'<<endl;
if(p==1) cout<<'B'<<endl;
if(p==2) cout<<'C'<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:26: error: expected ';' before '}' token
13 | abcp[i]=0
| ^
| ;
14 | }
| ~
|
s946867802
|
p03998
|
C++
|
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
int main() {
string A,B,C;
cin >> A >> B >> C;
int cnt = 0;
char tmp = 'a';
while (true) {
switch (tmp) {
case 'a':
a = A[0];
A.erase(0,1);
case 'b':
b = B[0];
B.erase(0,1);
case 'c':
c = C[0];
C.erase(0,1);
}
if (A.empty()) {
cout << "A\n";
break;
} else if (B.empty()) {
cout << "B\n";
break;
} else if (C.empty()) {
cout << "C\n";
break;
}
}
}
|
a.cc: In function 'int main()':
a.cc:18:13: error: 'a' was not declared in this scope
18 | a = A[0];
| ^
a.cc:21:13: error: 'b' was not declared in this scope
21 | b = B[0];
| ^
a.cc:24:13: error: 'c' was not declared in this scope
24 | c = C[0];
| ^
|
s525842966
|
p03998
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
int main(){
string a,b,c;
cin >> a >> b >> c;
a+='a'; b+='b'; c+='c';
int i=1;
string seq="a";
while(1){
if(a.size()==1||b.size()==1||c.size()==1){
if(a.size()==1){ cout << "A" << endl; break;}
if(b.size()==1){ cout << "B" << endl; break;}
if(c.size()==1){ cout << "C" << endl; break;}
}
else{
if(seq[i-1]=='a'){
a.erase(a.begin());
if(a[0]=='a')seq+='a';
else if(a[0]=='b')seq+='b';
else if(a[0]=='c')seq+='c';
}
if(S[i-1]=='b'){
b.erase(b.begin());
if(b[0]=='a')seq+='a';
else if(b[0]=='b')seq+='b';
else if(b[0]=='c')seq+='c';
}
if(S[i-1]=='c'){
c.erase(c.begin());
if(c[0]=='a')seq+='a';
else if(c[0]=='b')seq+='b';
else if(c[0]=='c')seq+='c';
}
}
i++;
}
}
|
a.cc: In function 'int main()':
a.cc:26:10: error: 'S' was not declared in this scope
26 | if(S[i-1]=='b'){
| ^
a.cc:32:10: error: 'S' was not declared in this scope
32 | if(S[i-1]=='c'){
| ^
|
s652804075
|
p03998
|
C++
|
#include <bits/stdc++.h>
#include <string>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
using namespace std;
int main() {
string a[3];
cin >> a[0] >> a[1] >> a[2];
int p = 0;
for (;;) {
if (a[p].size() == 0) {
cout << static_cast<char>(p + 'A') << endl;
return 0;
}
int q = a[p][0] - 'a';
a[p] = a[p].substr(1);
p = q;
}
}
return 0;
}
|
a.cc:21:5: error: expected unqualified-id before 'return'
21 | return 0;
| ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
22 | }
| ^
|
s397119635
|
p03998
|
C++
|
#include <bits/stdc++.h>
#include <string>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
using namespace std;
int main() {
vector<string> s(3);
int key = 0;
cin >> s[0] >> s[1] >> s[2];
while (s[key].size() > 0) {
int ans = s[key] - 'a';
if (s[key].size() == 1)
s[key] = "";
else
s[key] = s[key].substr(1);
key = ans;
if (key == 0)
cout << "A" << endl;
if (key == 1)
cout << "B" << endl;
if (key == 2)
cout << "C" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:22: error: no match for 'operator-' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} and 'char')
12 | int ans = s[key] - 'a';
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:12:24: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
12 | int ans = s[key] - 'a';
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:12:24: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
12 | int ans = s[key] - 'a';
| ^~~
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:370:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const complex<_Tp>&)'
370 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:370:5: note: template argument deduction/substitution failed:
a.cc:12:24: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
12 | int ans = s[key] - 'a';
| ^~~
/usr/include/c++/14/complex:379:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const _Tp&)'
379 | operator-(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:379:5: note: template argument deduction/substitution failed:
a.cc:12:24: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
12 | int ans = s[key] - 'a';
| ^~~
/usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)'
388 | operator-(const _Tp& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed:
a.cc:12:24: note: mismatched types 'const std::complex<_Tp>' and 'char'
12 | int ans = s[key] - 'a';
| ^~~
/usr/include/c++/14/complex:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)'
465 | operator-(const complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:12:24: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
12 | int ans = s[key] - 'a';
| ^~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:12:24: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
12 | int ans = s[key] - 'a';
| ^~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:12:24: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'char'
12 | int ans = s[key] - 'a';
| ^~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:12:24: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
12 | int ans = s[key] - 'a';
| ^~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:12:24: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'char'
12 | int ans = s[key] - 'a';
| ^~~
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:12:24: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
12 | int ans = s[key] - 'a';
| ^~~
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:12:24: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
12 | int ans = s[key] - 'a';
| ^~~
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos
|
s834897054
|
p03998
|
C
|
include <stdio.h>
char A(char q[100],int a);
char B(char w[100],int s);
char C(char e[100],int d);
int main() {
char a[100],b[100],c[100],ans,result;
int i,j,k;
i=j=k=0;
scanf("%s %s %s",a,b,c);
ans = A(a,i);
i++;
while(ans != '\0'){
if(ans == 'a'){
ans = A(a,i);
i++;
result = 'A';
}
else if(ans == 'b'){
ans = B(b,j);
j++;
result='B';
}
else {
ans = C(c,k);
k++;
result='C';
}
}
printf("%c",result);
return 0;
}
char A(char a[100],int i){
char q;
q = a[i];
return q;
}
char B(char b[100],int j){
char q;
q = b[j];
return q;
}
char C(char c[100],int k){
char q;
q = c[k];
return q;
}
|
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
main.c: In function 'main':
main.c:14:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
14 | scanf("%s %s %s",a,b,c);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | include <stdio.h>
main.c:14:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
14 | scanf("%s %s %s",a,b,c);
| ^~~~~
main.c:14:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:16:7: error: implicit declaration of function 'A' [-Wimplicit-function-declaration]
16 | ans = A(a,i);
| ^
main.c:37:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
37 | printf("%c",result);
| ^~~~~~
main.c:37:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:37:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:37:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:42:6: error: conflicting types for 'A'; have 'char(char *, int)'
42 | char A(char a[100],int i){
| ^
main.c:16:7: note: previous implicit declaration of 'A' with type 'int()'
16 | ans = A(a,i);
| ^
|
s477602149
|
p03998
|
C++
|
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
#define out(s) cout<<(s)<<endl;
using ll = long long;
int main()
{
string A, B, C;
cin >> A >> B >> C;
char next = 'a';
while (true) {
if (next == 'a') {
if (A.size() == 0)break;
next = A[0];
A = A.substr(1);
}
else if (next == 'b') {
if (B.size() == 0)break;
next = B[0];
B = B.substr(1);
}
else {
if (C.size() == 0)break;
next = C[0];
C = C.substr(1);
}
}
next = toupper(next);
out(next);
return 0;
}
|
a.cc:6:1: error: extended character is not valid in an identifier
6 |
| ^
a.cc:7:1: error: extended character is not valid in an identifier
7 |
| ^
a.cc:11:1: error: extended character is not valid in an identifier
11 |
| ^
a.cc:6:1: error: '\U000000a0' does not name a type
6 |
| ^
a.cc:11:1: error: '\U000000a0' does not name a type
11 |
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.