submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s811283735 | p03880 | C++ | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
void toBinary(ll x){
char s[100];
ltoa(x , s , 2);
cout << s << endl;
}
bool comp(int a , int b){
return (a &-a) > (b & -b) ;
}
const int N = 1e5 + 5 ;
int a[N];
int main()
{
// 1010
int n ;
cin >> n ;
int xo = 0 ;
for(int i =0 ; i < n ; i ++){
cin >> a[i];
xo ^= a[i];
}
int res = 0 ;
sort(a , a + n , comp );
for(int i =0 ; i < n ; i ++)
{
int x = a[i];
if(( x & -x ) & xo){
xo = (xo ^ a[i]);
xo ^= (a[i] -1);
res ++ ;
}
}
if(!xo){
cout << res << endl;
}else {
puts("-1");
}
return 0;
}
| a.cc: In function 'void toBinary(ll)':
a.cc:8:5: error: 'ltoa' was not declared in this scope
8 | ltoa(x , s , 2);
| ^~~~
|
s607609393 | p03880 | C++ | #include <bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
#define X first
#define Y second
#define endl '\n'
#define all(o) o.begin(), o.end()
#define IOS ios::sync_with_stdio(0), cin.tie(0)
struct space{
vector<ll> v;
bool add(ll val){
for(auto i : v)
if(val & (i & -i)) val ^= i;
if(!val) return false;
for(int i=0; i<v.size(); i++)
if(val & -val & v[i]) v[i] ^= val;
v.push_back(val);
return true;
}
void clear(){v.clear();}
int size(){return int(v.size());}
int num(ll val){
int cnt = 0;
for(auto i : v)
if(val & (i & -i)) val ^= i, cnt++;
if(!val) return cnt;
return -1;
}
};
main(){
space s;
int n;
cin >> n;
int xs = 0;
for(int i=0; i<n; i++){
int x;
cin >> x;
s.add(x ^ (x - 1));
xs ^= x;
}
cout << s.num(xs) << endl;
}
| a.cc: In member function 'long long int space::size()':
a.cc:3:13: error: expected primary-expression before 'long'
3 | #define int long long
| ^~~~
a.cc:26:23: note: in expansion of macro 'int'
26 | int size(){return int(v.size());}
| ^~~
a.cc:3:13: error: expected ';' before 'long'
3 | #define int long long
| ^~~~
a.cc:26:23: note: in expansion of macro 'int'
26 | int size(){return int(v.size());}
| ^~~
a.cc:3:13: error: expected primary-expression before 'long'
3 | #define int long long
| ^~~~
a.cc:26:23: note: in expansion of macro 'int'
26 | int size(){return int(v.size());}
| ^~~
a.cc: At global scope:
a.cc:35:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
35 | main(){
| ^~~~
|
s734452870 | p03880 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int MAX_N = (int)1e5 + 5;
bool used[MAX_N]; // この数字を使ったかどうか
bool change[MAX_N]; // この桁が1引く事によって変化するかどうか
int main()
{
memset(used, false, sizeof(used));
ios_base::sync_with_stdio(0);
cin.tie(0);
int N; cin >> N;
vector<int> a(N, 0);
rep (i, N) cin >> a[i];
int res = 0;
for(int digit = 31; digit >= 0; --digit){
memset(cand, false, sizeof(cand));
memset(change, false, sizeof(change));
int cnt = 0;
rep (i, N){
if (a[i] & (1<<digit)){
++cnt;
if (!used[i] && !((a[i] - 1) & (1<<digit))) change[i] |= true;
} // end if
} // end rep
if (cnt % 2 == 0){
rep (i, N) used[i] |= change[i]; // 1 引いて変化するものはもう使えない。よって使ったにフラグ。
}else{
bool one = false;
rep (i, N){
if (!used[i] && change[i]){
if (!one){
--a[i];
++res;
one |= true;
} // end if
used[i] |= true;
} // end if
} // end rep
if (!one){ // 一個もない
res = -1;
break;
} // end if
} // end if
} // end for
cout << res << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:27:24: error: 'cand' was not declared in this scope; did you mean 'rand'?
27 | memset(cand, false, sizeof(cand));
| ^~~~
| rand
|
s291631296 | p03880 | C++ | #include <bits/stdc++.h>
using namespace std;
int n, a[100009], b[100009];
int main() {
scanf("%d", &n);
for(int i = 0; i < n; i++) scanf("%d", &a[i]);
bool flag = true;
for(int i = 30; i >= 0 && flag; i--) {
int s = 0;
for(int j = 0; j < n; j++) s ^= (a[j] >> i) & 1;
if(s == 1) {
bool ok = false;
for(int j = 0; j < n && !ok; j++) {
if(!b[j] && a[j] >> i << i == a[j]) {
a[j]--;
b[j] = 1;
ok = true;
}
}
if(!ok) flag = false;
}
}
int ss = 0;
for(int i = 0; i < n; i++) ss ^= a[j];
if(ss != 0) flag = false;
if(!flag) printf("-1\n");
else {
int ret = 0;
for(int i = 0; i < n; i++) ret += b[i];
printf("%d\n", ret);
}
} | a.cc: In function 'int main()':
a.cc:24:44: error: 'j' was not declared in this scope
24 | for(int i = 0; i < n; i++) ss ^= a[j];
| ^
|
s242540949 | p03880 | C++ | #include <stdio.h>
int main(void)
{
int N, M[100000], S[30] = {0};
int i,j, a = 0;
scanf("%d", &N);
for (i = 0; i < N; i++) scanf("%d", &M[i]);
for (j = 0; j < N; j++ ) {
for (i = 0; i < 30; i++) {
S[i] += (M[j]>>i&1);
}
}
for (i = 0; i < 30; i++) {
if (S[i] % 2) a++;
}
}
printf("%d", a);
return 0;
} | a.cc:23:15: error: expected constructor, destructor, or type conversion before '(' token
23 | printf("%d", a);
| ^
a.cc:25:9: error: expected unqualified-id before 'return'
25 | return 0;
| ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
26 | }
| ^
|
s845315061 | p03880 | C++ | #include <bits/stdc++.h>
#ifdef AZN
#include "Azn.cpp"
#else
#define pln(...)
#endif
using namespace std;
typedef long long ll;
typedef double dd;
void solve(ll test_num) {
(void) test_num;
int N;
cin >> N;
vector<int> arr(N);
for (int& a : arr) cin >> a;
int xsum = 0;
set<int> have;
for (int a : arr) {
xsum ^= a;
have.insert(__builtin_ctz(a));
}
dbgln(xsum);
int res = 0;
for (int bit = 30; bit >= 0; --bit) {
if (xsum >> bit & 1) {
if (!have.count(bit)) {
cout << "-1\n";
return;
}
++res;
xsum ^= (1 << bit) - 1;
}
}
cout << res << endl;
}
void init() {
}
int main() {
#ifdef AZN
const auto start_time = chrono::system_clock::now();
freopen("/home/azneye/Documents/Stuff/input.txt", "r", stdin);
#endif
ios::sync_with_stdio(false);
cin.tie(nullptr);
init();
ll tests = 1;
//cin >> tests;
for (ll test = 1; test <= tests; ++test) {
solve(test);
}
#ifdef AZN
cerr << "Took: " << ((chrono::system_clock::now() - start_time).count() / 1e9) << " s" << endl;
#endif
return 0;
} | a.cc: In function 'void solve(ll)':
a.cc:28:3: error: 'dbgln' was not declared in this scope
28 | dbgln(xsum);
| ^~~~~
|
s725090044 | p03881 | C++ | // #include {{{
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
// }}}
// #define {{{
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// }}}
db p[6] , q[6];
int main(){
rep(i,0,6) cin >> p[i] , p[i] /= 100;
rep(i,0,6) cin >> q[i] , q[i] /= 100;
function<db(db)> get = [&](db x) -> db {
db res = 0;
rep(i,0,6) res += max(x * p[i] , (1 - x) * q[i]);
return res;
};
db l = 0 , r = 1;
rep(i,0,200) {
db m1 = (2 * l + r) / 3;
db m2 = (l + r * 2) / 3;
if(get(m1) < get(m2))
r = m2;
else
l = m1;
}
printf("%.12f\n",get((l + r) / 2));
return 0;
}
| a.cc: In function 'int main()':
a.cc:42:3: error: 'function' was not declared in this scope
42 | function<db(db)> get = [&](db x) -> db {
| ^~~~~~~~
a.cc:19:1: note: 'std::function' is defined in header '<functional>'; this is probably fixable by adding '#include <functional>'
18 | #include <algorithm>
+++ |+#include <functional>
19 | using namespace std;
a.cc:42:14: error: expected primary-expression before '(' token
42 | function<db(db)> get = [&](db x) -> db {
| ^
a.cc:42:17: error: expected primary-expression before ')' token
42 | function<db(db)> get = [&](db x) -> db {
| ^
a.cc:51:11: error: no matching function for call to 'get(db&)'
51 | if(get(m1) < get(m2))
| ~~~^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:2:
/usr/include/c++/14/bits/stl_pair.h:1250:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(pair<_Tp1, _Tp2>&)'
1250 | get(pair<_Tp1, _Tp2>& __in) noexcept
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1250:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'std::pair<_Tp1, _Tp2>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:1255:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(pair<_Tp1, _Tp2>&&)'
1255 | get(pair<_Tp1, _Tp2>&& __in) noexcept
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1255:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'std::pair<_Tp1, _Tp2>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:1260:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const pair<_Tp1, _Tp2>&)'
1260 | get(const pair<_Tp1, _Tp2>& __in) noexcept
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1260:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'const std::pair<_Tp1, _Tp2>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:1265:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(const pair<_Tp1, _Tp2>&&)'
1265 | get(const pair<_Tp1, _Tp2>&& __in) noexcept
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1265:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'const std::pair<_Tp1, _Tp2>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2445:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(tuple<_Elements ...>&)'
2445 | get(tuple<_Elements...>& __t) noexcept
| ^~~
/usr/include/c++/14/tuple:2445:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'std::tuple<_Elements ...>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/tuple:2451:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(const tuple<_Elements ...>&)'
2451 | get(const tuple<_Elements...>& __t) noexcept
| ^~~
/usr/include/c++/14/tuple:2451:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'const std::tuple<_Elements ...>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/tuple:2457:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >&& std::get(tuple<_Elements ...>&&)'
2457 | get(tuple<_Elements...>&& __t) noexcept
| ^~~
/usr/include/c++/14/tuple:2457:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'std::tuple<_Elements ...>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/tuple:2466:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >&& std::get(const tuple<_Elements ...>&&)'
2466 | get(const tuple<_Elements...>&& __t) noexcept
| ^~~
/usr/include/c++/14/tuple:2466:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'const std::tuple<_Elements ...>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:138:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp& std::get(array<_Tp, _Nm>&)'
138 | get(array<_Tp, _Nm>&) noexcept;
| ^~~
/usr/include/c++/14/bits/stl_pair.h:138:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'std::array<_Tp, _Nm>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:142:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp&& std::get(array<_Tp, _Nm>&&)'
142 | get(array<_Tp, _Nm>&&) noexcept;
| ^~~
/usr/include/c++/14/bits/stl_pair.h:142:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'std::array<_Tp, _Nm>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:146:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const array<_Tp, _Nm>&)'
146 | get(const array<_Tp, _Nm>&) noexcept;
| ^~~
/usr/include/c++/14/bits/stl_pair.h:146:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'const std::array<_Tp, _Nm>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:150:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp&& std::get(const array<_Tp, _Nm>&&)'
150 | get(const array<_Tp, _Nm>&&) noexcept;
| ^~~
/usr/include/c++/14/bits/stl_pair.h:150:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'const std::array<_Tp, _Nm>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:1272:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(pair<_T1, _T2>&)'
1272 | get(pair<_Tp, _Up>& __p) noexcept
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1272:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'std::pair<_T1, _T2>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:1277:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const pair<_T1, _T2>&)'
1277 | get(const pair<_Tp, _Up>& __p) noexcept
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1277:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'const std::pair<_T1, _T2>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:1282:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(pair<_T1, _T2>&&)'
1282 | get(pair<_Tp, _Up>&& __p) noexcept
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1282:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'std::pair<_T1, _T2>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:1287:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const pair<_T1, _T2>&&)'
1287 | get(const pair<_Tp, _Up>&& __p) noexcept
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1287:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'const std::pair<_T1, _T2>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:1292:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(pair<_Up, _Tp>&)'
1292 | get(pair<_Up, _Tp>& __p) noexcept
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1292:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'std::pair<_Up, _Tp>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~
/usr/include/c++/14/bits/stl_pair.h:1297:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const pair<_Up, _Tp>&)'
1297 | get(const pair<_Up, _Tp>& __p) noexcept
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1297:5: note: template argument deduction/substitution failed:
a.cc:51:11: note: mismatched types 'const std::pair<_Up, _Tp>' and 'db' {aka 'double'}
51 | if(get(m1) < get(m2))
| ~~~^~~~ |
s496604608 | p03881 | C | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
typedef long long ll;
int main(){
int aa[6],ba[6];
rep(i,6){
cin >> aa[i];
}
rep(i,6){
cin >> ba[i];
}
double a=0,b=0;
rep(i,6){
if(aa[i]==ba[i]){
a += aa[i]*0.005;
b += ba[i]*0.005;
}else if(aa[i] > ba[i]){
b+= ba[i]*0.01;
}else if(aa[i]<ba[i]){
a+= aa[i]*0.01;
}
//cout << a << ":" << b << " ";
}
if(a>b) printf("%.12lf\n", 1-a);
else printf("%.12lf\n", 1-b);
return 0;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s719568097 | p03882 | C++ | 15
335279264 849598327 822889311
446755913 526239859 548830120
181424399 715477619 342858071
625711486 448565595 480845266
647639160 467825612 449656269
160714711 336869678 545923679
61020590 573085537 816372580
626006012 389312924 135599877
547865075 511429216 605997004
561330066 539239436 921749002
650693494 63219754 786119025
849028504 632532642 655702582
285323416 611583586 211428413
990607689 590857173 393671555
560686330 679513171 501983447 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 15
| ^~
|
s194927291 | p03883 | C++ | #include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
template<typename T, typename U> static void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if(x < y) x = y; }
template<int... Sizes>
struct MultidimensionalIndex;
template<>
struct MultidimensionalIndex<> {
MultidimensionalIndex() {}
int getTotalSize() const { return 1; }
int getIndexAcc(int acc) const { return acc; }
};
template<int Head, int... Tail>
struct MultidimensionalIndex<Head, Tail...> : MultidimensionalIndex<Tail...> {
using Base = MultidimensionalIndex<Tail...>;
enum { size = Head };
template<typename... TailT>
MultidimensionalIndex(TailT... tail) : Base(tail...) {}
int getTotalSize() const { return size * Base::getTotalSize(); }
template<typename... TailT>
int getIndexAcc(int acc, int head, TailT... tail) const { return Base::getIndexAcc(acc * size + head, tail...); }
};
template<int... Tail>
struct MultidimensionalIndex<0, Tail...> : MultidimensionalIndex<Tail...> {
using Base = MultidimensionalIndex<Tail...>;
const int size;
template<typename... TailT>
MultidimensionalIndex(int head, TailT... tail) : size(head), MultidimensionalIndex<Tail...>(tail...) {}
int getTotalSize() const { return size * Base::getTotalSize(); }
template<typename... TailT>
int getIndexAcc(int acc, int head, TailT... tail) const { return Base::getIndexAcc(acc * size + head, tail...); }
};
template<typename Val, int... Sizes>
struct DP : MultidimensionalIndex<Sizes...> {
std::vector<Val> dp;
template<typename... SizesT>
DP(Val init, SizesT... sizes) : MultidimensionalIndex<Sizes...>(sizes...), dp(MultidimensionalIndex<Sizes...>::getTotalSize(), init) {}
template<typename... SizesT>
Val &operator()(SizesT... indices) { return dp[getIndexAcc(0, indices...)]; }
template<typename... SizesT>
Val operator()(SizesT... indices) const { return dp[getIndexAcc(0, indices...)]; }
void swap(DP &that) { dp.swap(that); }
};
struct Interval {
int L, R, X;
bool operator<(const Interval &that) const {
return X < that.X;
}
};
int main() {
int N;
while(~scanf("%d", &N)) {
vector<Interval> intervals(N);
rep(i, N) {
int L; int R;
scanf("%d%d", &L, &R);
intervals[i] = { L, R, L + R };
}
sort(intervals.begin(), intervals.end());
reverse(intervals.begin(), intervals.end());
DP<ll, 0, 0, 2> dp(INFL, N + 1, N + 1);
dp(0, 0, 0) = 0;
rep(i, N) {
const Interval a = intervals[i];
rer(l, 0, i) rep(c, l == i ? 1 : 2) {
int r = i - l - c;
ll x = dp(l, r, c);
if(x == INFL) continue;
amin(dp(l + 1, r, c), x + a.R + (ll)a.X * l);
amin(dp(l, r + 1, c), x + a.L + (ll)a.X * r);
if(c == 0)
amin(dp(l, r, c + 1), x + (ll)a.X * (N / 2));
}
}
ll ans = INFL;
rer(l, 0, N - N % 2) {
int r = N - N % 2 - l;
amin(ans, dp(l, r, N % 2));
}
printf("%lld\n", ans);
}
return 0;
}
| a.cc: In instantiation of 'Val& DP<Val, Sizes>::operator()(SizesT ...) [with SizesT = {int, int, int}; Val = long long int; int ...Sizes = {0, 0, 2}]':
a.cc:71:5: required from here
71 | dp(0, 0, 0) = 0;
| ~~^~~~~~~~~
a.cc:46:67: error: 'getIndexAcc' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
46 | Val &operator()(SizesT... indices) { return dp[getIndexAcc(0, indices...)]; }
| ~~~~~~~~~~~^~~~~~~~~~~~~~~
a.cc:46:67: note: declarations in dependent base 'MultidimensionalIndex<0, 0, 2>' are not found by unqualified lookup
a.cc:46:67: note: use 'this->getIndexAcc' instead
|
s055623972 | p03883 | C++ | #include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#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 gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("0"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
using namespace std;
typedef long long int ll;
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;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 5005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
int main() {
int n;
scanf("%d",&n);
if (n == 1) dame;
vp p(n);
rep(i,n) scanf("%d%d",&p[i].fi,&p[i].se);
sort(rng(p),[&](P a, P b){
return a.fi+a.se > b.fi+b.se;
});
vl dp(1,LINF);
dp[0] = 0;
vl d;
rep(k,n) {
d = vl(k+2,LINF);
swap(dp,d);
ll l = p[k].fi, r = p[k].se, w = r+l;
rep(j,k+1) {
int g = k-j;
mins(dp[j], d[j]+r+w*g);
mins(dp[j+1], d[j]+l+w*j);
}
}
ll ans = LINF;
rep(i,n+1) mins(ans,dp[i]);
rep(i,n) {
ll l = p.back().fi, r = p.back().se;
int j = n-1-i;
mins(ans, d[i]+r*i+l*j);
}
cout<<ans<<endl;
return 0;
}
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#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 gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("0"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
using namespace std;
typedef long long int ll;
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;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 5005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
int main() {
int n;
scanf("%d",&n);
if (n == 1) dame;
vp p(n);
rep(i,n) scanf("%d%d",&p[i].fi,&p[i].se);
sort(rng(p),[&](P a, P b){
return a.fi+a.se > b.fi+b.se;
});
vl dp(1,LINF);
dp[0] = 0;
vl d;
rep(k,n) {
d = vl(k+2,LINF);
swap(dp,d);
ll l = p[k].fi, r = p[k].se, w = r+l;
rep(j,k+1) {
int g = k-j;
mins(dp[j], d[j]+r+w*g);
mins(dp[j+1], d[j]+l+w*j);
}
}
ll ans = LINF;
rep(i,n+1) mins(ans,dp[i]);
rep(i,n) {
ll l = p.back().fi, r = p.back().se;
int j = n-1-i;
mins(ans, d[i]+r*i+l*j);
}
cout<<ans<<endl;
return 0;
}
| a.cc:169:12: error: redefinition of 'int in()'
169 | inline int in() { int x; scanf("%d",&x); return x;}
| ^~
a.cc:46:12: note: 'int in()' previously defined here
46 | inline int in() { int x; scanf("%d",&x); return x;}
| ^~
a.cc:170:13: error: redefinition of 'void priv(vi)'
170 | inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
| ^~~~
a.cc:47:13: note: 'void priv(vi)' previously defined here
47 | inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
| ^~~~
a.cc:171:30: error: redefinition of 'template<class T> std::istream& operator>>(std::istream&, std::vector<_Tp>&)'
171 | template<typename T>istream& operator>>(istream&i,vector<T>&v)
| ^~~~~~~~
a.cc:48:30: note: 'template<class T> std::istream& operator>>(std::istream&, std::vector<_Tp>&)' previously declared here
48 | template<typename T>istream& operator>>(istream&i,vector<T>&v)
| ^~~~~~~~
a.cc:173:28: error: redefinition of 'template<class T> std::string join(std::vector<_Tp>&)'
173 | template<typename T>string join(vector<T>&v)
| ^~~~
a.cc:50:28: note: 'template<class T> std::string join(std::vector<_Tp>&)' previously declared here
50 | template<typename T>string join(vector<T>&v)
| ^~~~
a.cc:175:30: error: redefinition of 'template<class T> std::ostream& operator<<(std::ostream&, std::vector<_Tp>&)'
175 | template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
| ^~~~~~~~
a.cc:52:30: note: 'template<class T> std::ostream& operator<<(std::ostream&, std::vector<_Tp>&)' previously declared here
52 | template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
| ^~~~~~~~
a.cc:177:43: error: redefinition of 'template<class T1, class T2> std::istream& operator>>(std::istream&, std::pair<_T1, _T2>&)'
177 | template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
| ^~~~~~~~
a.cc:54:43: note: 'template<class T1, class T2> std::istream& operator>>(std::istream&, std::pair<_T1, _T2>&)' previously declared here
54 | template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
| ^~~~~~~~
a.cc:179:43: error: redefinition of 'template<class T1, class T2> std::ostream& operator<<(std::ostream&, std::pair<_T1, _T2>&)'
179 | template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
| ^~~~~~~~
a.cc:56:43: note: 'template<class T1, class T2> std::ostream& operator<<(std::ostream&, std::pair<_T1, _T2>&)' previously declared here
56 | template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
| ^~~~~~~~
a.cc:181:11: error: redefinition of 'const int MX'
181 | const int MX = 5005, INF = 1001001001;
| ^~
a.cc:58:11: note: 'const int MX' previously defined here
58 | const int MX = 5005, INF = 1001001001;
| ^~
a.cc:181:22: error: redefinition of 'const int INF'
181 | const int MX = 5005, INF = 1001001001;
| ^~~
a.cc:58:22: note: 'const int INF' previously defined here
58 | const int MX = 5005, INF = 1001001001;
| ^~~
a.cc:182:10: error: redefinition of 'const ll LINF'
182 | const ll LINF = 1e18;
| ^~~~
a.cc:59:10: note: 'const ll LINF' previously defined here
59 | const ll LINF = 1e18;
| ^~~~
a.cc:183:14: error: redefinition of 'const double eps'
183 | const double eps = 1e-10;
| ^~~
a.cc:60:14: note: 'const double eps' previously defined here
60 | const double eps = 1e-10;
| ^~~
a.cc:186:5: error: redefinition of 'int main()'
186 | int main() {
| ^~~~
a.cc:63:5: note: 'int main()' previously defined here
63 | int main() {
| ^~~~
|
s995299555 | p03887 | C++ | asasasas | a.cc:1:1: error: 'asasasas' does not name a type
1 | asasasas
| ^~~~~~~~
|
s373546093 | p03887 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <math.h>
#include <set>
#define FOR(i, n, m) for(ll i = n; i < (int)m; i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define pb push_back
using namespace std;
using ll = std::int_fast64_t;
using P = pair<ll, ll>;
constexpr ll inf = 1000000000;
constexpr ll mod = 1000000007;
constexpr long double eps = 1e-15;
template<typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2> p) {
os << to_string(p.first) << " " << to_string(p.second);
return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
REP(i, v.size()) {
if(i) os << " ";
os << to_string(v[i]);
}
return os;
}
struct modint {
ll n;
public:
modint(const ll n = 0) : n((n % mod + mod) % mod) {}
static modint pow(modint a, int m) {
modint r = 1;
while(m > 0) {
if(m & 1) { r *= a; }
a = (a * a); m /= 2;
}
return r;
}
modint &operator++() { *this += 1; return *this; }
modint &operator--() { *this -= 1; return *this; }
modint operator++(int) { modint ret = *this; *this += 1; return ret; }
modint operator--(int) { modint ret = *this; *this -= 1; return ret; }
modint operator~() const { return (this -> pow(n, mod - 2)); } // inverse
friend bool operator==(const modint& lhs, const modint& rhs) {
return lhs.n == rhs.n;
}
friend bool operator<(const modint& lhs, const modint& rhs) {
return lhs.n < rhs.n;
}
friend bool operator>(const modint& lhs, const modint& rhs) {
return lhs.n > rhs.n;
}
friend modint &operator+=(modint& lhs, const modint& rhs) {
lhs.n += rhs.n;
if (lhs.n >= mod) lhs.n -= mod;
return lhs;
}
friend modint &operator-=(modint& lhs, const modint& rhs) {
lhs.n -= rhs.n;
if (lhs.n < 0) lhs.n += mod;
return lhs;
}
friend modint &operator*=(modint& lhs, const modint& rhs) {
lhs.n = (lhs.n * rhs.n) % mod;
return lhs;
}
friend modint &operator/=(modint& lhs, const modint& rhs) {
lhs.n = (lhs.n * (~rhs).n) % mod;
return lhs;
}
friend modint operator+(const modint& lhs, const modint& rhs) {
return modint(lhs.n + rhs.n);
}
friend modint operator-(const modint& lhs, const modint& rhs) {
return modint(lhs.n - rhs.n);
}
friend modint operator*(const modint& lhs, const modint& rhs) {
return modint(lhs.n * rhs.n);
}
friend modint operator/(const modint& lhs, const modint& rhs) {
return modint(lhs.n * (~rhs).n);
}
};
istream& operator>>(istream& is, modint m) { is >> m.n; return is; }
ostream& operator<<(ostream& os, modint m) { os << m.n; return os; }
#define MAX_N 3030303
long long extgcd(long long a, long long b, long long& x, long long& y) {
long long d = a;
if (b != 0) {
d = extgcd(b, a % b, y, x);
y -= (a / b) * x;
} else {
x = 1; y = 0;
}
return d;
}
long long mod_inverse(long long a, long long m) {
long long x, y;
if(extgcd(a, m, x, y) == 1) return (m + x % m) % m;
else return -1;
}
vector<long long> fact(MAX_N+1, inf);
long long mod_fact(long long n, long long& e) {
if(fact[0] == inf) {
fact[0]=1;
if(MAX_N != 0) fact[1]=1;
for(ll i = 2; i <= MAX_N; ++i) {
fact[i] = (fact[i-1] * i) % mod;
}
}
e = 0;
if(n == 0) return 1;
long long res = mod_fact(n / mod, e);
e += n / mod;
if((n / mod) % 2 != 0) return (res * (mod - fact[n % mod])) % mod;
return (res * fact[n % mod]) % mod;
}
// return nCk
long long mod_comb(long long n, long long k) {
if(n < 0 || k < 0 || n < k) return 0;
long long e1, e2, e3;
long long a1 = mod_fact(n, e1), a2 = mod_fact(k, e2), a3 = mod_fact(n - k, e3);
if(e1 > e2 + e3) return 0;
return (a1 * mod_inverse((a2 * a3) % mod, mod)) % mod;
}
using mi = modint;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, a, b, c;
cin >> n >> a >> b >> c;
if(b % 2) {
cout << 0 << endl;
return 0;
}
mi ans = 0;
for(int i = a; i <= n; i++) {
for(int j = 0; j <= i; j++) {
int rem3 = c - (j + (i - a) * 3);
if(rem3 < 0 || j > a) continue;
mi tmp = mod_comb(i, a - j);
tmp *= mod_comb(i - (a - j), j);
if(b) {
tmp *= mod_comb(i + 1 - 1 + b / 2, b / 2);
tmp *= mod_comb(b / 2 - 1 + rem3, rem3);
}
if(!b && rem3) tmp = 0;
#include <iostream>
#include <vector>
#include <queue>
#include <math.h>
#include <set>
#define FOR(i, n, m) for(ll i = n; i < (int)m; i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define pb push_back
using namespace std;
using ll = std::int_fast64_t;
using P = pair<ll, ll>;
constexpr ll inf = 1000000000;
constexpr ll mod = 1000000007;
constexpr long double eps = 1e-15;
template<typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2> p) {
os << to_string(p.first) << " " << to_string(p.second);
return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
REP(i, v.size()) {
if(i) os << " ";
os << to_string(v[i]);
}
return os;
}
struct modint {
ll n;
public:
modint(const ll n = 0) : n((n % mod + mod) % mod) {}
static modint pow(modint a, int m) {
modint r = 1;
while(m > 0) {
if(m & 1) { r *= a; }
a = (a * a); m /= 2;
}
return r;
}
modint &operator++() { *this += 1; return *this; }
modint &operator--() { *this -= 1; return *this; }
modint operator++(int) { modint ret = *this; *this += 1; return ret; }
modint operator--(int) { modint ret = *this; *this -= 1; return ret; }
modint operator~() const { return (this -> pow(n, mod - 2)); } // inverse
friend bool operator==(const modint& lhs, const modint& rhs) {
return lhs.n == rhs.n;
}
friend bool operator<(const modint& lhs, const modint& rhs) {
return lhs.n < rhs.n;
}
friend bool operator>(const modint& lhs, const modint& rhs) {
return lhs.n > rhs.n;
}
friend modint &operator+=(modint& lhs, const modint& rhs) {
lhs.n += rhs.n;
if (lhs.n >= mod) lhs.n -= mod;
return lhs;
}
friend modint &operator-=(modint& lhs, const modint& rhs) {
lhs.n -= rhs.n;
if (lhs.n < 0) lhs.n += mod;
return lhs;
}
friend modint &operator*=(modint& lhs, const modint& rhs) {
lhs.n = (lhs.n * rhs.n) % mod;
return lhs;
}
friend modint &operator/=(modint& lhs, const modint& rhs) {
lhs.n = (lhs.n * (~rhs).n) % mod;
return lhs;
}
friend modint operator+(const modint& lhs, const modint& rhs) {
return modint(lhs.n + rhs.n);
}
friend modint operator-(const modint& lhs, const modint& rhs) {
return modint(lhs.n - rhs.n);
}
friend modint operator*(const modint& lhs, const modint& rhs) {
return modint(lhs.n * rhs.n);
}
friend modint operator/(const modint& lhs, const modint& rhs) {
return modint(lhs.n * (~rhs).n);
}
};
istream& operator>>(istream& is, modint m) { is >> m.n; return is; }
ostream& operator<<(ostream& os, modint m) { os << m.n; return os; }
#define MAX_N 3030303
long long extgcd(long long a, long long b, long long& x, long long& y) {
long long d = a;
if (b != 0) {
d = extgcd(b, a % b, y, x);
y -= (a / b) * x;
} else {
x = 1; y = 0;
}
return d;
}
long long mod_inverse(long long a, long long m) {
long long x, y;
if(extgcd(a, m, x, y) == 1) return (m + x % m) % m;
else return -1;
}
vector<long long> fact(MAX_N+1, inf);
long long mod_fact(long long n, long long& e) {
if(fact[0] == inf) {
fact[0]=1;
if(MAX_N != 0) fact[1]=1;
for(ll i = 2; i <= MAX_N; ++i) {
fact[i] = (fact[i-1] * i) % mod;
}
}
e = 0;
if(n == 0) return 1;
long long res = mod_fact(n / mod, e);
e += n / mod;
if((n / mod) % 2 != 0) return (res * (mod - fact[n % mod])) % mod;
return (res * fact[n % mod]) % mod;
}
// return nCk
long long mod_comb(long long n, long long k) {
if(n < 0 || k < 0 || n < k) return 0;
long long e1, e2, e3;
long long a1 = mod_fact(n, e1), a2 = mod_fact(k, e2), a3 = mod_fact(n - k, e3);
if(e1 > e2 + e3) return 0;
return (a1 * mod_inverse((a2 * a3) % mod, mod)) % mod;
}
using mi = modint;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, a, b, c;
cin >> n >> a >> b >> c;
if(b % 2) {
cout << 0 << endl;
return 0;
}
mi ans = 0;
for(int i = a; i <= n; i++) {
for(int j = 0; j <= i; j++) {
int rem3 = c - (j + (i - a) * 3);
if(rem3 < 0 || j > a) continue;
mi tmp = mod_comb(i, a - j);
tmp *= mod_comb(i - (a - j), j);
if(b) {
tmp *= mod_comb(i + 1 - 1 + b / 2, b / 2);
tmp *= mod_comb(b / 2 - 1 + rem3, rem3);
}
if(!b && rem3) tmp = 0;
ans += tmp;
}
}
cout << ans << endl;
return 0;
}
ans += tmp;
}
}
cout << ans << endl;
return 0;
}
| a.cc:11:17: error: 'int_fast64_t' in namespace 'std' does not name a type
11 | using ll = std::int_fast64_t;
| ^~~~~~~~~~~~
a.cc:12:16: error: 'll' was not declared in this scope
12 | using P = pair<ll, ll>;
| ^~
a.cc:12:20: error: 'll' was not declared in this scope
12 | using P = pair<ll, ll>;
| ^~
a.cc:12:22: error: template argument 1 is invalid
12 | using P = pair<ll, ll>;
| ^
a.cc:12:22: error: template argument 2 is invalid
a.cc:13:11: error: 'll' does not name a type
13 | constexpr ll inf = 1000000000;
| ^~
a.cc:14:11: error: 'll' does not name a type
14 | constexpr ll mod = 1000000007;
| ^~
a.cc: In function 'std::ostream& operator<<(std::ostream&, std::vector<_Tp>&)':
a.cc:6:26: error: 'll' was not declared in this scope
6 | #define FOR(i, n, m) for(ll i = n; i < (int)m; i++)
| ^~
a.cc:7:19: note: in expansion of macro 'FOR'
7 | #define REP(i, n) FOR(i, 0, n)
| ^~~
a.cc:23:5: note: in expansion of macro 'REP'
23 | REP(i, v.size()) {
| ^~~
a.cc:23:9: error: 'i' was not declared in this scope
23 | REP(i, v.size()) {
| ^
a.cc:6:36: note: in definition of macro 'FOR'
6 | #define FOR(i, n, m) for(ll i = n; i < (int)m; i++)
| ^
a.cc:23:5: note: in expansion of macro 'REP'
23 | REP(i, v.size()) {
| ^~~
a.cc: At global scope:
a.cc:31:5: error: 'll' does not name a type
31 | ll n;
| ^~
a.cc:33:18: error: 'll' does not name a type
33 | modint(const ll n = 0) : n((n % mod + mod) % mod) {}
| ^~
a.cc: In constructor 'modint::modint(int)':
a.cc:33:30: error: class 'modint' does not have any field named 'n'
33 | modint(const ll n = 0) : n((n % mod + mod) % mod) {}
| ^
a.cc:33:37: error: 'mod' was not declared in this scope; did you mean 'modf'?
33 | modint(const ll n = 0) : n((n % mod + mod) % mod) {}
| ^~~
| modf
a.cc: In member function 'modint modint::operator~() const':
a.cc:46:52: error: 'n' was not declared in this scope; did you mean 'yn'?
46 | modint operator~() const { return (this -> pow(n, mod - 2)); } // inverse
| ^
| yn
a.cc:46:55: error: 'mod' was not declared in this scope; did you mean 'modf'?
46 | modint operator~() const { return (this -> pow(n, mod - 2)); } // inverse
| ^~~
| modf
a.cc: In function 'bool operator==(const modint&, const modint&)':
a.cc:48:20: error: 'const struct modint' has no member named 'n'
48 | return lhs.n == rhs.n;
| ^
a.cc:48:29: error: 'const struct modint' has no member named 'n'
48 | return lhs.n == rhs.n;
| ^
a.cc: In function 'bool operator<(const modint&, const modint&)':
a.cc:51:20: error: 'const struct modint' has no member named 'n'
51 | return lhs.n < rhs.n;
| ^
a.cc:51:28: error: 'const struct modint' has no member named 'n'
51 | return lhs.n < rhs.n;
| ^
a.cc: In function 'bool operator>(const modint&, const modint&)':
a.cc:54:20: error: 'const struct modint' has no member named 'n'
54 | return lhs.n > rhs.n;
| ^
a.cc:54:28: error: 'const struct modint' has no member named 'n'
54 | return lhs.n > rhs.n;
| ^
a.cc: In function 'modint& operator+=(modint&, const modint&)':
a.cc:57:13: error: 'struct modint' has no member named 'n'
57 | lhs.n += rhs.n;
| ^
a.cc:57:22: error: 'const struct modint' has no member named 'n'
57 | lhs.n += rhs.n;
| ^
a.cc:58:17: error: 'struct modint' has no member named 'n'
58 | if (lhs.n >= mod) lhs.n -= mod;
| ^
a.cc:58:22: error: 'mod' was not declared in this scope; did you mean 'modf'?
58 | if (lhs.n >= mod) lhs.n -= mod;
| ^~~
| modf
a.cc:58:31: error: 'struct modint' has no member named 'n'
58 | if (lhs.n >= mod) lhs.n -= mod;
| ^
a.cc: In function 'modint& operator-=(modint&, const modint&)':
a.cc:62:13: error: 'struct modint' has no member named 'n'
62 | lhs.n -= rhs.n;
| ^
a.cc:62:22: error: 'const struct modint' has no member named 'n'
62 | lhs.n -= rhs.n;
| ^
a.cc:63:17: error: 'struct modint' has no member named 'n'
63 | if (lhs.n < 0) lhs.n += mod;
| ^
a.cc:63:28: error: 'struct modint' has no member named 'n'
63 | if (lhs.n < 0) lhs.n += mod;
| ^
a.cc:63:33: error: 'mod' was not declared in this scope; did you mean 'modf'?
63 | if (lhs.n < 0) lhs.n += mod;
| ^~~
| modf
a.cc: In function 'modint& operator*=(modint&, const modint&)':
a.cc:67:13: error: 'struct modint' has no member named 'n'
67 | lhs.n = (lhs.n * rhs.n) % mod;
| ^
a.cc:67:22: error: 'struct modint' has no member named 'n'
67 | lhs.n = (lhs.n * rhs.n) % mod;
| ^
a.cc:67:30: error: 'const struct modint' has no member named 'n'
67 | lhs.n = (lhs.n * rhs.n) % mod;
| ^
a.cc:67:35: error: 'mod' was not declared in this scope; did you mean 'modf'?
67 | lhs.n = (lhs.n * rhs.n) % mod;
| ^~~
| modf
a.cc: In function 'modint& operator/=(modint&, const modint&)':
a.cc:71:13: error: 'struct modint' has no member named 'n'
71 | lhs.n = (lhs.n * (~rhs).n) % mod;
| ^
a.cc:71:22: error: 'struct modint' has no member named 'n'
71 | lhs.n = (lhs.n * (~rhs).n) % mod;
| ^
a.cc:71:33: error: 'struct modint' has no member named 'n'
71 | lhs.n = (lhs.n * (~rhs).n) % mod;
| ^
a.cc:71:38: error: 'mod' was not declared in this scope; did you mean 'modf'?
71 | lhs.n = (lhs.n * (~rhs).n) % mod;
| ^~~
| modf
a.cc: In function 'modint operator+(const modint&, const modint&)':
a.cc:75:27: error: 'const struct modint' has no member named 'n'
75 | return modint(lhs.n + rhs.n);
| ^
a.cc:75:35: error: 'const struct modint' has no member named 'n'
75 | return modint(lhs.n + rhs.n);
| ^
a.cc: In function 'modint operator-(const modint&, const modint&)':
a.cc:78:27: error: 'const struct modint' has no member named 'n'
78 | return modint(lhs.n - rhs.n);
| ^
a.cc:78:35: error: 'const struct modint' has no member named 'n'
78 | return modint(lhs.n - rhs.n);
| ^
a.cc: In function 'modint operator*(const modint&, const modint&)':
a.cc:81:27: error: 'const struct modint' has no member named 'n'
81 | return modint(lhs.n * rhs.n);
| ^
a.cc:81:35: error: 'const struct modint' has no member named 'n'
81 | return modint(lhs.n * rhs.n);
| ^
a.cc: In function 'modint operator/(const modint&, const modint&)':
a.cc:84:27: error: 'const struct modint' has no member named 'n'
84 | return modint(lhs.n * (~rhs).n);
| ^
a.cc:84:38: error: 'struct modint' has no member named 'n'
84 | return modint(lhs.n * (~rhs).n);
| ^
a.cc: In function 'std::istream& operator>>(std::istream&, modint)':
a.cc:87:54: error: 'struct modint' has no member named 'n'
87 | istream& operator>>(istream& is, modint m) { is >> m.n; return is; }
| ^
a.cc: In function 'std::ostream& operator<<(std::ostream&, modint)':
a.cc:88:54: error: 'struct modint' has no member named 'n'
88 | ostream& operator<<(ostream& os, modint m) { os << m.n; return os; }
| ^
a.cc: At global scope:
a.cc:106:33: error: 'inf' was not declared in this scope; did you mean 'ynf'?
106 | vector<long long> fact(MAX_N+1, inf);
| ^~~
| ynf
a.cc: In function 'long long int mod_fact(long long int, long long int&)':
a.cc:108:19: error: 'inf' was not declared in this scope; did you mean 'ynf'?
108 | if(fact[0] == inf) {
| ^~~
| ynf
a.cc:111:13: error: 'll' was not declared in this scope
111 | for(ll i = 2; i <= MAX_N; ++i) {
| ^~
a.cc:111:23: error: 'i' was not declared in this scope
111 | for(ll i = 2; i <= MAX_N; ++i) {
| ^
a.cc:112:41: error: 'mod' was not declared in this scope; did you mean 'modf'?
112 | fact[i] = (fact[i-1] * i) % mod;
| ^~~
| modf
a.cc:117:34: error: 'mod' was not declared in this scope; did you mean 'modf'?
117 | long long res = mod_fact(n / mod, e);
| ^~~
| modf
a.cc: In function 'long long int mod_comb(long long int, long long int)':
a.cc:128:42: error: 'mod' was not declared in this scope; did you mean 'modf'?
12 |
s276561091 | p03887 | C | long long n,a,b,c,f[5006][5006],i,j,r,y,s,m=1000000007;main(){scanf("%llu%llu%llu%llu",&n,&a,&b,&c);b%2&&exit(!puts("0"));for(f[0][0]=1;++i<=n;s=c+3)for(f[i][j=0]=1;++j<=i;)f[i][j]=(f[i-1][j-1]+f[i-1][j])%m;for(i=0;(s-=3)>=0;r+=y%m*f[a+b/2+i][i]%m,i++)if(b)for(y=j=0;j<=a&&j<=s;j++)y+=f[a][j]*f[s+b/2-1-j][b/2-1]%m;else if(s<=a)y=f[a][s];printf("%lld\n",r%m*f[a+b/2][a]%m);} | main.c:1:56: error: return type defaults to 'int' [-Wimplicit-int]
1 | long long n,a,b,c,f[5006][5006],i,j,r,y,s,m=1000000007;main(){scanf("%llu%llu%llu%llu",&n,&a,&b,&c);b%2&&exit(!puts("0"));for(f[0][0]=1;++i<=n;s=c+3)for(f[i][j=0]=1;++j<=i;)f[i][j]=(f[i-1][j-1]+f[i-1][j])%m;for(i=0;(s-=3)>=0;r+=y%m*f[a+b/2+i][i]%m,i++)if(b)for(y=j=0;j<=a&&j<=s;j++)y+=f[a][j]*f[s+b/2-1-j][b/2-1]%m;else if(s<=a)y=f[a][s];printf("%lld\n",r%m*f[a+b/2][a]%m);}
| ^~~~
main.c: In function 'main':
main.c:1:63: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | long long n,a,b,c,f[5006][5006],i,j,r,y,s,m=1000000007;main(){scanf("%llu%llu%llu%llu",&n,&a,&b,&c);b%2&&exit(!puts("0"));for(f[0][0]=1;++i<=n;s=c+3)for(f[i][j=0]=1;++j<=i;)f[i][j]=(f[i-1][j-1]+f[i-1][j])%m;for(i=0;(s-=3)>=0;r+=y%m*f[a+b/2+i][i]%m,i++)if(b)for(y=j=0;j<=a&&j<=s;j++)y+=f[a][j]*f[s+b/2-1-j][b/2-1]%m;else if(s<=a)y=f[a][s];printf("%lld\n",r%m*f[a+b/2][a]%m);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | long long n,a,b,c,f[5006][5006],i,j,r,y,s,m=1000000007;main(){scanf("%llu%llu%llu%llu",&n,&a,&b,&c);b%2&&exit(!puts("0"));for(f[0][0]=1;++i<=n;s=c+3)for(f[i][j=0]=1;++j<=i;)f[i][j]=(f[i-1][j-1]+f[i-1][j])%m;for(i=0;(s-=3)>=0;r+=y%m*f[a+b/2+i][i]%m,i++)if(b)for(y=j=0;j<=a&&j<=s;j++)y+=f[a][j]*f[s+b/2-1-j][b/2-1]%m;else if(s<=a)y=f[a][s];printf("%lld\n",r%m*f[a+b/2][a]%m);}
main.c:1:63: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | long long n,a,b,c,f[5006][5006],i,j,r,y,s,m=1000000007;main(){scanf("%llu%llu%llu%llu",&n,&a,&b,&c);b%2&&exit(!puts("0"));for(f[0][0]=1;++i<=n;s=c+3)for(f[i][j=0]=1;++j<=i;)f[i][j]=(f[i-1][j-1]+f[i-1][j])%m;for(i=0;(s-=3)>=0;r+=y%m*f[a+b/2+i][i]%m,i++)if(b)for(y=j=0;j<=a&&j<=s;j++)y+=f[a][j]*f[s+b/2-1-j][b/2-1]%m;else if(s<=a)y=f[a][s];printf("%lld\n",r%m*f[a+b/2][a]%m);}
| ^~~~~
main.c:1:63: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:106: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
1 | long long n,a,b,c,f[5006][5006],i,j,r,y,s,m=1000000007;main(){scanf("%llu%llu%llu%llu",&n,&a,&b,&c);b%2&&exit(!puts("0"));for(f[0][0]=1;++i<=n;s=c+3)for(f[i][j=0]=1;++j<=i;)f[i][j]=(f[i-1][j-1]+f[i-1][j])%m;for(i=0;(s-=3)>=0;r+=y%m*f[a+b/2+i][i]%m,i++)if(b)for(y=j=0;j<=a&&j<=s;j++)y+=f[a][j]*f[s+b/2-1-j][b/2-1]%m;else if(s<=a)y=f[a][s];printf("%lld\n",r%m*f[a+b/2][a]%m);}
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | long long n,a,b,c,f[5006][5006],i,j,r,y,s,m=1000000007;main(){scanf("%llu%llu%llu%llu",&n,&a,&b,&c);b%2&&exit(!puts("0"));for(f[0][0]=1;++i<=n;s=c+3)for(f[i][j=0]=1;++j<=i;)f[i][j]=(f[i-1][j-1]+f[i-1][j])%m;for(i=0;(s-=3)>=0;r+=y%m*f[a+b/2+i][i]%m,i++)if(b)for(y=j=0;j<=a&&j<=s;j++)y+=f[a][j]*f[s+b/2-1-j][b/2-1]%m;else if(s<=a)y=f[a][s];printf("%lld\n",r%m*f[a+b/2][a]%m);}
main.c:1:106: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
1 | long long n,a,b,c,f[5006][5006],i,j,r,y,s,m=1000000007;main(){scanf("%llu%llu%llu%llu",&n,&a,&b,&c);b%2&&exit(!puts("0"));for(f[0][0]=1;++i<=n;s=c+3)for(f[i][j=0]=1;++j<=i;)f[i][j]=(f[i-1][j-1]+f[i-1][j])%m;for(i=0;(s-=3)>=0;r+=y%m*f[a+b/2+i][i]%m,i++)if(b)for(y=j=0;j<=a&&j<=s;j++)y+=f[a][j]*f[s+b/2-1-j][b/2-1]%m;else if(s<=a)y=f[a][s];printf("%lld\n",r%m*f[a+b/2][a]%m);}
| ^~~~
main.c:1:106: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:1:112: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
1 | long long n,a,b,c,f[5006][5006],i,j,r,y,s,m=1000000007;main(){scanf("%llu%llu%llu%llu",&n,&a,&b,&c);b%2&&exit(!puts("0"));for(f[0][0]=1;++i<=n;s=c+3)for(f[i][j=0]=1;++j<=i;)f[i][j]=(f[i-1][j-1]+f[i-1][j])%m;for(i=0;(s-=3)>=0;r+=y%m*f[a+b/2+i][i]%m,i++)if(b)for(y=j=0;j<=a&&j<=s;j++)y+=f[a][j]*f[s+b/2-1-j][b/2-1]%m;else if(s<=a)y=f[a][s];printf("%lld\n",r%m*f[a+b/2][a]%m);}
| ^~~~
main.c:1:112: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:106: error: void value not ignored as it ought to be
1 | long long n,a,b,c,f[5006][5006],i,j,r,y,s,m=1000000007;main(){scanf("%llu%llu%llu%llu",&n,&a,&b,&c);b%2&&exit(!puts("0"));for(f[0][0]=1;++i<=n;s=c+3)for(f[i][j=0]=1;++j<=i;)f[i][j]=(f[i-1][j-1]+f[i-1][j])%m;for(i=0;(s-=3)>=0;r+=y%m*f[a+b/2+i][i]%m,i++)if(b)for(y=j=0;j<=a&&j<=s;j++)y+=f[a][j]*f[s+b/2-1-j][b/2-1]%m;else if(s<=a)y=f[a][s];printf("%lld\n",r%m*f[a+b/2][a]%m);}
| ^~~~~~~~~~~~~~~~
main.c:1:339: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | long long n,a,b,c,f[5006][5006],i,j,r,y,s,m=1000000007;main(){scanf("%llu%llu%llu%llu",&n,&a,&b,&c);b%2&&exit(!puts("0"));for(f[0][0]=1;++i<=n;s=c+3)for(f[i][j=0]=1;++j<=i;)f[i][j]=(f[i-1][j-1]+f[i-1][j])%m;for(i=0;(s-=3)>=0;r+=y%m*f[a+b/2+i][i]%m,i++)if(b)for(y=j=0;j<=a&&j<=s;j++)y+=f[a][j]*f[s+b/2-1-j][b/2-1]%m;else if(s<=a)y=f[a][s];printf("%lld\n",r%m*f[a+b/2][a]%m);}
| ^~~~~~
main.c:1:339: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:339: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:339: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s508736153 | p03887 | C++ | 滅びを知る者、いずれ安らぎを得る果報者たちよ。我が羨望!我が憎悪!死の痛みをもって知るがいい!
滅びの定めにすら見放された、我が永遠の孤独。空よ!雲よ!憐みの涙で命を呪え! | a.cc:1:1: error: extended character 、 is not valid in an identifier
1 | 滅びを知る者、いずれ安らぎを得る果報者たちよ。我が羨望!我が憎悪!死の痛みをもって知るがいい!
| ^
a.cc:1:1: error: extended character 。 is not valid in an identifier
a.cc:2:1: error: extended character 、 is not valid in an identifier
2 | 滅びの定めにすら見放された、我が永遠の孤独。空よ!雲よ!憐みの涙で命を呪え!
| ^
a.cc:2:1: error: extended character 。 is not valid in an identifier
a.cc:1:1: error: '\U00006ec5\U00003073\U00003092\U000077e5\U0000308b\U00008005\U00003001\U00003044\U0000305a\U0000308c\U00005b89\U00003089\U0000304e\U00003092\U00005f97\U0000308b\U0000679c\U00005831\U00008005\U0000305f\U00003061\U00003088\U00003002\U00006211\U0000304c\U00007fa8\U0000671b\U0000ff01\U00006211\U0000304c\U0000618e\U000060aa\U0000ff01\U00006b7b\U0000306e\U000075db\U0000307f\U00003092\U00003082\U00003063\U00003066\U000077e5\U0000308b\U0000304c\U00003044\U00003044\U0000ff01' does not name a type
1 | 滅びを知る者、いずれ安らぎを得る果報者たちよ。我が羨望!我が憎悪!死の痛みをもって知るがいい!
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s859567109 | p03887 | C++ | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author Majk
*/
#include <iostream>
#include <fstream>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <iomanip>
#include <functional>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <string>
#include <sstream>
#include <queue>
using namespace std;
#define ll long long
template <unsigned int N> class Field {
typedef unsigned int ui;
typedef unsigned long long ull;
public:
inline Field<N>&operator+=(const Field<N>&o) {if ((ll)v+o.v >= N) v = (ll)v+o.v-N; else v = v+o.v; return *this; }
inline Field<N>&operator*=(const Field<N>&o) {v=(ull)v*o.v % N; return *this; }
inline Field<N> operator*(const Field<N>&o) {Field<N>r(*this);return r*=o;};
private: ui v;
};
template<unsigned int N>ostream &operator<<(std::ostream&os,const Field<N>&f){return os<<(unsigned int)f;}
typedef Field<1000000007> FieldMod;
template<typename T> T gcd(T a,T b) { if (a<b) swap(a,b); return b?gcd(b,a%b):a; }
class J {
public:
int N,A,B,C;
vector<FieldMod> F,I;
void solve(istream& cin, ostream& cout) {
cin >> N >> A >> B >> C;
if (B%2 == 1) {
cout << 0 << endl;
return;
}
F.resize(N); I.resize(N);
F[0] = I[0] = 1;
for (int i = 1; i <= N; ++i) {
F[i] = F[i-1] * i;
I[i] = I[i-1] / i;
}
FieldMod ans = 0;
for (int p = max(0, A-C); p <= A; ++p) {
int q = A - p;
for (int r = 0; r <= (C - A + p) / 3; ++r) {
int s = B / 2;
int t = C - A + p - 3*r;
FieldMod comb = F[p + q + r + s] * I[s] * I[p] * I[q] * I[r];
if (t > 0 && s > 0) {
ans += comb * F[t + s - 1] * I[t] * I[s - 1];
} else if (t == 0) {
ans += comb;
}
}
}
cout << ans << endl;
}
};
int main() {
ios_base::sync_with_stdio(false);
J solver;
std::istream& in(std::cin);
std::ostream& out(std::cout);
solver.solve(in, out);
return 0;
}
| a.cc: In member function 'void J::solve(std::istream&, std::ostream&)':
a.cc:64:31: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Field<1000000007> >, Field<1000000007> >::value_type' {aka 'Field<1000000007>'} and 'int')
64 | F[0] = I[0] = 1;
| ^
a.cc:29:33: note: candidate: 'constexpr Field<1000000007>& Field<1000000007>::operator=(const Field<1000000007>&)'
29 | template <unsigned int N> class Field {
| ^~~~~
a.cc:29:33: note: no known conversion for argument 1 from 'int' to 'const Field<1000000007>&'
a.cc:29:33: note: candidate: 'constexpr Field<1000000007>& Field<1000000007>::operator=(Field<1000000007>&&)'
a.cc:29:33: note: no known conversion for argument 1 from 'int' to 'Field<1000000007>&&'
a.cc:66:39: error: no match for 'operator*' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Field<1000000007> >, Field<1000000007> >::value_type' {aka 'Field<1000000007>'} and 'int')
66 | F[i] = F[i-1] * i;
a.cc:37:25: note: candidate: 'Field<N> Field<N>::operator*(const Field<N>&) [with unsigned int N = 1000000007]'
37 | inline Field<N> operator*(const Field<N>&o) {Field<N>r(*this);return r*=o;};
| ^~~~~~~~
a.cc:37:50: note: no known conversion for argument 1 from 'int' to 'const Field<1000000007>&'
37 | inline Field<N> operator*(const Field<N>&o) {Field<N>r(*this);return r*=o;};
| ~~~~~~~~~~~~~~~^
a.cc:67:39: error: no match for 'operator/' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<Field<1000000007> >, Field<1000000007> >::value_type' {aka 'Field<1000000007>'} and 'int')
67 | I[i] = I[i-1] / i;
a.cc:72:32: error: conversion from 'int' to non-scalar type 'FieldMod' {aka 'Field<1000000007>'} requested
72 | FieldMod ans = 0;
| ^
a.cc: In instantiation of 'std::ostream& operator<<(std::ostream&, const Field<N>&) [with unsigned int N = 1000000007; std::ostream = std::basic_ostream<char>]':
a.cc:87:11: required from here
87 | cout << ans << endl;
| ^~~
a.cc:42:90: error: invalid cast from type 'const Field<1000000007>' to type 'unsigned int'
42 | template<unsigned int N>ostream &operator<<(std::ostream&os,const Field<N>&f){return os<<(unsigned int)f;}
| ^~~~~~~~~~~~~~~
|
s687223698 | p03888 | C++ | def main():
R1, R2 = map(int, input().split())
ans = R1 * R2 / (R1 + R2)
print(ans)
if __name__ == "__main__":
main()
| a.cc:1:1: error: 'def' does not name a type
1 | def main():
| ^~~
|
s484034284 | p03888 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long double a,b;
cin >> a >> b;
cout fixed << setprecision(15) << 1/(1/a+1/b);
}
| a.cc: In function 'int main()':
a.cc:6:7: error: expected ';' before 'fixed'
6 | cout fixed << setprecision(15) << 1/(1/a+1/b);
| ^~~~~~
| ;
|
s310336502 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
int main() {
// Write Your Code Below
ll a, b;
cin >> a >> b;
cout << fixed <<setprecision(10)
double x; x = 1/double(a) + 1/double(b);
double ans; ans = 1/double(x);
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:21:36: error: expected ';' before 'double'
21 | cout << fixed <<setprecision(10)
| ^
| ;
22 | double x; x = 1/double(a) + 1/double(b);
| ~~~~~~
a.cc:22:14: error: 'x' was not declared in this scope
22 | double x; x = 1/double(a) + 1/double(b);
| ^
|
s671990743 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
int main() {
// Write Your Code Below
ll a, b;
double x; x = double 1/(a) + double 1/(b);
double ans; ans = double 1/x;
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:20:18: error: expected primary-expression before 'double'
20 | double x; x = double 1/(a) + double 1/(b);
| ^~~~~~
a.cc:21:22: error: expected primary-expression before 'double'
21 | double ans; ans = double 1/x;
| ^~~~~~
|
s789075131 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
int main() {
// Write Your Code Below
ll a, b;
ans; 1/ans=1/a+1/b;
cout<< ans <<endl;
}
| a.cc: In function 'int main()':
a.cc:20:4: error: 'ans' was not declared in this scope; did you mean 'abs'?
20 | ans; 1/ans=1/a+1/b;
| ^~~
| abs
|
s643918369 | p03888 | C++ | int main() {
// Write Your Code Below
double a,b;
cin >> a >> b;
double c = 1/a + 1/b;
cout << fixed << setprecision(10);
cout << 1/c << endl;
} | a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
4 | cin >> a >> b;
| ^~~
a.cc:6:6: error: 'cout' was not declared in this scope
6 | cout << fixed << setprecision(10);
| ^~~~
a.cc:6:14: error: 'fixed' was not declared in this scope
6 | cout << fixed << setprecision(10);
| ^~~~~
a.cc:6:23: error: 'setprecision' was not declared in this scope
6 | cout << fixed << setprecision(10);
| ^~~~~~~~~~~~
a.cc:7:20: error: 'endl' was not declared in this scope
7 | cout << 1/c << endl;
| ^~~~
|
s011981603 | p03888 | C++ | int main() {
cin >> a >> b;
cout << fixed << setprecision(10);
cout << 1/(1/a + 1/b) < endl;
}
| a.cc: In function 'int main()':
a.cc:2:3: error: 'cin' was not declared in this scope
2 | cin >> a >> b;
| ^~~
a.cc:2:10: error: 'a' was not declared in this scope
2 | cin >> a >> b;
| ^
a.cc:2:15: error: 'b' was not declared in this scope
2 | cin >> a >> b;
| ^
a.cc:3:1: error: 'cout' was not declared in this scope
3 | cout << fixed << setprecision(10);
| ^~~~
a.cc:3:9: error: 'fixed' was not declared in this scope
3 | cout << fixed << setprecision(10);
| ^~~~~
a.cc:3:18: error: 'setprecision' was not declared in this scope
3 | cout << fixed << setprecision(10);
| ^~~~~~~~~~~~
a.cc:4:27: error: 'endl' was not declared in this scope
4 | cout << 1/(1/a + 1/b) < endl;
| ^~~~
|
s733954024 | p03888 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
double R1,R2;
double R3;
cin>>R1>>R2;
R3 = (R1 * R2)/(R1 + R2);
cout<< R3 <<endl;
cout << fixed << setprecision(10);
return 0;
} | a.cc: In function 'int main()':
a.cc:16:22: error: 'setprecision' was not declared in this scope
16 | cout << fixed << setprecision(10);
| ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
1 | #include <iostream>
+++ |+#include <iomanip>
2 | #include <string>
|
s275865647 | p03888 | C++ | int main() {
// Write Your Code Below
double R1, R2;
cin >>R1>>R2;
double ans=(double (1./R1)+double (1./R2));
cout <<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
4 | cin >>R1>>R2;
| ^~~
a.cc:6:3: error: 'cout' was not declared in this scope
6 | cout <<ans<<endl;
| ^~~~
a.cc:6:15: error: 'endl' was not declared in this scope
6 | cout <<ans<<endl;
| ^~~~
|
s927755598 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
int main() {
double A, B ;
cin >> A >> B ;
cout << fixed << setprecision(100)
cout << (A*B)/(A+B) << endl;
}
| a.cc: In function 'int main()':
a.cc:20:43: error: expected ';' before 'cout'
20 | cout << fixed << setprecision(100)
| ^
| ;
21 | cout << (A*B)/(A+B) << endl;
| ~~~~
|
s135155776 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
int main() {
double A, B ;
cin >> A >> B ;
cout << fixed << setprecision(10000000009) ;
cout << (AB)/(A+B) << endl;
}
| a.cc: In function 'int main()':
a.cc:20:39: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000009' to '1410065417' [-Woverflow]
20 | cout << fixed << setprecision(10000000009) ;
| ^~~~~~~~~~~
a.cc:21:18: error: 'AB' was not declared in this scope; did you mean 'B'?
21 | cout << (AB)/(A+B) << endl;
| ^~
| B
|
s922698303 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
int main() {
double A, B ;
cin >> A >> B ;
cout << fixed << setprecision(1000000000000)
cout << (A*B)/(A+B) << endl;
}
| a.cc: In function 'int main()':
a.cc:20:39: warning: overflow in conversion from 'long int' to 'int' changes value from '1000000000000' to '-727379968' [-Woverflow]
20 | cout << fixed << setprecision(1000000000000)
| ^~~~~~~~~~~~~
a.cc:20:53: error: expected ';' before 'cout'
20 | cout << fixed << setprecision(1000000000000)
| ^
| ;
21 | cout << (A*B)/(A+B) << endl;
| ~~~~
|
s403665202 | p03888 | C++ | int main() {
// Write Your Code Below
ll R1, R2;
cin >>R1>>R2;
double ans=(double(1/R1)+double(1/R2));
cout <<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:3:1: error: 'll' was not declared in this scope
3 | ll R1, R2;
| ^~
a.cc:4:3: error: 'cin' was not declared in this scope
4 | cin >>R1>>R2;
| ^~~
a.cc:4:9: error: 'R1' was not declared in this scope
4 | cin >>R1>>R2;
| ^~
a.cc:4:13: error: 'R2' was not declared in this scope
4 | cin >>R1>>R2;
| ^~
a.cc:6:3: error: 'cout' was not declared in this scope
6 | cout <<ans<<endl;
| ^~~~
a.cc:6:15: error: 'endl' was not declared in this scope
6 | cout <<ans<<endl;
| ^~~~
|
s279064872 | p03888 | C++ | int main() {
// Write Your Code Below
ll R1, R2;
cin >>R1>>R2;
double ans=(double(R1)+double(R2));
cout <<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:3:1: error: 'll' was not declared in this scope
3 | ll R1, R2;
| ^~
a.cc:4:3: error: 'cin' was not declared in this scope
4 | cin >>R1>>R2;
| ^~~
a.cc:4:9: error: 'R1' was not declared in this scope
4 | cin >>R1>>R2;
| ^~
a.cc:4:13: error: 'R2' was not declared in this scope
4 | cin >>R1>>R2;
| ^~
a.cc:6:3: error: 'cout' was not declared in this scope
6 | cout <<ans<<endl;
| ^~~~
a.cc:6:15: error: 'endl' was not declared in this scope
6 | cout <<ans<<endl;
| ^~~~
|
s811877514 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
int main() {
double A, B ;
cin >> A >> B ;
cout << (AB)/(A+B) << endl;
}
| a.cc: In function 'int main()':
a.cc:21:18: error: 'AB' was not declared in this scope; did you mean 'B'?
21 | cout << (AB)/(A+B) << endl;
| ^~
| B
|
s471598389 | p03888 | C++ | int main() {
ll R1, R2;
cin >>R1>>R2;
double (ans=double(R1)+double(R2))
} | a.cc: In function 'int main()':
a.cc:2:3: error: 'll' was not declared in this scope
2 | ll R1, R2;
| ^~
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin >>R1>>R2;
| ^~~
a.cc:3:9: error: 'R1' was not declared in this scope
3 | cin >>R1>>R2;
| ^~
a.cc:3:13: error: 'R2' was not declared in this scope
3 | cin >>R1>>R2;
| ^~
a.cc:4:11: error: 'ans' was not declared in this scope
4 | double (ans=double(R1)+double(R2))
| ^~~
|
s440217003 | p03888 | C++ | 100 99 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 100 99
| ^~~
|
s459149550 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
int main() {
double A, B, ;
cin >> A >> B ;
cout << 1./((1./A)+(1./B)) << endl;
}
| a.cc: In function 'int main()':
a.cc:18:23: error: expected unqualified-id before ';' token
18 | double A, B, ;
| ^
|
s264599487 | p03888 | Java | java.util.*;
class Main
{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.println(1 / ( ( 1 / sc.nextInt() ) + ( 1 / sc.nextInt() ) ) );
}
} | Main.java:1: error: class, interface, enum, or record expected
java.util.*;
^
1 error
|
s181227732 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
double a,b;
cin>>a>>b;
printf("%.12lf\n"a*b/(a+b));
}
| a.cc: In function 'int main()':
a.cc:6:10: error: unable to find string literal operator 'operator""a' with 'const char [8]', 'long unsigned int' arguments
6 | printf("%.12lf\n"a*b/(a+b));
| ^~~~~~~~~~~
|
s703879003 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
double a,b;
cin>>a>>b;
printf("%12lf\n"a*b/(a+b));
} | a.cc: In function 'int main()':
a.cc:6:10: error: unable to find string literal operator 'operator""a' with 'const char [7]', 'long unsigned int' arguments
6 | printf("%12lf\n"a*b/(a+b));
| ^~~~~~~~~~
|
s312860115 | p03888 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
scanf("%d %d",&a,&b);
printf("%.10f\n",a*b/(a+b));
}
} | a.cc:8:1: error: expected declaration before '}' token
8 | }
| ^
|
s767313676 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
int mai ()
{
string s;
cin>>s;
bool tmp = false;
if (s.size() %2 !=0){ cout<<"No"<<endl;}
else {
for (int i = 0; i < s.size(); ++i)
{
int n = s.size()-1-i;
if (s[i]=='b' && s[n] != 'd') tmp = false;
if (s[i]=='d' && s[n] != 'b') tmp = false;
if (s[i]=='q' && s[n] != 'p') tmp = false;
if (s[i]=='p' && s[n] != 'q') tmp = false;
}
if (tmp == true) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
} | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s338683859 | p03888 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
long double r1;
long double r2;
printf("%.15Lf\n", 1 / ((1 / p1) + (1 / p2)));
return 0;
} | a.cc: In function 'int main()':
a.cc:7:32: error: 'p1' was not declared in this scope; did you mean 'r1'?
7 | printf("%.15Lf\n", 1 / ((1 / p1) + (1 / p2)));
| ^~
| r1
a.cc:7:43: error: 'p2' was not declared in this scope; did you mean 'r2'?
7 | printf("%.15Lf\n", 1 / ((1 / p1) + (1 / p2)));
| ^~
| r2
|
s327539669 | p03888 | C++ | #include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
using namespace std;
typedef long long ll;
ll ds(ll digit) {
ll res = 0;
while (digit!=0) {
res += digit % 10;
digit /= 10;
}
return res;
}
ll MOD = 1000000007;
int main() {
long double x, y;
cin >> x >> y;
long double z = x * y / (x + y);
cout <<fixed<<subscription(8)<< z << endl;
}
| a.cc: In function 'int main()':
a.cc:33:23: error: 'subscription' was not declared in this scope
33 | cout <<fixed<<subscription(8)<< z << endl;
| ^~~~~~~~~~~~
|
s060364515 | p03888 | C++ | #include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
using namespace std;
typedef long long ll;
ll ds(ll digit) {
ll res = 0;
while (digit!=0) {
res += digit % 10;
digit /= 10;
}
return res;
}
ll MOD = 1000000007;
int main() {
long double x, y;
cin >> x >> y;
long double z = x * y / (x + y);
cout < z << endl;
}
| a.cc: In function 'int main()':
a.cc:33:18: error: invalid operands of types 'long double' and '<unresolved overloaded function type>' to binary 'operator<<'
33 | cout < z << endl;
| ~~^~~~~~~
|
s536439128 | p03888 | C++ | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<P,ll> PPI;
typedef pair<ll,P> PIP;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vp;
#define PQ(T) priority_queue<T,vector<T>,greater<T>>
#define PQ2(T) priority_queue<T>
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define REP(i,a,b) for(ll (i)=a;(i)<(ll)(b);++(i))
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n+1)
#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())
#define DEBUG(x) cerr<<"line ("<<__LINE__<<") "<<#x<<": "<<x<<endl;
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(){
double a, b;
cin>>a>>b;
cout.precision(10);
cout<<fixec<<a*b/(a+b)<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:59:15: error: 'fixec' was not declared in this scope
59 | cout<<fixec<<a*b/(a+b)<<endl;
| ^~~~~
|
s710258884 | p03888 | C++ | #include <cstsio>
double r1,r2;
int main()
{
scanf("%lf%lf",&r1,&r2);
printf("%.10f¥n",(r1*r2)/(r1+r2));
return 0;
} | a.cc:1:10: fatal error: cstsio: No such file or directory
1 | #include <cstsio>
| ^~~~~~~~
compilation terminated.
|
s698931944 | p03888 | C++ | #include <stdio.h>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
int r1,r2;
while(cin>>r1>>r2){
double r3 = r1*r2*1.0/(r1+r2);
printf("%.7f\n",r3);
//cout<<r3<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
9 | while(cin>>r1>>r2){
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include <algorithm>
+++ |+#include <iostream>
4 |
|
s599422910 | p03888 | C++ | #include<iostream>
using namespace std;
int main(){
double x, y;
cin >> x;
cin >> y;
z=x*y/(x+y);
cout << z;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:1: error: 'z' was not declared in this scope
9 | z=x*y/(x+y);
| ^
|
s799476820 | p03888 | C | #include <stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b)
printf("%f",(a*b)/(a+b));
return 0;
} | main.c: In function 'main':
main.c:5:26: error: expected ';' before 'printf'
5 | scanf("%d %d",&a,&b)
| ^
| ;
6 | printf("%f",(a*b)/(a+b));
| ~~~~~~
|
s155169733 | p03888 | C | #include <stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b)
printf("%f",a*b*(a+b));
return 0;
}
| main.c: In function 'main':
main.c:5:26: error: expected ';' before 'printf'
5 | scanf("%d %d",&a,&b)
| ^
| ;
6 | printf("%f",a*b*(a+b));
| ~~~~~~
|
s919938559 | p03888 | C++ | #include<iostream>
int main(){
int a,b;
cin >> a >> b;
printf("%.9f",1./(1./a+1./b));
return 0;
} | a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> a >> b;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
|
s311514936 | p03888 | C++ | from fractions import *
r1,r2=map(int,input().split())
R1=Fraction(1,r1)
R2=Fraction(1,r2)
R3=R1+R2
print(R3.denominator/R3.numerator) | a.cc:1:1: error: 'from' does not name a type
1 | from fractions import *
| ^~~~
|
s129120981 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
string t = s:
int n = s.size();
for(int i = 0; i < n; i++){
if(s[i] == 'b'){
s[i] == 'd';
continue;
}
else if(s[i] == 'd'){
s[i] == 'b';
continue;
}
else if(s[i] == 'p'){
s[i] == 'q';
continue;
}
else if(s[i] == 'q'){
s[i] == 'p';
continue;
}
}
if(s == t) cout << "Yes" << endl;
else cout << "No" << endl;
} | a.cc: In function 'int main()':
a.cc:7:15: error: expected ',' or ';' before ':' token
7 | string t = s:
| ^
a.cc:9:22: error: 'n' was not declared in this scope
9 | for(int i = 0; i < n; i++){
| ^
|
s709607952 | p03889 | C++ | #include<iostream>
#include<string>
#include<map>
using namespace std;
int main(){
string s;
int n;
cin>>s;
n=s.length();
map<char,int> m;
m.insert('p',0);
m.insert('q',1);
m.insert('b',2);
m.insert('d',3);
for(int i=0;i<n;i++){
if((m[s[i]]^m[s[n-1-i]])!=1){
cout<<"No"<<endl;
return 0;
}
}
cout<<"Yes"<<endl;
} | a.cc: In function 'int main()':
a.cc:12:11: error: no matching function for call to 'std::map<char, int>::insert(char, int)'
12 | m.insert('p',0);
| ~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/map:63,
from a.cc:3:
/usr/include/c++/14/bits/stl_map.h:847:9: note: candidate: 'template<class _Pair> std::__enable_if_t<((bool)std::is_constructible<std::pair<const _Key, _Tp>, _Pair>::value), std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> > std::map<_Key, _Tp, _Compare, _Alloc>::insert(_Pair&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >]'
847 | insert(_Pair&& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_map.h:847:9: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:924:9: note: candidate: 'template<class _Pair> std::__enable_if_t<((bool)std::is_constructible<std::pair<const _Key, _Tp>, _Pair>::value), typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator> std::map<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, _Pair&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >]'
924 | insert(const_iterator __position, _Pair&& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_map.h:924:9: note: template argument deduction/substitution failed:
a.cc:12:12: note: cannot convert ''p'' (type 'char') to type 'std::map<char, int>::const_iterator' {aka 'std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::const_iterator'}
12 | m.insert('p',0);
| ^~~
/usr/include/c++/14/bits/stl_map.h:942:9: note: candidate: 'template<class _InputIterator> void std::map<_Key, _Tp, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >]'
942 | insert(_InputIterator __first, _InputIterator __last)
| ^~~~~~
/usr/include/c++/14/bits/stl_map.h:942:9: note: template argument deduction/substitution failed:
a.cc:12:11: note: deduced conflicting types for parameter '_InputIterator' ('char' and 'int')
12 | m.insert('p',0);
| ~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_map.h:661:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::insert_return_type std::map<_Key, _Tp, _Compare, _Alloc>::insert(node_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; insert_return_type = std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::insert_return_type; node_type = std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::node_type]'
661 | insert(node_type&& __nh)
| ^~~~~~
/usr/include/c++/14/bits/stl_map.h:661:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:666:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, node_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; iterator = std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::iterator; const_iterator = std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::const_iterator; node_type = std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::node_type]'
666 | insert(const_iterator __hint, node_type&& __nh)
| ^~~~~~
/usr/include/c++/14/bits/stl_map.h:666:29: note: no known conversion for argument 1 from 'char' to 'std::map<char, int>::const_iterator' {aka 'std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::const_iterator'}
666 | insert(const_iterator __hint, node_type&& __nh)
| ~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_map.h:834:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert(const value_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator = std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other = std::allocator<std::pair<const char, int> >; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> > = __gnu_cxx::__alloc_traits<std::allocator<std::pair<const char, int> >, std::pair<const char, int> >::rebind<std::pair<const char, int> >; typename _Alloc::value_type = std::pair<const char, int>; value_type = std::pair<const char, int>]'
834 | insert(const value_type& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_map.h:834:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:841:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert(value_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator = std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other = std::allocator<std::pair<const char, int> >; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> > = __gnu_cxx::__alloc_traits<std::allocator<std::pair<const char, int> >, std::pair<const char, int> >::rebind<std::pair<const char, int> >; typename _Alloc::value_type = std::pair<const char, int>; value_type = std::pair<const char, int>]'
841 | insert(value_type&& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_map.h:841:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:879:7: note: candidate: 'void std::map<_Key, _Tp, _Compare, _Alloc>::insert(std::initializer_list<std::pair<const _Key, _Tp> >) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >]'
879 | insert(std::initializer_list<value_type> __list)
| ^~~~~~
/usr/include/c++/14/bits/stl_map.h:879:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_map.h:909:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, const value_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; iterator = std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::iterator; const_iterator = std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::const_iterator; value_type = std::pair<const char, int>]'
909 | insert(const_iterator __position, const value_type& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_map.h:909:29: note: no known conversion for argument 1 from 'char' to 'std::map<char, int>::const_iterator' {aka 'std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::const_iterator'}
909 | insert(const_iterator __position, const value_type& __x)
| ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:919:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, value_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; iterator = std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::iterator; const_iterator = std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::const_iterator; value_type = std::pair<const char, int>]'
919 | insert(const_iterator __position, value_type&& __x)
|
s579474043 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
string st;
char ch[100010];
long long len;
int main()
{
cin>>st;
len=st.size();
for(int i=0;i<st.size();i++)
{
ch[len-i-1]=st[i];
if(st[i]=='b')ch[len-i-1]='d';
if(st[i]=='d')ch[len-i-1]='b';
if(st[i]=='p')ch[len-i-1]='q';
if(st[i]=='q')ch[len-i-1]='p';
for(int i=0;i<len;i++)
if(ch[i]!=st[i])
{
cout<<"No"<<endl;
return 0;
}
cout<<"Yes"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:7:1: note: to match this '{'
7 | {
| ^
|
s934428713 | p03889 | C++ | #include<iostream>
#include<cstring>
#include<string>
using namespace std;
int main()
{
string a;
cin >> a;
string b = a;
reverse(a.begin(), a.end());
for (int i = 0; i < a.length(); ++i)
{
if (a[i] == 'b') a[i] = 'd';
else if (a[i] == 'd') a[i] = 'b';
else if (a[i] == 'p') a[i] = 'q';
else if (a[i] == 'q') a[i] = 'p';
}
if (a == b) cout << "Yes";
else cout << "No";
}
| a.cc: In function 'int main()':
a.cc:10:9: error: 'reverse' was not declared in this scope
10 | reverse(a.begin(), a.end());
| ^~~~~~~
|
s853526891 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string a;
void mir()
{
int l=a.size();
for(int i=0;i<l;i++)
{
if(a[i]=="p")
{
a[i]='q';
}
else if(a[i]=="q")
{
a[i]='p';
}
else if(a[i]=="d")
{
a[i]='b';
}
else
{
a[i]='d';
}
}
}
string fz(string s1)
{
string s2;
for(int i=s1.length()-1,j=0;i>=0;i--,j++) s2=s2+s1[i];
if(s2[0]=='0')s2.erase(0,s2.find_first_not_of('0'));
return s2;
}
int main()
{
cin>>a;
string b=a;
int l=a.size();
mir();
if(fz(a)==b)
{
cout<<"Yes"<<endl;
return 0;
}
cout<<"No"<<endl;
} | a.cc: In function 'void mir()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(a[i]=="p")
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | else if(a[i]=="q")
a.cc:17:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | else if(a[i]=="d")
|
s950136818 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string a;
void mir()
{
int l=a.size();
for(int i=0;i<l;i++)
{
if(a[i]=="p")
{
a[i]="q";
}
else if(a[i]=="q")
{
a[i]="p";
}
else if(a[i]=="d")
{
a[i]="b";
}
else
{
a[i]="d";
}
}
}
int main()
{
cin>>a;
string b=a;
int l=a.size();
mir();
reverse(a.begin(),a.end());
if(a==b)
{
cout<<"Yes"<<endl;
return 0;
}
cout<<"No"<<endl;
} | a.cc: In function 'void mir()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(a[i]=="p")
a.cc:11:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
11 | a[i]="q";
| ^~~
| |
| const char*
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | else if(a[i]=="q")
a.cc:15:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
15 | a[i]="p";
| ^~~
| |
| const char*
a.cc:17:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | else if(a[i]=="d")
a.cc:19:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
19 | a[i]="b";
| ^~~
| |
| const char*
a.cc:23:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
23 | a[i]="d";
| ^~~
| |
| const char*
|
s129487277 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string a;
void mir()
{
int l=a.size();
for(int i=0;i<l;i++)
{
if(a[i]=="p")
{
a[i]="q";
}
else if(a[i]=="q")
{
a[i]="p";
}
else if(a[i]=="d")
{
a[i]="b";
}
else
{
a[i]="d";
}
}
}
string fz(string s1)
{
string s2;
for(int i=s1.length()-1,j=0;i>=0;i--,j++) s2=s2+s1[i];
if(s2[0]=='0')s2.erase(0,s2.find_first_not_of('0'));
return s2;
}
int main()
{
cin>>a;
string b=a;
int l=a.size();
mir();
if(fz(a)==b)
{
cout<<"Yes"<<endl;
return 0;
}
cout<<"No"<<endl;
} | a.cc: In function 'void mir()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(a[i]=="p")
a.cc:11:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
11 | a[i]="q";
| ^~~
| |
| const char*
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | else if(a[i]=="q")
a.cc:15:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
15 | a[i]="p";
| ^~~
| |
| const char*
a.cc:17:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | else if(a[i]=="d")
a.cc:19:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
19 | a[i]="b";
| ^~~
| |
| const char*
a.cc:23:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
23 | a[i]="d";
| ^~~
| |
| const char*
|
s726867090 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string a;
void mir()
{
int l=a.size();
for(int i=0;i<l;i++)
{
if(a[i]=="p")
{
a[i]=q;
}
else if(a[i]=="q")
{
a[i]=p;
}
else if(a[i]=="d")
{
a[i]=b;
}
else
{
a[i]=d;
}
}
}
string fz(string s1)
{
string s2;
for(int i=s1.length()-1,j=0;i>=0;i--,j++) s2=s2+s1[i];
if(s2[0]=='0')s2.erase(0,s2.find_first_not_of('0'));
return s2;
}
int main()
{
cin>>a;
string b=a;
int l=a.size();
mir();
if(fz(a)==b)
{
cout<<"Yes"<<endl;
return 0;
}
cout<<"No"<<endl;
} | a.cc: In function 'void mir()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(a[i]=="p")
a.cc:11:14: error: 'q' was not declared in this scope
11 | a[i]=q;
| ^
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | else if(a[i]=="q")
a.cc:15:14: error: 'p' was not declared in this scope
15 | a[i]=p;
| ^
a.cc:17:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | else if(a[i]=="d")
a.cc:19:14: error: 'b' was not declared in this scope
19 | a[i]=b;
| ^
a.cc:23:14: error: 'd' was not declared in this scope
23 | a[i]=d;
| ^
|
s462885035 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string a;
void mir()
{
int l=a.size();
for(int i=0;i<l;i++)
{
if(a[i]=='p')
{
a[i]=q;
}
else if(a[i]=='q')
{
a[i]=p;
}
else if(a[i]=='d')
{
a[i]=b;
}
else
{
a[i]=d;
}
}
}
string fz(string s1)
{
string s2;
for(int i=s1.length()-1,j=0;i>=0;i--,j++) s2=s2+s1[i];
if(s2[0]=='0')s2.erase(0,s2.find_first_not_of('0'));
return s2;
}
int main()
{
cin>>a;
string b=a;
int l=a.size();
mir();
if(fz(a)==b)
{
cout<<"Yes"<<endl;
return 0;
}
cout<<"No"<<endl;
} | a.cc: In function 'void mir()':
a.cc:11:14: error: 'q' was not declared in this scope
11 | a[i]=q;
| ^
a.cc:15:14: error: 'p' was not declared in this scope
15 | a[i]=p;
| ^
a.cc:19:14: error: 'b' was not declared in this scope
19 | a[i]=b;
| ^
a.cc:23:14: error: 'd' was not declared in this scope
23 | a[i]=d;
| ^
|
s569355209 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string a;
void mir()
{
int l=a.size();
for(int i=0;i<l;i++)
{
if(a[i]=="p")
{
a[i]=q;
}
else if(a[i]=="q")
{
a[i]=p;
}
else if(a[i]=="d")
{
a[i]=b;
}
else
{
a[i]=d;
}
}
}
string fz(string s1)
{
string s2;
for(int i=s1.length()-1,j=0;i>=0;i--,j++) s2=s2+s1[i];
if(s2[0]=='0')s2.erase(0,s2.find_first_not_of('0'));
return s2;
}
int main()
{
cin>>a;
string b=a;
int l=a.size();
mir();
if(fz(a)==b)
{
cout<<"Yes"<<endl;
return 0;
}
cout<<"No"<<endl;
} | a.cc: In function 'void mir()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(a[i]=="p")
a.cc:11:14: error: 'q' was not declared in this scope
11 | a[i]=q;
| ^
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | else if(a[i]=="q")
a.cc:15:14: error: 'p' was not declared in this scope
15 | a[i]=p;
| ^
a.cc:17:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | else if(a[i]=="d")
a.cc:19:14: error: 'b' was not declared in this scope
19 | a[i]=b;
| ^
a.cc:23:14: error: 'd' was not declared in this scope
23 | a[i]=d;
| ^
|
s736569142 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef '' "";
string a;
void mir()
{
int l=a.size();
for(int i=0;i<l;i++)
{
if(a[i]=='p')
{
a[i]=q;
}
else if(a[i]=='q')
{
a[i]=p;
}
else if(a[i]=='d')
{
a[i]=b;
}
else
{
a[i]=d;
}
}
}
string fz(string s1)
{
string s2;
for(int i=s1.length()-1,j=0;i>=0;i--,j++) s2=s2+s1[i];
if(s2[0]=='0')s2.erase(0,s2.find_first_not_of('0'));
return s2;
}
int main()
{
cin>>a;
string b=a;
int l=a.size();
mir();
if(fz(a)==b)
{
cout<<"Yes"<<endl;
return 0;
}
cout<<"No"<<endl;
} | a.cc:3:9: error: empty character constant
3 | typedef '' "";
| ^~
a.cc:3:9: error: expected unqualified-id before '\x0'
a.cc: In function 'void mir()':
a.cc:12:14: error: 'q' was not declared in this scope
12 | a[i]=q;
| ^
a.cc:16:14: error: 'p' was not declared in this scope
16 | a[i]=p;
| ^
a.cc:20:14: error: 'b' was not declared in this scope
20 | a[i]=b;
| ^
a.cc:24:14: error: 'd' was not declared in this scope
24 | a[i]=d;
| ^
|
s013397252 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string a;
void mir()
{
int l=a.size();
for(int i=0;i<l;i++)
{
if(a[i]=='p')
{
a[i]=q;
}
else if(a[i]=='q')
{
a[i]=p;
}
else if(a[i]=='d')
{
a[i]=b;
}
else
{
a[i]=d;
}
}
}
string fz(string s1)
{
string s2;
for(int i=s1.length()-1,j=0;i>=0;i--,j++) s2=s2+s1[i];
if(s2[0]=='0')s2.erase(0,s2.find_first_not_of('0'));
return s2;
}
int main()
{
cin>>a;
string b=a;
int l=a.size();
mir();
if(fz(a)==b)
{
cout<<"Yes"<<endl;
return 0;
}
cout<<"No"<<endl;
} | a.cc: In function 'void mir()':
a.cc:11:14: error: 'q' was not declared in this scope
11 | a[i]=q;
| ^
a.cc:15:14: error: 'p' was not declared in this scope
15 | a[i]=p;
| ^
a.cc:19:14: error: 'b' was not declared in this scope
19 | a[i]=b;
| ^
a.cc:23:14: error: 'd' was not declared in this scope
23 | a[i]=d;
| ^
|
s971848351 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string a;
void mir()
{
int l=a.size();
for(int i=0;i<l;i++)
{
if(a=='p')
{
a[i]=q;
}
else if(a=='q')
{
a[i]=p;
}
else if(a=='d')
{
a[i]=b;
}
else
{
a[i]=d;
}
}
}
string fz(string s1)
{
string s2;
for(int i=s1.length()-1,j=0;i>=0;i--,j++) s2=s2+s1[i];
if(s2[0]=='0')s2.erase(0,s2.find_first_not_of('0'));
return s2;
}
int main()
{
cin>>a;
string b=a;
int l=a.size();
mir();
if(fz(a)==b)
{
cout<<"Yes"<<endl;
return 0;
}
cout<<"No"<<endl;
} | a.cc: In function 'void mir()':
a.cc:9:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
9 | if(a=='p')
| ~^~~~~
| | |
| | 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: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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | if(a=='p')
| ^~~
/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:9:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
9 | if(a=='p')
| ^~~
/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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | if(a=='p')
| ^~~
/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:9:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
9 | if(a=='p')
| ^~~
/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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | if(a=='p')
| ^~~
/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:9:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
9 | if(a=='p')
| ^~~
/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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | if(a=='p')
| ^~~
/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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
9 | if(a=='p')
| ^~~
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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
9 | if(a=='p')
| ^~~
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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | if(a=='p')
| ^~~
/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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | if(a=='p')
| ^~~
/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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | if(a=='p')
| ^~~
/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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | if(a=='p')
| ^~~
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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
9 | if(a=='p')
| ^~~
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:9:11: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>'
9 | if(a=='p')
| ^~~
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:9:11: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
9 | if(a=='p')
| ^~~
/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<_C |
s709289137 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
char mir(char a)
{
if(a=='p')
{
return q;
}
else if(a=='q')
{
return p;
}
else if(a=='d')
{
return b;
}
else
{
return d;
}
}
string fz(string a)
{
int l=a.size();
for(int i=0;i<l/2;i++)
{
swap(a[i],a[l-i]);
}
return a;
} | a.cc: In function 'char mir(char)':
a.cc:7:16: error: 'q' was not declared in this scope
7 | return q;
| ^
a.cc:11:16: error: 'p' was not declared in this scope
11 | return p;
| ^
a.cc:15:16: error: 'b' was not declared in this scope
15 | return b;
| ^
a.cc:19:16: error: 'd' was not declared in this scope
19 | return d;
| ^
|
s959080896 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
char mir(char a)
{
if(a=='p')
{
return q;
}
else if(a=='q')
{
return p;
}
else if(a=='d')
{
return b;
}
else
{
return d;
}
}
string fz(string a)
{
} | a.cc: In function 'char mir(char)':
a.cc:7:16: error: 'q' was not declared in this scope
7 | return q;
| ^
a.cc:11:16: error: 'p' was not declared in this scope
11 | return p;
| ^
a.cc:15:16: error: 'b' was not declared in this scope
15 | return b;
| ^
a.cc:19:16: error: 'd' was not declared in this scope
19 | return d;
| ^
a.cc: In function 'std::string fz(std::string)':
a.cc:25:1: warning: no return statement in function returning non-void [-Wreturn-type]
25 | }
| ^
|
s282058187 | p03889 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define int long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
#define mod 1000000007
#define inf 1e15
#define key 1e9
using namespace std;
typedef pair<int, int>P;
void yes() { cout << "Yay!" << endl; }
void no() { cout << ":(" << endl; }
template<class T> inline void chmax(T& a, T b) {
a = std::max(a, b);
}
template<class T> inline void chmin(T& a, T b) {
a = std::min(a, b);
}
bool prime(int n) {
int cnt = 0;
for (int i = 1; i <= sqrt(n); i++) {
if (n % i == 0)cnt++;
}
if (cnt != 1)return false;
else return n != 1;
}
int gcd(int x, int y) {
if (y == 0)return x;
return gcd(y, x % y);
}
int lcm(int x, int y) {
return x / gcd(x, y) * y;
}
int kai(int x, int y) {
int res = 1;
for (int i = x - y + 1; i <= x; i++) {
res *= i; res %= mod;
}
return res;
}
int mod_pow(int x, int y, int m) {
int res = 1;
while (y) {
if (y & 1) {
res = res * x % m;
}
x = x * x % m;
y >>= 1;
}
return res;
}
int comb(int x, int y) {
if (y > x)return 0;
return kai(x, y)* mod_pow(kai(y, y), mod - 2, mod) % mod;
}
struct edge { int to, cost; };
int par[114514], rank[114514];//親、木の深さ
void init(int n) {
rep(i, n) {
par[i] = i;
rank[i] = 0;
}
}
int find(int x) {
if (par[x] == x) {
return x;
}
else return par[x] = find(par[x]);
}
void unite(int x, int y) {
x = find(x);
y = find(y);
if (x == y)return;
if (rank[x] < rank[y]) {
par[x] = y;
}
else {
par[y] = x;
if (rank[x] == rank[y])rank[x]++;
}
}
bool same(int x, int y) {
return find(x) == find(y);
}
string s;
signed main() {
cin >> s;
int n = s.size();
if (n % 2 == 1)puts("No");
else {
int cnt = 0;
rep(i, n / 2) {
if (s[i] == 'p' && s[n - 1 - i] == 'q')cnt++;
else if (s[i] == 'q' && s[n - 1 - i] == 'p')cnt++;
else if (s[i] == 'd' && s[n - 1 - i] == 'b')cnt++;
else if (s[i] == 'b' && s[n - 1 - i] == 'd')cnt++;
}
if (cnt == n / 2)puts("Yes");
else puts("No");
}
ggr
}
| a.cc: In function 'void init(long long int)':
a.cc:70:17: error: reference to 'rank' is ambiguous
70 | rank[i] = 0;
| ^~~~
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:66:18: note: 'long long int rank [114514]'
66 | int par[114514], rank[114514];//親、木の深さ
| ^~~~
a.cc: In function 'void unite(long long int, long long int)':
a.cc:83:13: error: reference to 'rank' is ambiguous
83 | if (rank[x] < rank[y]) {
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:66:18: note: 'long long int rank [114514]'
66 | int par[114514], rank[114514];//親、木の深さ
| ^~~~
a.cc:83:23: error: reference to 'rank' is ambiguous
83 | if (rank[x] < rank[y]) {
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:66:18: note: 'long long int rank [114514]'
66 | int par[114514], rank[114514];//親、木の深さ
| ^~~~
a.cc:88:21: error: reference to 'rank' is ambiguous
88 | if (rank[x] == rank[y])rank[x]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:66:18: note: 'long long int rank [114514]'
66 | int par[114514], rank[114514];//親、木の深さ
| ^~~~
a.cc:88:32: error: reference to 'rank' is ambiguous
88 | if (rank[x] == rank[y])rank[x]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:66:18: note: 'long long int rank [114514]'
66 | int par[114514], rank[114514];//親、木の深さ
| ^~~~
a.cc:88:40: error: reference to 'rank' is ambiguous
88 | if (rank[x] == rank[y])rank[x]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:66:18: note: 'long long int rank [114514]'
66 | int par[114514], rank[114514];//親、木の深さ
| ^~~~
|
s034596363 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a;
cin>>a;
string b=a;
reverse(a.begin(),a.end());
for(int i=0;i<a.size();i++)
{
if(a[i]=='b')
a[i]='d';
else if(a[i]=='d')
a[i]='b';
else if(a[i]=='p')
a[i]='q';
else if(a[i]=='q')
a[i]='p';
}
if(!(a-b))
cout<<"Yes";
else
cout<<"No";
return 0;
} | a.cc: In function 'int main()':
a.cc:19:11: 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>'})
19 | if(!(a-b))
| ~^~
| | |
| | basic_string<[...]>
| basic_string<[...]>
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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
19 | if(!(a-b))
| ^
/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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
19 | if(!(a-b))
| ^
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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
19 | if(!(a-b))
| ^
/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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
19 | if(!(a-b))
| ^
/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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
19 | if(!(a-b))
| ^
/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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
19 | if(!(a-b))
| ^
/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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
19 | if(!(a-b))
| ^
/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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
19 | if(!(a-b))
| ^
/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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
19 | if(!(a-b))
| ^
/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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
19 | if(!(a-b))
| ^
/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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
19 | if(!(a-b))
| ^
/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:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
19 | if(!(a-b))
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:19:12: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
19 | if(!(a-b))
| ^
|
s163331681 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a;
cin>>a;
string b=a;
reverse(a.begin(),a.end());
for(int i=0;i<a.size();i++)
{
if(a[i]=='b')
a[i]='d';
else if(a[i]=='d')
a[i]='b';
else if(a[i]=='p')
a[i]='q';
else if(a[i]=='q')
a[i]='p';
}
if(!a-b)
cout<<"Yes";
else
cout<<"No";
return 0;
} | a.cc: In function 'int main()':
a.cc:19:8: error: no match for 'operator!' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
19 | if(!a-b)
| ^~
a.cc:19:8: note: candidate: 'operator!(bool)' (built-in)
a.cc:19:8: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
|
s451780869 | p03889 | C++ | #include <bits/stdc++.h> | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s015733941 | p03889 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
using namespace std;
string st;
char ch[100000+10];
long long len;
int main()
{
cin>>st;
len=st.size();
for(int i=0;i<st.size();i++)
{
ch[len-i-1]=st[i];
if(st[i]=='b')ch[len-i-1]='d';
if(st[i]=='d')ch[len-i-1]='b';
if(st[i]=='p')ch[len-i-1]='q';
if(st[i]=='q')ch[len-i-1]='p';
}
for(int i=0;i<len;i++)
if(ch[i]!=st[i])
{
cout<<"No"
return 0;
}
cout<<"Yes";
return 0;
} | a.cc: In function 'int main()':
a.cc:27:35: error: expected ';' before 'return'
27 | cout<<"No"
| ^
| ;
28 | return 0;
| ~~~~~~
|
s098565766 | p03889 | C++ | #include<iostream>
#include<cstring>
using namespace std;
int main(){
string a;
cin>>a;
string b=a;
reverse(a.begin(),a.end());
for(int i=0;i<a.size();++i)
{
if(a[i]=='b') a[i]='d';
else if(a[i]=='d') a[i]='b';
else if(a[i]=='p') a[i]='q';
else if(a[i]=='q') a[i]='p';
}
if(a==b) cout<<"Yes";
else cout<<"No";
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'reverse' was not declared in this scope
8 | reverse(a.begin(),a.end());
| ^~~~~~~
|
s749781701 | p03889 | C++ | #include<iostream>
#include<memory.h>
#include<iomanip>
#include<string>
using namespace std;
int main()
{
int l;
string s,r;
cin>>s;
r=s;
l=s.length();
reverse(s.begin(),s.end());
for(int i=0;i<l;i++)
{
if(s[i]=='b')s[i]='d';
else if(s[i]=='d')s[i]='b';
else if(s[i]=='p')s[i]='q';
else if(s[i]=='q')s[i]='p';
}
if(s==r)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:9: error: 'reverse' was not declared in this scope
13 | reverse(s.begin(),s.end());
| ^~~~~~~
|
s815596966 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
string a,b;
int main()
{
cin>>a;
b=a;
reverse(a.begin(),a.end());
for(int i=0;i<a.size();i++)
{
if(a[i]=='b') a[i]='d';
else if(a[i]=='d') a[i]='b';
else if(a[i]=='p') a[i]='q';
else if(a[i]=='q') a[i]='p';
}
if(a==b) printf("Yes");。
else printf("No");
return 0;
} | a.cc:16:28: error: extended character 。 is not valid in an identifier
16 | if(a==b) printf("Yes");。
| ^
a.cc: In function 'int main()':
a.cc:16:28: error: '\U00003002' was not declared in this scope
16 | if(a==b) printf("Yes");。
| ^~
|
s504861195 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{char a[100005],b[100005];
bool flag=0;
gets(a);
int lena,k=0;
lena=strlen(a);
for(int i=lena-1;i>=0;i--)
{if(a[i]=='b'){
b[k]='d';
k++;
}
else if(a[i]=='d'){
b[k]='b';
k++;
}
else if(a[i]=='p'){
b[k]='q';
k++;
}
else if(a[i]=='q'){
b[k]='p';
k++;
}
}
for(int i=0;i<lena;i++)
{if(a[i]!=b[i]){
cout<<"No";
flag=1;
break;
}
}
if(flag==0)cout<<"Yes";
}
| a.cc: In function 'int main()':
a.cc:6:2: error: 'gets' was not declared in this scope; did you mean 'getw'?
6 | gets(a);
| ^~~~
| getw
|
s470695686 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{char a[100005],b[100005];
bool flag=0;
gets(a);
int lena,k=0;
lena=strlen(a);
for(int i=lena-1;i>=0;i--)
{if(a[i]=='b'){
b[k]='d';
k++;
}
else if(a[i]=='d'){
b[k]='b';
k++;
}
else if(a[i]=='p'){
b[k]='q';
k++;
}
else if(a[i]=='q'){
b[k]='p';
k++;
}
}
for(int i=0;i<lena;i++)
{if(a[i]!=b[i]){
cout<<"No";
flag=1;
break;
}
}
if(flag==0)cout<<"Yes";
}
| a.cc: In function 'int main()':
a.cc:6:2: error: 'gets' was not declared in this scope; did you mean 'getw'?
6 | gets(a);
| ^~~~
| getw
|
s738214929 | p03889 | C++ | #include<iostream>
#include<memory.h>
#include<iomanip>
#include<string>
using namespace std;
int main()
{
int l;
string s,r;
cin>>s;
r=s;
l=s.length();
reverse(s.begin(),s.end());
for(int i=0;i<l;i++)
{
if(s[i]=='b')s[i]='d';
else if(s[i]=='d')s[i]='b';
else if(s[i]=='p')s[i]='q';
else if(s[i]=='q')s[i]='p';
}
if(s==r)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:9: error: 'reverse' was not declared in this scope
13 | reverse(s.begin(),s.end());
| ^~~~~~~
|
s803437938 | p03889 | C++ | #include<iostream>
#include<memory.h>
#include<iomanip>
#include<string>
using namespace std;
int main()
{
int l;
string s,r;
cin>>s;
r=s;
l=s.length();
reverse(s.begin(),s.end());
for(int i=0;i<l;i++)
{
if(s[i]=='b')s[i]='d';
else if(s[i]=='d')s[i]='b';
else if(s[i]=='p')s[i]='q';
else if(s[i]=='q')s[i]='p';
}
if(s==r)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:9: error: 'reverse' was not declared in this scope
13 | reverse(s.begin(),s.end());
| ^~~~~~~
|
s990838253 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int mian()
{
string a;
cin >> a;
string b = a;
reverse(a.begin(), a.end());
for (int i = 0; i < a.length(); ++i)
{
if (a[i] == 'b') a[i] = 'd';
else if (a[i] == 'd') a[i] = 'b';
else if (a[i] == 'p') a[i] = 'q';
else if (a[i] == 'q') a[i] = 'p';
}
if (a == b) cout << "Yes";
else cout << "No";
return 0;
}
| /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s443866709 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int mian()
{
string a;
cin >> a;
string b = a;
reverse(a.begin(), a.end());
for (int i = 0; i < a.length(); ++i)
{
if (a[i] == 'b') a[i] = 'd';
else if (a[i] == 'd') a[i] = 'b';
else if (a[i] == 'p') a[i] = 'q';
else if (a[i] == 'q') a[i] = 'p';
}
if (a == b) cout << "Yes";
else cout << "No";
return 0;
}
| /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s623945646 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
string a;
int main()
{
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
cin>>a;
if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
else cout<<"no";
return 0;
}
| a.cc:10:15: warning: multi-character character constant [-Wmultichar]
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
a.cc:10:28: warning: multi-character character constant [-Wmultichar]
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
a.cc:10:41: warning: multi-character character constant [-Wmultichar]
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
a.cc:10:54: warning: multi-character character constant [-Wmultichar]
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
a.cc: In function 'int main()':
a.cc:10:13: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ~^~~~~~~~
| | |
| | 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:10:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
/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:10:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
/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:10:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
/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:10:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
/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:10:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
/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:10:15: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
/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:10:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
/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:10:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
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:10:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
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:10:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
/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:10:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
/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:10:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
/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:10:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | if(a=='qdbp' || a=='pdbq' || a=='qbdp' || a=='pbdq')
| ^~~~~~
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:10:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived f |
s807147057 | p03889 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
string st="bdqp";
string s1,s2;
int i;
cin>>s1;
int len=strlen(s1);
for(i=len;i>=0;i--)
{
s2[len+1-i]=s1[i];
}
for(i=0;i<len;i++)
{
if(s2[i]==st[0]) s2[i]=st[1];
if(s2[i]==st[1]) s2[i]=st[0];
if(s2[i]==st[2]) s2[i]=st[3];
if(s2[i]==st[3]) s2[i]=st[2];
}
if(s1==s2) cout<<"Yes";
else cout<<"No";
return 0;
} | a.cc: In function 'int main()':
a.cc:10:13: error: 'strlen' was not declared in this scope
10 | int len=strlen(s1);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<cstdio>
+++ |+#include <cstring>
3 | using namespace std;
a.cc:16:8: error: '\U0000ff5b' was not declared in this scope
16 | {
| ^~
a.cc:21:9: error: '\U0000ff5d' was not declared in this scope
21 | }
| ^~
a.cc:23:5: error: 'else' without a previous 'if'
23 | else cout<<"No";
| ^~~~
|
s418828059 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string a;
cin>>a;
string b=a;
reverse(a.begin(),a.end());
for(int i=i;i<a.end();i++)
{
if(a[i]=='b')a[i]=='d';
if(a[i]=='d')a[i]=='b';
if(a[i]=='p')a[i]=='q';
if(a[i]=='q')a[i]=='p';
}
if(a==b)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
} | a.cc: In function 'int main()':
a.cc:9:22: error: no match for 'operator<' (operand types are 'int' and 'std::__cxx11::basic_string<char>::iterator')
9 | for(int i=i;i<a.end();i++)
| ~^~~~~~~~
| | |
| int std::__cxx11::basic_string<char>::iterator
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: 'std::__cxx11::basic_string<char>::iterator' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: 'std::__cxx11::basic_string<char>::iterator' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' is not derived from 'std::basic_string_view<_CharT, _Traits>'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:9:29: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
9 | for(int i=i;i<a.end();i++)
| ^
/usr/include/c++/14/ |
s748276743 | p03889 | C++ | #include<bits/stdc++.h>
using namespce std;
int main()
{
string a;
cin>>a;
string b=a;
reverse(a.begin(),a.end());
for(int i=i;i<a.end();i++)
{
if(a[i]=='b')a[i]=='d';
if(a[i]=='d')a[i]=='b';
if(a[i]=='p')a[i]=='q';
if(a[i]=='q')a[i]=='p';
}
if(a==b)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
} | a.cc:2:7: error: expected nested-name-specifier before 'namespce'
2 | using namespce std;
| ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
5 | string a;
| ^~~~~~
a.cc:5:9: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
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/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>a;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:14: error: 'a' was not declared in this scope
6 | cin>>a;
| ^
a.cc:7:15: error: expected ';' before 'b'
7 | string b=a;
| ^~
| ;
a.cc:8:9: error: 'reverse' was not declared in this scope; did you mean 'std::reverse'?
8 | reverse(a.begin(),a.end());
| ^~~~~~~
| std::reverse
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: 'std::reverse' declared here
249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last);
| ^~~~~~~
a.cc:16:15: error: 'b' was not declared in this scope
16 | if(a==b)cout<<"Yes"<<endl;
| ^
a.cc:16:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | if(a==b)cout<<"Yes"<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:16:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
16 | if(a==b)cout<<"Yes"<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
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/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:17:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
17 | else cout<<"No"<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:17:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
17 | else cout<<"No"<<endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s401140922 | p03889 | C++ | // luogu-judger-enable-o2
| /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s791328065 | p03889 | C++ | // luogu-judger-enable-o2
| /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s950467723 | p03889 | C++ | // luogu-judger-enable-o2
| /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s548026327 | p03889 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
string s,s1;
cin>>s;
s1.reverse(s1.begin(),s1.end());
if(s==s1)cout<<"Yes"<<endl;
else cout<<"No";
} | a.cc: In function 'int main()':
a.cc:8:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'reverse'; did you mean 'reserve'?
8 | s1.reverse(s1.begin(),s1.end());
| ^~~~~~~
| reserve
|
s427674484 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string s,g;
char hs(char c){
if(c=='b') return 'd';
if(c=='d') return 'b';
if(c=='p') return 'q';
return 'p';
}
int i,j,k,l,m,n,b;
int main(){
cin>>s;
for(i=0;i<s.size()){
g+=hs(s[s.zize()-i-1]);
}
if(s==g) cout<<"Yes";
else cout<<"No";
return 0;
} | a.cc: In function 'int main()':
a.cc:13:23: error: expected ';' before ')' token
13 | for(i=0;i<s.size()){
| ^
| ;
a.cc:14:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'zize'; did you mean 'size'?
14 | g+=hs(s[s.zize()-i-1]);
| ^~~~
| size
|
s418130671 | p03889 | C++ | #include<cstring>
#include<cstdio>
char s[100007];
int ch[128],i=1;
int main()
{
ch['p']=1,ch['d']=2,ch['q']=3;
scanf("%s",s+1);
for(l=strlen(s+1);i<=(l>>1)+1;++i)
if(ch[s[i]]^((ch[s[l-i+1]]+2)%4))
{printf("No\n");break;}
printf("Yes\n");
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'l' was not declared in this scope
11 | for(l=strlen(s+1);i<=(l>>1)+1;++i)
| ^
|
s735779902 | p03889 | C++ | #include<bits/stdc++.h>
char s[100007];
int g[128];
int main()
{
g['b'] = 0 , g['p'] = 1 , g['d'] = 2 , g['q'] = 3;
scanf("%s",s+1);
for(int l = strlen(s+1),i=1;i<=(l>>1)+1;i++)
{
if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;
}
return printf("Yes\n"),0;
} | a.cc: In function 'int main()':
a.cc:10:12: error: 'get' was not declared in this scope; did you mean 'std::get'?
10 | if(get[s[i]]^((get[s[l-i+1]]+2)%4)) return printf("No\n"),0;
| ^~~
| std::get
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
from a.cc:1:
/usr/include/c++/14/variant:1180:5: note: 'std::get' declared here
1180 | get(const variant<_Types...>&& __v)
| ^~~
|
s569879179 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
string b=s;
reverse(s.begin(),s.end());
for(int i=0; i<s.size();i++)
{
if(s[i]=='b') s[i]='d';
else if(s[i]=='d') s[i]='b';
else if(s[i]=='p') s[i]='q';
else if(s[i]=='q') s[i]='p';
}
if(a==b)
cout<<"Yes"<<"\n";
else
cout<<"No"<<"\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:16:12: error: 'a' was not declared in this scope
16 | if(a==b)
| ^
|
s111921937 | p03889 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char a[10002],b[10002];
int c;
gets(a);
for(int i=strlen(a)-1;i>=0;i--)
{
b[c]=a[i];
c++;
}
for(int i=0;i<strlen(a);i++)
{
if((a[i]=='b'&&b[i]!='d')||(a[i]=='d'&&b[i]!='b')||(a[i]=='p'&&b[i]!='q')||(a[i]=='q'&&b[i]!='p'))
{
cout<<"NO"<<endl;
return 0;
}
}
cout<<"YES"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(a);
| ^~~~
| getw
|
s951561535 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
string s,s1;
cin>>s;
s1=reverse(s.begin(),s.end());
for(int i=0; i<a.size(); i++) {
if(s[i]=='b') s[i]='d';
else if(s[i]=='d') s[i]='b';
else if(s[i]=='p') s[i]='q';
else if(s[i]=='q') s[i]='p';
}
if(s==s1) {
cout<<"Yes"<<endl;
} else {
cout<<"No"<<endl;
}
} | a.cc: In function 'int main()':
a.cc:6:37: error: no match for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'void')
6 | s1=reverse(s.begin(),s.end());
| ^
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:941:8: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
941 | operator=(const _Tp& __svt)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:941:8: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/basic_string.h: In substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = void; _Res = std::__cxx11::basic_string<char>&; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]':
/usr/include/c++/14/bits/basic_string.h:941:8: required by substitution of 'template<class _Tp> std::__cxx11::basic_string<char>::_If_sv<_Tp, std::__cxx11::basic_string<char>&> std::__cxx11::basic_string<char>::operator=(const _Tp&) [with _Tp = void]'
a.cc:6:30: required from here
6 | s1=reverse(s.begin(),s.end());
| ^
/usr/include/c++/14/bits/basic_string.h:152:70: error: forming reference to void
152 | __not_<is_convertible<const _Tp&, const _CharT*>>>::value,
| ^~~~~
/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:817:37: note: no known conversion for argument 1 from 'void' to 'const std::__cxx11::basic_string<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:828:31: note: no known conversion for argument 1 from 'void' to 'const 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:840:24: note: no known conversion for argument 1 from 'void' to '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)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:32: note: no known conversion for argument 1 from 'void' to 'std::__cxx11::basic_string<char>&&'
858 | operator=(basic_string&& __str)
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:926:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
926 | operator=(initializer_list<_CharT> __l)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:926:42: note: no known conversion for argument 1 from 'void' to 'std::initializer_list<char>'
926 | operator=(initializer_list<_CharT> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:7:24: error: 'a' was not declared in this scope
7 | for(int i=0; i<a.size(); i++) {
| ^
|
s494234520 | p03889 | C++ | #include <cstdio>//头文件不解释
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iomanip>
#define rr register
#define int long long
#define f_for(i,a,b) for(rr int i=a;i<=b;i++)
using namespace std;
const int maxx=1e4;
int n,m;
string a,b;
int main()
{
cin>>a;
b=a;// 把原来的赋到b上最后比较
bool t=true;
int len=a.length()-1;
for(rr int i=0; i<=len; i++)
switch(a[i])
{
case 'q':
a[i]='p';
break;
case 'p':
a[i]='q';
break;
case 'b':
a[i]='d';
break;
case 'd':
a[i]='b';
break;
}
for(rr int i=0; i<=len; i++)
if(a[i]!=b[len-i])
t=false;
if(t)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
| cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:21:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
21 | for(rr int i=0; i<=len; i++)
| ^
a.cc:37:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
37 | for(rr int i=0; i<=len; i++)
| ^
|
s376810720 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
char s[100009];
int a[228];
int main()
{
int i;
a['b']=0;
a['p']=1;
a['d']=2;
a['q']=3;
scanf("%s",s+1);
for(i=strlen(s+1),i=1;i<=(i>>1)+1;i++)
{
if(a[s[i]]^((a[s[l-i+1]]+2)%4))
{
cout<<"No"<<endl;
return 0;
}
}
cout<<"Yes"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:24: error: 'l' was not declared in this scope
15 | if(a[s[i]]^((a[s[l-i+1]]+2)%4))
| ^
|
s091261956 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string str;
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin>>str;
string tmp=str;
reverse(str.begin(),str.end())
for(string::iterator it=str.begin();it!=str.end();++it)
switch(*it)
{
case 'p':*it='q';break;
case 'q':*it='p';break;
case 'b':*it='d';break;
case 'd':*it='b';break;
}
if(str==tmp) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:35: error: expected ';' before 'for'
11 | reverse(str.begin(),str.end())
| ^
| ;
12 | for(string::iterator it=str.begin();it!=str.end();++it)
| ~~~
a.cc:12:41: error: 'it' was not declared in this scope; did you mean 'int'?
12 | for(string::iterator it=str.begin();it!=str.end();++it)
| ^~
| int
|
s716941177 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s,a;
cin>>s;
a=reverse(s.begin(),s.end());
int len=s.size();
for(int i=0;i<len;i++)
{
if(s[i]=='p') s[i]=='q';
if(s[i]=='d') s[i]=='b';
}
if(s==a) cout<<"Yes";
else cout<<"No";
} | a.cc: In function 'int main()':
a.cc:7:36: error: no match for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'void')
7 | a=reverse(s.begin(),s.end());
| ^
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:941:8: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
941 | operator=(const _Tp& __svt)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:941:8: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/basic_string.h: In substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = void; _Res = std::__cxx11::basic_string<char>&; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]':
/usr/include/c++/14/bits/basic_string.h:941:8: required by substitution of 'template<class _Tp> std::__cxx11::basic_string<char>::_If_sv<_Tp, std::__cxx11::basic_string<char>&> std::__cxx11::basic_string<char>::operator=(const _Tp&) [with _Tp = void]'
a.cc:7:29: required from here
7 | a=reverse(s.begin(),s.end());
| ^
/usr/include/c++/14/bits/basic_string.h:152:70: error: forming reference to void
152 | __not_<is_convertible<const _Tp&, const _CharT*>>>::value,
| ^~~~~
/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:817:37: note: no known conversion for argument 1 from 'void' to 'const std::__cxx11::basic_string<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:828:31: note: no known conversion for argument 1 from 'void' to 'const 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:840:24: note: no known conversion for argument 1 from 'void' to '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)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:32: note: no known conversion for argument 1 from 'void' to 'std::__cxx11::basic_string<char>&&'
858 | operator=(basic_string&& __str)
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:926:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
926 | operator=(initializer_list<_CharT> __l)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:926:42: note: no known conversion for argument 1 from 'void' to 'std::initializer_list<char>'
926 | operator=(initializer_list<_CharT> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
|
s535995086 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
string s;
int main()
{
cin>>s;
string b=s;
reverse(s.begin(),s.end());
for(int i=0;i<a.size();++i)
{
if(s[i]=='b')s[i]='d';
else if(s[i]=='d')s[i]='b';
else if(s[i]=='p')s[i]='q';
else if(s[i]=='q')s[i]='p';
}
if(s==b) cout<<"Yes";
else cout<<"No";
return 0;
} | a.cc: In function 'int main()':
a.cc:9:19: error: 'a' was not declared in this scope
9 | for(int i=0;i<a.size();++i)
| ^
|
s731975038 | p03889 | C++ | #include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
string s;
cin >> s;
string t = "";
string r = s;
reverse(s.begin(), s.end());
for (int i = 0; i < r.length(); i++) {
if (r[i] == 'b') t += 'd';
else if (r[i] == 'd') t += 'b';
else if (r[i] == 'p') t += 'q';
else if (r[i] == 'q') t += 'p';
}
if (t == s) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
return 0;
} | a.cc: In function 'int main(int, char**)':
a.cc:11:5: error: 'reverse' was not declared in this scope
11 | reverse(s.begin(), s.end());
| ^~~~~~~
|
s936392412 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a;
char k;
cin>>a;
string b="";
for(int i=a.length()-1;i>=0;i--)
{
k=a[i];
switch(k)
{
case 'b':b+="d";
case 'd':b+="b";
case "p":b+="q";
case 'q':b+="p";
}
}
if(a==b) cout<<"Yes";
else cout<<"No";
} | a.cc: In function 'int main()':
a.cc:15:18: error: conversion from 'const char*' to 'int' in a converted constant expression
15 | case "p":b+="q";
| ^~~
a.cc:15:18: error: could not convert '"p"' from 'const char [2]' to 'int'
15 | case "p":b+="q";
| ^~~
| |
| const char [2]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.