submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s942090988 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string x,y;
int sum;
cin>>x;
sum=strlen(x);/
sum=sum-1;
for(int i=0;a[i]!='\0';i++){
if(x[i]=='b') y[sum]='d';
if(x[i]=='d') y[sum]='b';
if(x[i]=='p') y[sum]='q';
if(x[i]=='q') y[sum]='p';
sum--;
}
if(strcmp(x,y)==false)
{
cout<<"Yes";
}
else
{
cout<<"No";
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:16: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
8 | sum=strlen(x);/
| ^
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
from a.cc:1:
/usr/include/string.h:407:35: note: initializing argument 1 of 'size_t strlen(const char*)'
407 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
a.cc:8:19: error: expected primary-expression before '/' token
8 | sum=strlen(x);/
| ^
a.cc:10:17: error: 'a' was not declared in this scope
10 | for(int i=0;a[i]!='\0';i++){
| ^
a.cc:17:15: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
17 | if(strcmp(x,y)==false)
| ^
| |
| std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:156:32: note: initializing argument 1 of 'int strcmp(const char*, const char*)'
156 | extern int strcmp (const char *__s1, const char *__s2)
| ~~~~~~~~~~~~^~~~
|
s277750731 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
char x[88888888],y[88888888];
int sum;
cin>>x;
sum=strlen(x);/
sum=sum-1;
for(int i=0;a[i]!='\0';i++){
if(x[i]=='b') y[sum]='d';
if(x[i]=='d') y[sum]='b';
if(x[i]=='p') y[sum]='q';
if(x[i]=='q') y[sum]='p';
sum--;
}
if(strcmp(x,y)==false)
{
cout<<"Yes";
}
else
{
cout<<"No";
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:19: error: expected primary-expression before '/' token
8 | sum=strlen(x);/
| ^
a.cc:10:17: error: 'a' was not declared in this scope
10 | for(int i=0;a[i]!='\0';i++){
| ^
|
s793283278 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
string s;
int main(){
cin>>s;
string s1=reverse(s.begin(),s.end());
for(interestingi;i<s.length();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";
else cout<<"No";
} | a.cc: In function 'int main()':
a.cc:6:26: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
6 | string s1=reverse(s.begin(),s.end());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~
a.cc:7:13: error: 'interestingi' was not declared in this scope
7 | for(interestingi;i<s.length();i++){
| ^~~~~~~~~~~~
a.cc:7:26: error: 'i' was not declared in this scope
7 | for(interestingi;i<s.length();i++){
| ^
a.cc:8:35: error: 'd' was not declared in this scope
8 | if(s[i]=='b')s[i]=d;
| ^
|
s081689138 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
string s;
int main(){
cin>>s;
string s1=reverse(s.begin(),s.end());
for(interestingi;i<s.length();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";
else cout<<"No";
} | a.cc:11:40: warning: missing terminating ' character
11 | else if(s[i]=='q')s[i]='p;
| ^
a.cc:11:40: error: missing terminating ' character
11 | else if(s[i]=='q')s[i]='p;
| ^~~
a.cc: In function 'int main()':
a.cc:6:26: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
6 | string s1=reverse(s.begin(),s.end());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~
a.cc:7:13: error: 'interestingi' was not declared in this scope
7 | for(interestingi;i<s.length();i++){
| ^~~~~~~~~~~~
a.cc:7:26: error: 'i' was not declared in this scope
7 | for(interestingi;i<s.length();i++){
| ^
a.cc:8:35: error: 'd' was not declared in this scope
8 | if(s[i]=='b')s[i]=d;
| ^
a.cc:12:9: error: expected primary-expression before '}' token
12 | }
| ^
|
s078660209 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
string s;
int main(){
cin>>s;
string s1=reverse(s1.begin(),s1.end());
for(interestingi;i<s.length();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";
else cout<<"No";
} | a.cc: In function 'int main()':
a.cc:6:26: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
6 | string s1=reverse(s1.begin(),s1.end());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:7:13: error: 'interestingi' was not declared in this scope
7 | for(interestingi;i<s.length();i++){
| ^~~~~~~~~~~~
a.cc:7:26: error: 'i' was not declared in this scope
7 | for(interestingi;i<s.length();i++){
| ^
a.cc:8:35: error: 'd' was not declared in this scope
8 | if(s[i]=='b')s[i]=d;
| ^
a.cc:11:40: error: 'p' was not declared in this scope
11 | else if(s[i]=='q')s[i]=p;
| ^
|
s038089097 | p03889 | C++ | #include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
#define twovec(a,n,m) vector<vector<int>> a(n,vector<int>(m,0))
#define Twovec(a,n,m) vector<vector<double>> a(n,vector<double>(m,0))
#define P pair<int,int>
#define All(a) (a).begin(),(a).end()
#define Sort(a) sort(All(a))
#define Reverse(a) reverse(All(a))
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
#define print(a) cout << (a) << endl;
#define peintD(a) cout << setprecision(10) << ans << endl;
using namespace std;
int max_int = 1000000007;
void Debug(auto a);
int nibul(auto a,auto b);
int nibuu(auto a,auto b);
void input(vector<int>& a,int n);
class Modulo{
public:
int val;
static const int mod = 1e9+7;
vector<int> factable = {1};
vector<int> invtable = {1};
int pro(int x,int y){return ((x%mod)*(y%mod))%mod;}
int sum(int x,int y){return ((x%mod)+(y%mod))%mod;}
int dif(int x,int y){int d =((x%mod)-(y%mod))%mod;if(d>=0){return d;}else{return d+mod;}}
int quo(int x, int y){return pro(x,pow(y,mod-2));}
int pow(int x,int y){
if(y<=0){return 1;}
if(y%2==0){int d = pow(x,y/2);return ((d%mod)*(d%mod))%mod;}
else{return (x*pow(x,y-1))%mod;}
}
void operator=(int n){this->val = n%mod;}
int operator+(int n){return sum(this->val,n);}
int operator-(int n){return dif(this->val,n);}
int operator*(int n){return pro(this->val,n);}
int operator/(int n){return quo(this->val,n);}
void operator+=(int n){this->val = sum(this->val,n);}
void operator-=(int n){this->val = dif(this->val,n);}
void operator*=(int n){this->val = pro(this->val,n);}
void operator/=(int n){this->val = quo(this->val,n);}
int fac(int x){
//x! mod mod
if(factable.size()<=x){
int s = factable.size();
FOR(i,s,x+1){
factable.push_back(pro(i,factable.back()));
invtable.push_back(quo(1,factable.back()));
}
}
if(x<0) return 1;
else return factable[x];
}
int facinv(int x){
if(invtable.size()<=x){
int s = invtable.size();
FOR(i,s,x+1){
factable.push_back(pro(i,factable.back()));
invtable.push_back(quo(1,factable.back()));
}
}
if(x<0) return 1;
else return invtable[x];
}
int com(int x,int y){
//xCy mod mod = x!/((x-y)!*y!) mod mod
if(x-y<y)return com(x,x-y);
return pro(fac(x),pro(facinv(x-y),facinv(y)));
}
};
struct UnionFind {
vector<int> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2
UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
for(int i = 0; i < N; i++) par[i] = i;
}
int root(int x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根}
if (par[x] == x) return x;
return par[x] = root(par[x]);
}
void unite(int x, int y) { // xとyの木を併合
int rx = root(x); //xの根をrx
int ry = root(y); //yの根をry
if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時:xの根rxをyの根ryにつける
}
bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
int rx = root(x);
int ry = root(y);
return rx == ry;
}
};
int n,m;
signed main(){
string s;
cin >> s;
int n = s.size()-1;
bool ans = true;
REP(i,s.size()){
if(s[i] == 'p' && s[n-i] != 'q'){
ans = false;
}
if(s[i] == 'q' && s[n-i] != 'p'){
ans = false;
}
if(s[i] == 'b' && s[n-i] != 'd'){
ans = false;
}
if(s[i] == 'd' && s[n-i] != 'b'){
ans = false;
}
}
(ans)? print("Yes"):print("No");
return 0;
}
void Debug(auto a){
cout << "{ ";
for(auto b: a){
cout << b << " ";
}
cout << "}" << endl;
}
int nibul(auto a,auto b){
int x = lower_bound(All(a),b) - a.begin();
//key以上の初めてのitr
return x;
}
int nibuu(auto a,auto b){
int x = upper_bound(All(a),b) - a.begin();
//key以下の最後のitr
return x-1;
}
void input(vector<int>& a,int n){
REP(i,n){
cin >> a[i];
}
}
| a.cc:19:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
19 | void Debug(auto a);
| ^~~~
a.cc:20:11: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
20 | int nibul(auto a,auto b);
| ^~~~
a.cc:20:18: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
20 | int nibul(auto a,auto b);
| ^~~~
a.cc:21:11: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
21 | int nibuu(auto a,auto b);
| ^~~~
a.cc:21:18: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
21 | int nibuu(auto a,auto b);
| ^~~~
a.cc: In function 'int main()':
a.cc:15:37: error: expected ':' before ';' token
15 | #define print(a) cout << (a) << endl;
| ^
a.cc:124:12: note: in expansion of macro 'print'
124 | (ans)? print("Yes"):print("No");
| ^~~~~
a.cc:15:37: error: expected primary-expression before ';' token
15 | #define print(a) cout << (a) << endl;
| ^
a.cc:124:12: note: in expansion of macro 'print'
124 | (ans)? print("Yes"):print("No");
| ^~~~~
a.cc:124:24: error: expected primary-expression before ':' token
124 | (ans)? print("Yes"):print("No");
| ^
a.cc: At global scope:
a.cc:129:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
129 | void Debug(auto a){
| ^~~~
a.cc:136:11: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
136 | int nibul(auto a,auto b){
| ^~~~
a.cc:136:18: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
136 | int nibul(auto a,auto b){
| ^~~~
a.cc:141:11: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
141 | int nibuu(auto a,auto b){
| ^~~~
a.cc:141:18: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
141 | int nibuu(auto a,auto b){
| ^~~~
|
s548459149 | p03889 | C++ | #include <iostream>
using namespace std;
int main()
{
string s;
cin >> s;
string s1(s);
s1.reverse();
const int slen = s1.length();
for (int i = 0; i < slen; i++)
{
if (s1[i] == 'b') s1[i] = 'd';
else if (s1[i] == 'd') s1[i] = 'b';
else if (s1[i] == 'p') s1[i] = 'q';
else if (s1[i] == 'q') s1[i] = 'p';
}
if (s == s1) cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'reverse'; did you mean 'reserve'?
9 | s1.reverse();
| ^~~~~~~
| reserve
|
s636689994 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int s;
string p,q;
cin>>p;
s=p.size();
for(int i=0;i<s;i++){
q[i]=p[s-i-1];//这里翻转之后的在P数组里,后面修改的却是Q数组
if(q[i]=='b')
q[i]='d';
else
if(q[i]=='d')
q[i]='b';
else
if(q[i]=='p')
q[i]='q';
else
if(q[i]=='q')
q[i]='p';
//没有问题
}
for(int i=0;i<s;i++){
if(p[i]!=q[i]){
cout<<"No";
return 0;
}
}//if(p!=q)cout<<"No";
cout<<"Yes";
return 0;
}
源码
```
#include<bits/stdc++.h>
using namespace std;
int main(){
int s;
string p,q;
cin>>p;
s=p.size();
for(int i=0;i<s;i++){
q[i]=p[s-i-1];//这里翻转之后的在P数组里,后面修改的却是Q数组
if(q[i]=='b')
q[i]='d';
else
if(q[i]=='d')
q[i]='b';
else
if(q[i]=='p')
q[i]='q';
else
if(q[i]=='q')
q[i]='p';
//没有问题
}
for(int i=0;i<s;i++){
if(p[i]!=q[i]){
cout<<"No";
return 0;
}
}//if(p!=q)cout<<"No";
cout<<"Yes";
return 0;
} | a.cc:33:1: error: stray '`' in program
33 | ```
| ^
a.cc:33:2: error: stray '`' in program
33 | ```
| ^
a.cc:33:3: error: stray '`' in program
33 | ```
| ^
a.cc:32:1: error: '\U00006e90\U00007801' does not name a type
32 | 源码
| ^~~~
a.cc:36:5: error: redefinition of 'int main()'
36 | int main(){
| ^~~~
a.cc:3:5: note: 'int main()' previously defined here
3 | int main(){
| ^~~~
|
s668111117 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
string a;
int main()
{
cin>>a;
int len=a.size();
if(len%2==1)
{
cout<<"No";
cout<<endl;
return 0;
}
int r=0;
for(int i=0,j=len-1;i<j;i++,j--)
{
if((a[i]=='p' && a[j]=='q') || (a[i]=='q' && a[j]=='p') ||(a[i]=='d' && a[j]=='b') || (a[i]=='b' && a[j]=='d')) ;
else
{ | a.cc: In function 'int main()':
a.cc:20:10: error: expected '}' at end of input
20 | {
| ~^
a.cc:20:10: error: expected '}' at end of input
a.cc:17:5: note: to match this '{'
17 | {
| ^
a.cc:20:10: error: expected '}' at end of input
20 | {
| ^
a.cc:6:1: note: to match this '{'
6 | {
| ^
|
s923151389 | p03889 | C++ | #include <bits/stdc++.h>
#define ll long long
#define INF 1000000000
using namespace std;
string s,ll;
int main(){
cin>>s;
lll=s;
for(int i=0;i<s.size()/2;i++)swap(s[i],s[s.size()-1-i ] );
for(int i=0;i<s.size();i++){
switch(s[i]){
case 'b':s[i]='d';break;
case 'd':s[i]='b';break;
case 'p':s[i]='q';break;
case 'q':s[i]='p';break;
}
if(s!=lll)printf("No\n");
else printf("Yes\n");
}
return 0;
} | a.cc:2:12: error: expected unqualified-id before 'long'
2 | #define ll long long
| ^~~~
a.cc:5:10: note: in expansion of macro 'll'
5 | string s,ll;
| ^~
a.cc: In function 'int main()':
a.cc:8:5: error: 'lll' was not declared in this scope; did you mean 'll'?
8 | lll=s;
| ^~~
| ll
|
s438802007 | p03889 | C++ | #include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
char s[100005],s1[100005];
int main()
{
gets(s);
int len=strlen(s),m=-1;
for(int i=len-1;i>=0;i--)
{
s1[++m]=s[i];
if(s1[m]=='b')s1[m]='d';
else if(s1[m]=='d')s1[m]='b';
else if(s1[m]=='p')s1[m]='q';
else if(s1[m]=='q')s1[m]='p';
}
int p=1;
for(int i=0;i<len;i++)
{
if(s[i]!=s1[i])p=0;
}
if(p)printf("Yes");
else printf("No");
//printf("%c%c%c%c",s1[0],s1[1],s1[2],s1[3]);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(s);
| ^~~~
| getw
|
s739266775 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s1;
cin>>s1;
string b=s1;
reverse(s1.begin(),s1.end());
for(int i=0;i<s1.size();++i)
{
if(s1[i]=='b') s1[i]='d';
else if(s1[i]=='d') s1[i]='b';
else if(s1[i]=='p') s1[i]='q';
else if(s1[i]=='q') s1[i]='p';
}
if(s1==b) cout<<"Yes";
else cout<<"No";
court<<endl;
}
| a.cc: In function 'int main()':
a.cc:17:6: error: 'court' was not declared in this scope
17 | court<<endl;
| ^~~~~
|
s570943330 | p03889 | C++ | #include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
char s[100007];
int get[128];
int main()
{
get['b'] = 0 , get['p'] = 1 , get['d'] = 2 , get['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:15:30: error: expected '}' at end of input
15 | return printf("Yes\n"),0;
| ^
a.cc:8:1: note: to match this '{'
8 | {
| ^
|
s795535940 | p03889 | C++ | include<bits/stdc++.h>
using namespace std;
int main() {
cout<<"Yes"<<endl;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:4:5: error: 'cout' was not declared in this scope
4 | cout<<"Yes"<<endl;
| ^~~~
a.cc:4:18: error: 'endl' was not declared in this scope
4 | cout<<"Yes"<<endl;
| ^~~~
|
s018868280 | p03889 | C++ | #include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
string a;
cin>>a;
if(a[0]=='b') b++;
if(a[0]=='d') d++;
if(a[0]=='q') q++;
if(a[0]=='p') p++;
if(a[1]=='b') b++;
if(a[1]=='d') d++;
if(a[1]=='q') q++;
if(a[1]=='p') p++;
if(a[2]=='b') b++;
if(a[2]=='d') d++;
if(a[2]=='q') q++;
if(a[2]=='p') p++;
if(a[3]=='b') b++;
if(a[3]=='d') d++;
if(a[3]=='q') q++;
if(a[3]=='p') p++;
if(b==1&&d==1&&p==1&&q==1) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:23: error: 'b' was not declared in this scope
8 | if(a[0]=='b') b++;
| ^
a.cc:9:23: error: 'd' was not declared in this scope
9 | if(a[0]=='d') d++;
| ^
a.cc:10:23: error: 'q' was not declared in this scope
10 | if(a[0]=='q') q++;
| ^
a.cc:11:23: error: 'p' was not declared in this scope
11 | if(a[0]=='p') p++;
| ^
a.cc:12:23: error: 'b' was not declared in this scope
12 | if(a[1]=='b') b++;
| ^
a.cc:13:23: error: 'd' was not declared in this scope
13 | if(a[1]=='d') d++;
| ^
a.cc:14:23: error: 'q' was not declared in this scope
14 | if(a[1]=='q') q++;
| ^
a.cc:15:23: error: 'p' was not declared in this scope
15 | if(a[1]=='p') p++;
| ^
a.cc:16:23: error: 'b' was not declared in this scope
16 | if(a[2]=='b') b++;
| ^
a.cc:17:23: error: 'd' was not declared in this scope
17 | if(a[2]=='d') d++;
| ^
a.cc:18:23: error: 'q' was not declared in this scope
18 | if(a[2]=='q') q++;
| ^
a.cc:19:23: error: 'p' was not declared in this scope
19 | if(a[2]=='p') p++;
| ^
a.cc:20:23: error: 'b' was not declared in this scope
20 | if(a[3]=='b') b++;
| ^
a.cc:21:23: error: 'd' was not declared in this scope
21 | if(a[3]=='d') d++;
| ^
a.cc:22:23: error: 'q' was not declared in this scope
22 | if(a[3]=='q') q++;
| ^
a.cc:23:23: error: 'p' was not declared in this scope
23 | if(a[3]=='p') p++;
| ^
a.cc:24:12: error: 'b' was not declared in this scope
24 | if(b==1&&d==1&&p==1&&q==1) cout<<"Yes"<<endl;
| ^
a.cc:24:18: error: 'd' was not declared in this scope
24 | if(b==1&&d==1&&p==1&&q==1) cout<<"Yes"<<endl;
| ^
a.cc:24:24: error: 'p' was not declared in this scope
24 | if(b==1&&d==1&&p==1&&q==1) cout<<"Yes"<<endl;
| ^
a.cc:24:30: error: 'q' was not declared in this scope
24 | if(b==1&&d==1&&p==1&&q==1) cout<<"Yes"<<endl;
| ^
|
s778777739 | p03889 | C++ | #include<iostream>
#include<cstring>
using namespace std;
int main(){
string a,b;
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)
cout<<"Yes";
else
cout<<"No";
return 0;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'reverse' was not declared in this scope
8 | reverse(a.begin(),a.end());
| ^~~~~~~
|
s379601326 | 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:18:12: error: unable to find numeric literal operator 'operator""\U0000ff1b'
18 | return 0;
| ^~~
a.cc:18:15: error: expected ';' before '}' token
18 | return 0;
| ^
| ;
19 | }
| ~
|
s377461327 | 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"<<endl;
else cout<<"No"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:37: error: '\U00004e86' was not declared in this scope
11 | else if(a[i]=='d') a[i]='b';了
| ^~
a.cc:13:9: error: 'else' without a previous 'if'
13 | else if(a[i]=='q') a[i]='p';
| ^~~~
|
s004322196 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
char a[100001],b[10001];
int len;
int main()
{
cin>>a;
strcpy(b,a);
strrev(a);
len=strlen(a);
for(int i=0;i<len;i++)
{
if(a[i]=='b') a[i]='d';
else if(a[i]=='d') a[i]='b';
else if(a[i]=='q') a[i]='p';
else if(a[i]=='p') a[i]='q';
}
if(strcmp(a,b)==0)
{
cout<<"Yes";
}
else
{
cout<<"No";
}
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
9 | strrev(a);
| ^~~~~~
| strsep
|
s974522603 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
char a[100001],b[10001];
int len;
int main()
{
cin>>a;
strcpy(b,a);
strrev(a);
len=strlen(a);
for(int i=0;i<len;i++)
{
if(a[i]=='b') a[i]='d';
else if(a[i]=='d') a[i]='b';
else if(a[i]=='q') a[i]='p';
else if(a[i]=='p') a[i]='q';
}
if(strcmp(a,b)==0)
{
cout<<"Yes";
}
else
{
cout<<"No";
}
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
9 | strrev(a);
| ^~~~~~
| strsep
|
s745575050 | p03889 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int m,n;
char a[100005],b;
int abs(int x){
if(x>=0) return x;
else return x*-1;
}
int main(){
while((a[++m]=getchar())!='\n');
if(m%2!=0){
cout<<"No"<<endl;
return 0;
}
for(int i=m;i>=m/2;i--){
int cha=abs(a[i],a[m-i+1]);
if(cha!=1&&cha!=2){
cout<<"No"<<endl;
return 0;
}
}
cout<<"Yes"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:17:28: error: no matching function for call to 'abs(char&, char&)'
17 | int cha=abs(a[i],a[m-i+1]);
| ~~~^~~~~~~~~~~~~~~
a.cc:6:5: note: candidate: 'int abs(int)'
6 | int abs(int x){
| ^~~
a.cc:6:5: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/cstdlib:81,
from /usr/include/c++/14/ext/string_conversions.h:43,
from /usr/include/c++/14/bits/basic_string.h:4154,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate expects 1 argument, 2 provided
|
s652470882 | p03889 | C++ | #include <iostream>
#include <cstdio>
#include<bits/stdc++.h>
using namespace std;
int m,n;
string a,b;
char czy(char x){
if(x=='d'){
return x-2;
}
if(x=='b'){
return x+2;
}
if(x=='p'){
return x+1;
}
if(x=='q'){
return x-1;
}
}
int main(){
while((b=getchar())!='\n'){
cin>>b;
a[++m]=b;
}
if(m%2!=0){
cout<<"No";
}
for(int i=m;i>=1;i--){
if(czy(a[i])!=a[m-i+1]){
cout<<"No";
return 0;
}
}
cout<<"Yes"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:22:28: error: no match for 'operator!=' (operand types are 'std::__cxx11::basic_string<char>' and 'char')
22 | while((b=getchar())!='\n'){
| ~~~~~~~~~~~~~^~~~~~
| | |
| | char
| 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:3:
/usr/include/c++/14/bits/regex.h:1132:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1132 | operator!=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1132:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
22 | while((b=getchar())!='\n'){
| ^~~~
/usr/include/c++/14/bits/regex.h:1212: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>&)'
1212 | operator!=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1212:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
22 | while((b=getchar())!='\n'){
| ^~~~
/usr/include/c++/14/bits/regex.h:1305: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>&)'
1305 | operator!=(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1305:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
22 | while((b=getchar())!='\n'){
| ^~~~
/usr/include/c++/14/bits/regex.h:1379:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1379 | operator!=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1379:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
22 | while((b=getchar())!='\n'){
| ^~~~
/usr/include/c++/14/bits/regex.h:1473:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1473 | operator!=(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1473:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
22 | while((b=getchar())!='\n'){
| ^~~~
/usr/include/c++/14/bits/regex.h:1547:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1547 | operator!=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1547:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
22 | while((b=getchar())!='\n'){
| ^~~~
/usr/include/c++/14/bits/regex.h:1647:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1647 | operator!=(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1647:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
22 | while((b=getchar())!='\n'){
| ^~~~
/usr/include/c++/14/bits/regex.h:2213:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator!=(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2213 | operator!=(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2213:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
22 | while((b=getchar())!='\n'){
| ^~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)'
197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::fpos<_StateT>'
22 | while((b=getchar())!='\n'){
| ^~~~
In file included from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)'
243 | operator!=(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::allocator<_CharT>'
22 | while((b=getchar())!='\n'){
| ^~~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
455 | operator!=(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
22 | while((b=getchar())!='\n'){
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
500 | operator!=(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
22 | while((b=getchar())!='\n'){
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1686 | operator!=(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::move_iterator<_IteratorL>'
22 | while((b=getchar())!='\n'){
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1753 | operator!=(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::move_iterator<_IteratorL>'
22 | while((b=getchar())!='\n'){
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed:
a.cc:22:30: note: 'std::__cxx11::basic_string<char>' is not derived from 'const std::pair<_T1, _T2>'
22 | while((b=getchar())!='\n'){
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
651 | operator |
s144105045 | p03889 | C++ | #include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<(n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) (s.substr(f-1,t-f+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;
struct Grid{ll x,y,t;};
struct Edge{ll to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
const ll Inf = llINF;const int MAX_V=201010;vector<ll>d;
Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
void add_edge(ll from,ll to,ll cost){E[from].pb({to,cost});}
};
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
string s;cin>>s;
if(s.size()%2)cout<<"No"<<endl;
else{
map<char,char>MP;
MP['p']='q';
MP['q']='p';
MP['d']='b';
MP['b']='d';
bool fl=true;
for(int i=0;i<n/2;i++){
if(MP[s[n-i]]!=s[i])fl=false;
}
if(fl)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:38:19: error: 'n' was not declared in this scope
38 | for(int i=0;i<n/2;i++){
| ^
|
s303100763 | p03889 | C++ | #include <iostream>
using namespace std;
int main{
cout<<"NO";
return 0;
} | a.cc:3:5: error: cannot declare '::main' to be a global variable
3 | int main{
| ^~~~
a.cc:4:15: error: expected '}' before ';' token
4 | cout<<"NO";
| ^
a.cc:3:9: note: to match this '{'
3 | int main{
| ^
a.cc:4:9: error: invalid user-defined conversion from 'std::basic_ostream<char>' to 'int' [-fpermissive]
4 | cout<<"NO";
| ~~~~^~~~~~
In file included from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_ios.h:121:16: note: candidate is: 'std::basic_ios<_CharT, _Traits>::operator bool() const [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
121 | explicit operator bool() const
| ^~~~~~~~
/usr/include/c++/14/bits/basic_ios.h:121:16: note: return type 'bool' of explicit conversion function cannot be converted to 'int' with a qualification conversion
a.cc:5:5: error: expected unqualified-id before 'return'
5 | return 0;
| ^~~~~~
a.cc:6:1: error: expected declaration before '}' token
6 | }
| ^
|
s423669749 | p03889 | C++ | #include<bits/stdc++.h>//'三玖是天! '.
using namespace std;
int main()
{
string s,ss;
cin>>s;
ss=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(s[i]=='q')s[i]='p';
}
if(ss==s)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:14:32: error: expected ';' before 's'
14 | else(s[i]=='q')s[i]='p';
| ^
| ;
|
s321977978 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string a,s;
int main(){
cin >> a;
s = 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 a[i] = "p";
}
if (a == s)
cout << "Yes";
else cout << "No";
return 0;
} | a.cc: In function 'int main()':
a.cc:9:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if (a[i] == "b") a[i] = "d";
a.cc:9:33: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
9 | if (a[i] == "b") a[i] = "d";
| ^~~
| |
| const char*
a.cc:10:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | else if (a[i] == "d") a[i] = "b";
a.cc:10:38: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
10 | else if (a[i] == "d") a[i] = "b";
| ^~~
| |
| const char*
a.cc:11:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | else if (a[i] == "p") a[i] = "q";
a.cc:11:38: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
11 | else if (a[i] == "p") a[i] = "q";
| ^~~
| |
| const char*
a.cc:12:21: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
12 | else a[i] = "p";
| ^~~
| |
| const char*
|
s755904735 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string a,s;
int main(){
cin >> a;
s = 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 a[i] = "p";
}
if (a == b)
cout << "Yes";
else cout << "No";
return 0;
} | a.cc: In function 'int main()':
a.cc:9:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if (a[i] == "b") a[i] = "d";
a.cc:9:33: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
9 | if (a[i] == "b") a[i] = "d";
| ^~~
| |
| const char*
a.cc:10:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | else if (a[i] == "d") a[i] = "b";
a.cc:10:38: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
10 | else if (a[i] == "d") a[i] = "b";
| ^~~
| |
| const char*
a.cc:11:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | else if (a[i] == "p") a[i] = "q";
a.cc:11:38: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
11 | else if (a[i] == "p") a[i] = "q";
| ^~~
| |
| const char*
a.cc:12:21: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
12 | else a[i] = "p";
| ^~~
| |
| const char*
a.cc:14:14: error: 'b' was not declared in this scope
14 | if (a == b)
| ^
|
s233894016 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
string a,s;
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 a[i] = "p";
}
if (a == b)
cout << "Yes";
else cout << "No";
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: 'b' was not declared in this scope
6 | b = a;
| ^
a.cc:9:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if (a[i] == "b") a[i] = "d";
a.cc:9:33: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
9 | if (a[i] == "b") a[i] = "d";
| ^~~
| |
| const char*
a.cc:10:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | else if (a[i] == "d") a[i] = "b";
a.cc:10:38: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
10 | else if (a[i] == "d") a[i] = "b";
| ^~~
| |
| const char*
a.cc:11:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | else if (a[i] == "p") a[i] = "q";
a.cc:11:38: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
11 | else if (a[i] == "p") a[i] = "q";
| ^~~
| |
| const char*
a.cc:12:21: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
12 | else a[i] = "p";
| ^~~
| |
| const char*
|
s036415101 | p03889 | C++ | #include <cstdio>
#include <string>
#include <iostream>
int main() {
std::string a, b;
std::cin >> a;
b = a;
std::reverse(a.begin(), a.end());
int len = a.size();
for (int i = 0; i < len; ++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) std::cout << "Yes" << std::endl;
else std::cout << "No" << std::endl;
} | a.cc: In function 'int main()':
a.cc:8:14: error: 'reverse' is not a member of 'std'
8 | std::reverse(a.begin(), a.end());
| ^~~~~~~
|
s714502966 | p03889 | C++ | #include<iostream>
using namespace std;
int main()
{
cin>>s;
string s1=s;
int n=s.length();
for(int i=0;i<n/2;++i)
{
if(s1[i]=='b')s1[i]=='d';
if(s1[i]=='d')s1[i]=='b';
if(s1[i]=='q')s1[i]=='p';
if(s1[i]=='p')s1[i]=='q';
if(s1[n-i-1]=='b')s1[n-i-1]=='d';
if(s1[n-i-1]=='d')s1[n-i-1]=='b';
if(s1[n-i-1]=='q')s1[n-i-1]=='p';
if(s1[n-i-1]=='p')s1[n-i-1]=='q';
char t=s1[i];s1[i]=s1[n-i-1];s1[n-i-1]=t;
}
if(s1==s)cout<<"Yes";
else cout<<"No";
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:14: error: 's' was not declared in this scope
5 | cin>>s;
| ^
|
s815001253 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
string a,b;
int main()
{
cin>>a;
a=b;
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:17:17: error: expected primary-expression before '/' token
17 | cout<<"Yes";/
| ^
a.cc:18:5: error: expected primary-expression before 'else'
18 | else
| ^~~~
|
s851868071 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
char s[100010];
int main()
{
scanf("%s",s);
int l=strlen(s);
for(i=0;i<=l/2;i++)
{
if(s[i]=='b'&&s[l-i]!='d'||s[i]=='d'&&s[l-i]!='b'||s[i]=='p'&&s[l-i]!='q'||s[i]=='q'&&s[l-i]!='p')
{
cout<<"No";
return 0;
}
}
cout<<"Yes";
} | a.cc: In function 'int main()':
a.cc:8:13: error: 'i' was not declared in this scope
8 | for(i=0;i<=l/2;i++)
| ^
|
s692754173 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
char a[10001],b[10001];
int main()
{
gets_s(a);
int l=strlen(a);
for(int i=0;i<l;i++)
{
b[l-i-1]=a[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';
}
for(int i=0;i<l;i++)
if(a[i]!=b[i]) puts("No"),exit(0);
puts("Yes");
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'gets_s' was not declared in this scope; did you mean 'getsid'?
6 | gets_s(a);
| ^~~~~~
| getsid
|
s880324222 | p03889 | C++ | #include<bits/stdc++.h>
char s[200000];
int get[128];
int main()
{
get['b'] = 0;
get['p'] = 1;
get['d'] = 2;
get['q'] = 3;
scanf("%s",s+1);
for(int i=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:11:27: error: redeclaration of 'int i'
11 | for(int i=strlen(s+1),i=1;i<=(l>>1)+1;++i)
| ^
a.cc:11:13: note: 'int i' previously declared here
11 | for(int i=strlen(s+1),i=1;i<=(l>>1)+1;++i)
| ^
a.cc:11:35: error: 'l' was not declared in this scope
11 | for(int i=strlen(s+1),i=1;i<=(l>>1)+1;++i)
| ^
|
s915002634 | p03889 | C++ | #include<cstdio>
#include<iostream>
#include<cstring>
#include<stack>
using namespace std;
stack<char>s;
string a;
int main()
{
cin>>a;
int n=a.size();
for(int i=0;i<n;i++)
{
s.push(a[i]);
}
bool j=1;
for(int i=0;i<n;i++)
{
char t=s.t();
if(t=='b')
{
t='d';
}
else
{
if(t=='d')
{
t='b';
}
else
{
if(t=='p')
{
t='q';
}
else
{
if(t=='q')
{
t='p';
}
}
}
}
if(t==a[i])
{
j=1;
s.pop();
}
else
{
j=0;
break;
}
}
if(j==0)
{
cout<<"NO"<<endl;
}
else cout<<"YES"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:19:18: error: 'class std::stack<char>' has no member named 't'
19 | char t=s.t();
| ^
|
s674843335 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
char a[100005],b[100005];
cin>>a;
int a1=strlen(a),ans=0;
for(int i=0;i<a1;i++){
if(a[i]=='b') b[i]='d';
if(a[i]=='d') b[i]='b';
if(a[i]=='q') b[i]='p';
if(a[i]=='p') b[i]='q';
}
for(int i=0;i<a1;i++){
if(a[i]!=b[a1ppqb-i-1]){
cout<<"No";
return 0;
}
}
cout<<"Yes";
return 0;
} | a.cc: In function 'int main()':
a.cc:14:20: error: 'a1ppqb' was not declared in this scope
14 | if(a[i]!=b[a1ppqb-i-1]){
| ^~~~~~
|
s039557144 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
char a[100005],b[100005];
cin>>a;
int a1=strlen(a),ans=0;
for(int i=0;i<a1;i++){
if(a[i]=='b') b[i]='d';
if(a[i]=='d') b[i]='b';
if(a[i]=='q') b[i]='p';
if(a[i]=='p') b[i]='q';
}
for(int i=0;i<a1;i++){
if(a[i]!=b[a1ppqb-i-1]){
cout<<"No";
return 0;
}
}
cout<<"Yes";
return 0;
} | a.cc: In function 'int main()':
a.cc:14:28: error: 'a1ppqb' was not declared in this scope
14 | if(a[i]!=b[a1ppqb-i-1]){
| ^~~~~~
|
s807900447 | p03889 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
string a,b;
cin>>a;
int l=a.size()-1,t=l;
for(int i=0;i<l;i++){
b[i]=a[t--];
}
t=0;
for(int i=0;i<=l;i++){
if(b[i]=="d")b[t++]="b";
if(b[i]=="b")b[t++]="d";
if(b[i]=="p")b[t++]="q";
if(b[i]=="q")b[t++]="p";
}
if(a==b)cout<<"Yes";
else
cout<<"No";
return 0;
} | a.cc: In function 'int main()':
a.cc:14:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
14 | if(b[i]=="d")b[t++]="b";
a.cc:14:29: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
14 | if(b[i]=="d")b[t++]="b";
| ^~~
| |
| const char*
a.cc:15:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
15 | if(b[i]=="b")b[t++]="d";
a.cc:15:29: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
15 | if(b[i]=="b")b[t++]="d";
| ^~~
| |
| const char*
a.cc:16:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
16 | if(b[i]=="p")b[t++]="q";
a.cc:16:29: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
16 | if(b[i]=="p")b[t++]="q";
| ^~~
| |
| const char*
a.cc:17:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | if(b[i]=="q")b[t++]="p";
a.cc:17:29: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
17 | if(b[i]=="q")b[t++]="p";
| ^~~
| |
| const char*
|
s346828660 | p03889 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
string a,b;
cin>>a;
int l=a.size()-1;
for(int i=l;i>=0;i--){
if(a[i]=="d")b[l-i]="b";
if(a[i]=="b")b[l-i]="d";
if(a[i]=="p")b[l-i]="q";
if(a[i]=="q")b[l-i]="p";
}
if(a==b)cout<<"Yes";
else
cout<<"No";
return 0;
} | a.cc: In function 'int main()':
a.cc:10:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if(a[i]=="d")b[l-i]="b";
a.cc:10:29: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
10 | if(a[i]=="d")b[l-i]="b";
| ^~~
| |
| const char*
a.cc:11:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if(a[i]=="b")b[l-i]="d";
a.cc:11:29: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
11 | if(a[i]=="b")b[l-i]="d";
| ^~~
| |
| const char*
a.cc:12:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(a[i]=="p")b[l-i]="q";
a.cc:12:29: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
12 | if(a[i]=="p")b[l-i]="q";
| ^~~
| |
| const char*
a.cc:13:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | if(a[i]=="q")b[l-i]="p";
a.cc:13:29: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
13 | if(a[i]=="q")b[l-i]="p";
| ^~~
| |
| const char*
|
s374156728 | p03889 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
string a,b;
cin>>a;
int l=a.size()-1;
for(int i=l;i>=0;i--){
if(a[i]==d)b[l-i]=b;
if(a[i]==b)b[l-i]=d;
if(a[i]==p)b[l-i]=q;
if(a[i]==q)b[l-i]=p;
}
if(a==b)cout<<"Yes";
else
cout<<"No";
return 0;
} | a.cc: In function 'int main()':
a.cc:10:18: error: 'd' was not declared in this scope
10 | if(a[i]==d)b[l-i]=b;
| ^
a.cc:10:27: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
10 | if(a[i]==d)b[l-i]=b;
| ^
| |
| std::string {aka std::__cxx11::basic_string<char>}
a.cc:11:16: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
11 | if(a[i]==b)b[l-i]=d;
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/postypes.h: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:11:18: note: mismatched types 'const std::fpos<_StateT>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[l-i]=d;
| ^
In file included from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/allocator.h: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:11:18: note: mismatched types 'const std::allocator<_CharT>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[l-i]=d;
| ^
In file included from /usr/include/c++/14/string:48:
/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:11:18: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[l-i]=d;
| ^
/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:11:18: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[l-i]=d;
| ^
/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:11:18: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[l-i]=d;
| ^
/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:11:18: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[l-i]=d;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h: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:11:18: note: mismatched types 'const std::pair<_T1, _T2>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[l-i]=d;
| ^
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:11:18: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char'
11 | if(a[i]==b)b[l-i]=d;
| ^
/usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
637 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char'
11 | if(a[i]==b)b[l-i]=d;
| ^
/usr/include/c++/14/string_view:644: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>)'
644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | if(a[i]==b)b[l-i]=d;
| ^
/usr/include/c++/14/bits/basic_string.h:3755: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>&)'
3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[l-i]=d;
| ^
/usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[l-i]=d;
| ^
/usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3819 | operator==(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: mismatched types 'const _CharT*' and 'char'
11 | if(a[i]==b)b[l-i]=d;
| ^
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:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2558 | operator==(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: mismatched types 'const std::tuple<_UTypes ...>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[l-i]=d;
| ^
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46:
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: cand |
s903791847 | p03889 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
string a,b;
cin>>a;
int l=a.size()-1;
for(int i=l;i>=0;i--){
if(a[i]==d)b[L-i]=b;
if(a[i]==b)b[L-i]=d;
if(a[i]==p)b[L-i]=q;
if(a[i]==q)b[L-i]=p;
}
if(a==b)cout<<"Yes";
else
cout<<"No";
return 0;
} | a.cc: In function 'int main()':
a.cc:10:18: error: 'd' was not declared in this scope
10 | if(a[i]==d)b[L-i]=b;
| ^
a.cc:10:22: error: 'L' was not declared in this scope
10 | if(a[i]==d)b[L-i]=b;
| ^
a.cc:11:16: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
11 | if(a[i]==b)b[L-i]=d;
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/postypes.h: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:11:18: note: mismatched types 'const std::fpos<_StateT>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[L-i]=d;
| ^
In file included from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/allocator.h: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:11:18: note: mismatched types 'const std::allocator<_CharT>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[L-i]=d;
| ^
In file included from /usr/include/c++/14/string:48:
/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:11:18: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[L-i]=d;
| ^
/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:11:18: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[L-i]=d;
| ^
/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:11:18: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[L-i]=d;
| ^
/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:11:18: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[L-i]=d;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h: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:11:18: note: mismatched types 'const std::pair<_T1, _T2>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[L-i]=d;
| ^
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:11:18: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char'
11 | if(a[i]==b)b[L-i]=d;
| ^
/usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
637 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char'
11 | if(a[i]==b)b[L-i]=d;
| ^
/usr/include/c++/14/string_view:644: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>)'
644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | if(a[i]==b)b[L-i]=d;
| ^
/usr/include/c++/14/bits/basic_string.h:3755: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>&)'
3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[L-i]=d;
| ^
/usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[L-i]=d;
| ^
/usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3819 | operator==(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: mismatched types 'const _CharT*' and 'char'
11 | if(a[i]==b)b[L-i]=d;
| ^
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:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2558 | operator==(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed:
a.cc:11:18: note: mismatched types 'const std::tuple<_UTypes ...>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
11 | if(a[i]==b)b[L-i]=d;
| ^
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46:
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
| ^~~~~~~~
/usr/inc |
s929546942 | p03889 | C++ | #include<stdio.h>
#include<cstring>
char s[100005];
char f['z'];
int len;
int main(){
f['b']='d';
f['d']='b';
f['p']='q';
f['q']='p';
gets(s+1);
len=strlen(s+1);
int p=len>>1;
for (int i=1;i<=p;i++){
if (f[s[i]]!=s[len-i+1]){
puts("No");
return 0;
}
}
puts("Yes");
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(s+1);
| ^~~~
| getw
|
s630590464 | p03889 | C++ | #include<stdio.h>
#include<cstring>
char s[100005];
char f[500];
int len;
int main(){
f['b']='d';
f['d']='b';
f['p']='q';
f['q']='p';
gets(s+1);
len=strlen(s+1);
int p=len>>1;
for (int i=1;i<=p;i++){
if (f[s[i]]!=s[len-i+1]){
puts("No");
return 0;
}
}
puts("Yes");
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(s+1);
| ^~~~
| getw
|
s366202665 | p03889 | C++ | #include<stdio.h>
#include<string.h>
char s[100005];
char f[500];
int len;
int main(){
f['b']='d';
f['d']='b';
f['p']='q';
f['q']='p';
gets(s+1);
len=strlen(s+1);
int p=len>>1;
for (int i=1;i<=p;i++){
if (f[s[i]]!=s[len-i+1]){
puts("No");
return 0;
}
}
puts("Yes");
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(s+1);
| ^~~~
| getw
|
s458255695 | p03889 | C++ | #include<stdio.h>
#include<string.h>
char s[100005];
int f[500];
int len;
int main(){
f['b']='d';
f['d']='b';
f['p']='q';
f['q']='p';
gets(s+1);
len=strlen(s+1);
int p=len>>1;
for (int i=1;i<=p;i++){
if (f[s[i]]!=s[len-i+1]){
puts("No");
return 0;
}
}
puts("Yes");
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(s+1);
| ^~~~
| getw
|
s197502911 | p03889 | C++ | include<cstdio>
#include<iostream>
#include<cstring>
#include<stack>
using namespace std;
stack<char>s;
string a;
int main(){
cin>>a;
int n=a.size();
for(int i=0;i<n;i++){
s.push(a[i]);
}
bool ju=1;
for(int i=0;i<n;i++){
char top=s.top();
if(top=='b') top='d';
else if(top=='d') top='b';
else if(top=='p') top='q';
else if(top=='q') top='p';
if(top==a[i]) {
ju=1;
s.pop();
}
else {
ju=0;
break;
}
}
if(ju==0) printf("No");
else printf("Yes");
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<cstdio>
| ^~~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared
173 | void operator delete[](void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function
179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
179 | _GLIBCXX_NO |
s164219766 | p03889 | C++ | #include<bits/stdc++.h>
using namespace std;
string a,b;
int main()
{
cin>>a;
for(int s=a.size()-1;s>=0;s--)
b=b+a[s];
for(int s=0;s<b.size();s++)
{
switch(b)
{
case 'p':b[s]='q';break;
case 'q':b[s]='p';break;
case 'b':b[s]='d';break;
case 'd':b[s]='b';break;
}
}
if(b==a)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
| a.cc: In function 'int main()':
a.cc:11:24: error: switch quantity not an integer
11 | switch(b)
| ^
|
s302330124 | p03889 | C++ |
应用
冯浩云
R10864563 评测详情
冯浩云
AT2201 鏡文 / Mirror String
Judging
代码 C++,0.61KB
提交时间 2018-09-17 21:33:56
耗时/内存
-ms, -KB
评测状态
系统将会持续为您从源 OJ 获取评测结果,将持续追踪最长 30 分钟。
如超过此时间仍未获得结果,您可手动刷新。
Judging
用时: -ms / 内存: -KB
测试点信息
#1
源代码 复制
#include<cstdio>
#include<iostream>
#include<cstring>
#include<stack>
using namespace std;
stack<char>s;
string a;
int main(){
cin>>a;
int n=a.size();
for(int i=0;i<n;i++){
s.push(a[i]);
}
bool ju=1;
for(int i=0;i<n;i++){
char top=s.top();
if(top=='b') top='d';
else if(top=='d') top='b';
else if(top=='p') top='q';
else if(top=='q') top='p';
if(top==a[i]) {
ju=1;
s.pop();
}
else {
ju=0;
break;
}
}
if(ju==0) printf("No");
else printf("Yes");
return 0;
}
在洛谷,
享受Coding的欢乐
关于洛谷 | 帮助中心 | 洛谷社区规则 | 用户协议 | 小黑屋 | 联系我们
2013-2018 , 洛谷 © Developed by the Luogu Dev Team
All rights reserved 陕ICP备17005722号-1. 站长统计
Master: TrySail / DB: Index / CGI: 愛城華恋
| a.cc:12:19: error: invalid digit "9" in octal constant
12 | 提交时间 2018-09-17 21:33:56
| ^~
a.cc:18:57: error: extended character 。 is not valid in an identifier
18 | 系统将会持续为您从源 OJ 获取评测结果,将持续追踪最长 30 分钟。
| ^
a.cc:20:1: error: extended character 。 is not valid in an identifier
20 | 如超过此时间仍未获得结果,您可手动刷新。
| ^
a.cc:40:20: error: extended character © is not valid in an identifier
40 | }
| ^
a.cc:3:5: error: '\U00005e94\U00007528' does not name a type
3 | 应用
| ^~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:4:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/stdio.h:34,
from /usr/include/c++/14/cstdio:42,
from a.cc:3:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, |
s619785268 | p03889 | C++ | #include<iostream>
#include<fstream>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
char a[2000000],b[2000000],a1=0;
int main()
{
while(cin>>a[i]&&a[i]!=EOF) a1++;
int len=a1;
for(int i=0;i<len;i++)
{
if(a[i]=='b')b[i]='d';
if(a[i]=='d')b[i]='b';
if(a[i]=='p')b[i]='q';
if(a[i]=='q')b[i]='p';
}
bool flag=true;
for(int i=0;i<len;i++)
{
if(a[i]!=b[len-i-1]){flag=false;break;}
}
if(flag==1) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:22: error: 'i' was not declared in this scope
10 | while(cin>>a[i]&&a[i]!=EOF) a1++;
| ^
|
s053881069 | p03889 | C++ | #include<iostream>
#include<fstream>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
string a,b;
int main()
{
cin>>a;
int len=a.size();
for(int i=0;i<len;i++)
{
if(a[i]=='b')b[i]='d';
if(a[i]=='d')b[i]='b';
if(a[i]=='p')b[i]='q';
if(a[i]=='q')b[i]='p';
}
bool flag=true;
for(int i=0,j=b.size-1;i<len,j>=0;i++,j--)
{
if(a[i]!=b[j]){flag=false;break;}
}
if(flag==1) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:20:26: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
20 | for(int i=0,j=b.size-1;i<len,j>=0;i++,j--)
| ~~^~~~
| ()
|
s994327718 | p03889 | 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(){
string s, t;
cin>>s;
t = s;
reverse(all(t));
rep(i, t.size()){
if(t[i]=='b') t[i] = 'd';
if(t[i]=='d') t[i] = 'b';
if(t[i]=='p') t[i] = 'q';
if(t[i]=='q') t[i] = 'p';
}
cout<<(s==t:"Yes":"No")<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:66:20: error: expected ')' before ':' token
66 | cout<<(s==t:"Yes":"No")<<endl;
| ~ ^
| )
|
s989420273 | p03889 | C++ | #include <bits/stdc++.h>
using namespace std;
int array = {{'b', 'd'}, {'d', 'b'}, {'p', 'q'}, {'q', 'p'},
int main() {
string S;
cin >> S;
int L = S.length();
bool result = true;
for(int i = 0; i < L; i++) {
switch(S[i]) {
case 'd':
if(S[L - i - 1] != 'b') result = false;
break;
case 'b':
if(S[L - i - 1] != 'd') result = false;
break;
case 'p':
if(S[L - i - 1] != 'q') result = false;
break;
case 'q':
if(S[L - i - 1] != 'p') result = false;
break;
}
}
cout << (result ? "Yes" : "No") << endl;
return 0;
} | a.cc:4:1: error: expected primary-expression before 'int'
4 | int main() {
| ^~~
a.cc:4:1: error: expected '}' before 'int'
a.cc:3:13: note: to match this '{'
3 | int array = {{'b', 'd'}, {'d', 'b'}, {'p', 'q'}, {'q', 'p'},
| ^
a.cc:3:5: error: scalar object 'array' requires one element in initializer
3 | int array = {{'b', 'd'}, {'d', 'b'}, {'p', 'q'}, {'q', 'p'},
| ^~~~~
a.cc:4:1: error: expected ',' or ';' before 'int'
4 | int main() {
| ^~~
|
s097845608 | p03889 | C++ | #include<iostream>
#include<iomanip>
#include<string>
#define rep(i,n) for(int i = 0; i < n; ++i)
#define all(x) x.begin(),x.end()
using namespace std;
int main(void){
string s;
cin >> s;
string t(s);
reverse(all(t));
for(int i = 0; i < t.size(); ++i){
switch(t[i]){
case 'p':
t[i] = 'q';
break;
case 'q':
t[i] = 'p';
break;
case 'd':
t[i] = 'b';
break;
case 'b':
t[i] = 'd';
break;
}
}
if( s == t){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:3: error: 'reverse' was not declared in this scope
14 | reverse(all(t));
| ^~~~~~~
|
s281072186 | p03889 | C++ | #include"bits/stdc++.h"
using namespace std;
int main(){
string s;
cin>>s;
string t=s;
reverse(s.begin(),s.end());
for(auto &i:s){
if(i=='b')
i=d;
else if(i=='d')
i=b;
else if(i=='p')
i=q;
else if(i=='q')
i=p;
}
if(s==t)
cout<<"Yes";
else
cout<<"No";
}
| a.cc: In function 'int main()':
a.cc:10:27: error: 'd' was not declared in this scope
10 | i=d;
| ^
a.cc:12:27: error: 'b' was not declared in this scope
12 | i=b;
| ^
a.cc:14:27: error: 'q' was not declared in this scope
14 | i=q;
| ^
a.cc:16:27: error: 'p' was not declared in this scope
16 | i=p;
| ^
|
s756494665 | p03889 | C++ | #include <iostream>
using namespace std;
int main(){
string S1,S2;
cin>>S1;
S2=S1;
reverse(S1.begin(),S2.end());
bool ans=true;
for(int i=0;i<S1.size();i++){
if((S1[i]=='b'&&S2[i]!='d')&&(S1[i]=='d'&&S2[i]!='b')&&(S1[i]=='p'&&S2[i]!='q')&&(S1[i]=='q'&&S2[i]!='p')){
ans=false;
break;
}
}
cout<<(ans?"Yes":"No")<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'reverse' was not declared in this scope
8 | reverse(S1.begin(),S2.end());
| ^~~~~~~
|
s523995289 | p03889 | C++ | #include <iostream>
using namespace std;
int main(){
string S1,S2;
cin>>S1;
S2=S1;
reverse(S1.begin(),S2.end());
bool ans=true;
for(int i=0;i<S1.size();i++){
if((S1[i]=='b'&&S2[i]!='d')&&(S1[i]=='d'&&S2[i]!='b')&&(S1[i]=='p'&&S2[i]!='q')&&(S1[i]=='q'&&S2[i]!='p'){
ans=false;
break;
}
}
cout<<(ans?"Yes":"No")<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'reverse' was not declared in this scope
8 | reverse(S1.begin(),S2.end());
| ^~~~~~~
a.cc:11:114: error: expected ')' before '{' token
11 | if((S1[i]=='b'&&S2[i]!='d')&&(S1[i]=='d'&&S2[i]!='b')&&(S1[i]=='p'&&S2[i]!='q')&&(S1[i]=='q'&&S2[i]!='p'){
| ~ ^
| )
a.cc:15:5: error: expected primary-expression before '}' token
15 | }
| ^
|
s062507957 | p03889 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner don = new Scanner(System.in);
String[] an,bn;
String as;
an = new String[4];
bn = new String[4];
as = don.next();
for(int i=0;i<4;i++){
if(String.valueOf(as.charAt(i)).equals("d")){
an[i]="d";
bn[i]="b";
}else if(String.valueOf(as.charAt(i)).equals("b")){
an[i]="b";
bn[i]="d";
}else if(String.valueOf(as.charAt(i)).equals("p")){
an[i]="p";
bn[i]="q";
}else{
an[i]="q";
bn[i]="p";
}
}
if(as.equals(bn[3]+bn[2]+bn[1]+bn[0])){
System.out.println("yes");
}else{
System.out.println("no");
}
} | Main.java:30: error: reached end of file while parsing
}
^
1 error
|
s408190865 | p03889 | C++ | #include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
bool mirror(const char &a,const char &b);
int main()
{
char s[100000];
scanf("%s",&s);
int i ;
int l = strlen(s);
int mk = 0 ;
for(i = 0 ;i < l/2 ;i++)
{
bool k = mirror(s[i],s[l-i-1]);
if(!k||l%2!=0)
{
cout << "No\n";
mk = 1;
break;
}
}
else if(i == l/2)
{
cout << "Yes\n";
}
else
{
if(mk == 0)
{
cout << "No\n";
}
}
return 0;
}
bool mirror(const char &a,const char &b)
{
if((a == 'b' && b == 'd') ||(a == 'd' && b == 'b')
|| (a == 'p' && b == 'q') ||(a == 'q' && b == 'p'))
{
return true;
}
else
{
return false;
}
}
| a.cc: In function 'int main()':
a.cc:25:5: error: 'else' without a previous 'if'
25 | else if(i == l/2)
| ^~~~
|
s711576782 | p03890 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#include<queue>
using namespace std;
int n,ans=2,a[262144],b[262144],p1,p2;
int fang (int a,int b)
{
for(int i=1;i<a;i++)
{
b=2*b;
}
return b;
}
int main()
{
cin>>n;
ans=fang(n,ans);
p1=1;p2=1;
for(int i=1;i<=ans;i++)
{
if(i%2==1)
{
cin>>a[p1];
p1++;
}
else
{
cin>>b[p2];
p2++;
}
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=ans)
}
}
| a.cc: In function 'int main()':
a.cc:38:27: error: expected ';' before ')' token
38 | for(int j=1;j<=ans)
| ^
| ;
a.cc:39:5: error: expected primary-expression before '}' token
39 | }
| ^
|
s332122899 | p03890 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a;
b=1;
for(int i=0;i<a;i++)
b=b*2;
vector<int> c(b);
for(int i=0;i<b;i++)
cin>>c.at(i);
for(int i=0;i<b-1;i++)
if(c.at(i)>c.at(i+1)){
c.at(i)-=c.at(i+1);
c.erase(c.begin()+i+1);
}
else if(c.at(i)==c.at(i+1))
c.erase(c.begin()+i+1);
else{
c.at(i+1)-=c.at(i);
c.erase(c.begin()+i);
}
if(c.size()==1)
break;
if(i==c.size()-1)
i=0;
}
cout<<c.at(0)<<endl;
} | a.cc: In function 'int main()':
a.cc:25:5: error: break statement not within loop or switch
25 | break;
| ^~~~~
a.cc:26:6: error: 'i' was not declared in this scope
26 | if(i==c.size()-1)
| ^
a.cc: At global scope:
a.cc:29:1: error: 'cout' does not name a type
29 | cout<<c.at(0)<<endl;
| ^~~~
a.cc:30:1: error: expected declaration before '}' token
30 | }
| ^
|
s249166944 | p03890 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a;
b=1;
for(int i=0;i<a;i++)
b=b*2;
vector<int> c(b);
for(int i=0;i<b;i++)
cin>>c.at(i);
for(int i=0;i<b-1;i++)
if(c.at(i)>c.at(i+1)){
c.at(i)-=c.at(i+1);
c.erase(c.begin()+i+1);
}
else if(c.at(i)==c.at(i+1))
c.erase(c.begin()+i+1);
else{
c.at(i+1)-=c.at(i);
c.erase(c.begin()+i);
}
if(c.size==1)
break;
if(i==c.size()-1)
i=0;
}
cout<<c.at(0)<<endl;
} | a.cc: In function 'int main()':
a.cc:24:8: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
24 | if(c.size==1)
| ~~^~~~
| ()
a.cc:25:5: error: break statement not within loop or switch
25 | break;
| ^~~~~
a.cc:26:6: error: 'i' was not declared in this scope
26 | if(i==c.size()-1)
| ^
a.cc: At global scope:
a.cc:29:1: error: 'cout' does not name a type
29 | cout<<c.at(0)<<endl;
| ^~~~
a.cc:30:1: error: expected declaration before '}' token
30 | }
| ^
|
s575875169 | p03890 | Java | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
class Main{
static void solve(){
int n = ni();
Deque<Integer> que = new ArrayDeque<>();
for(int i=0;i<(1<<n);++i)que.add(ni());
while(!que.size()==1){
int x = que.pollFirst(), y=que.pollFirst();
if(x==y)que.addLast(x);
else que.addLast(Math.max(x,y) - Math.min(x,y));
}
out.println(que.poll());
}
public static void main(String[] args){
solve();
out.flush();
}
private static InputStream in = System.in;
private static PrintWriter out = new PrintWriter(System.out);
static boolean inrange(int y, int x, int h, int w){
return y>=0 && y<h && x>=0 && x<w;
}
@SuppressWarnings("unchecked")
static<T extends Comparable> int lower_bound(List<T> list, T key){
int lower=-1;int upper=list.size();
while(upper - lower>1){
int center =(upper+lower)/2;
if(list.get(center).compareTo(key)>=0)upper=center;
else lower=center;
}
return upper;
}
@SuppressWarnings("unchecked")
static <T extends Comparable> int upper_bound(List<T> list, T key){
int lower=-1;int upper=list.size();
while(upper-lower >1){
int center=(upper+lower)/2;
if(list.get(center).compareTo(key)>0)upper=center;
else lower=center;
}
return upper;
}
@SuppressWarnings("unchecked")
static <T extends Comparable> boolean next_permutation(List<T> list){
int lastIndex = list.size()-2;
while(lastIndex>=0 && list.get(lastIndex).compareTo(list.get(lastIndex+1))>=0)--lastIndex;
if(lastIndex<0)return false;
int swapIndex = list.size()-1;
while(list.get(lastIndex).compareTo(list.get(swapIndex))>=0)swapIndex--;
T tmp = list.get(lastIndex);
list.set(lastIndex++, list.get(swapIndex));
list.set(swapIndex, tmp);
swapIndex = list.size()-1;
while(lastIndex<swapIndex){
tmp = list.get(lastIndex);
list.set(lastIndex, list.get(swapIndex));
list.set(swapIndex, tmp);
++lastIndex;--swapIndex;
}
return true;
}
private static final byte[] buffer = new byte[1<<15];
private static int ptr = 0;
private static int buflen = 0;
private static boolean hasNextByte(){
if(ptr<buflen)return true;
ptr = 0;
try{
buflen = in.read(buffer);
} catch (IOException e){
e.printStackTrace();
}
return buflen>0;
}
private static int readByte(){ if(hasNextByte()) return buffer[ptr++]; else return -1;}
private static boolean isSpaceChar(int c){ return !(33<=c && c<=126);}
private static int skip(){int res; while((res=readByte())!=-1 && isSpaceChar(res)); return res;}
private static double nd(){ return Double.parseDouble(ns()); }
private static char nc(){ return (char)skip(); }
private static String ns(){
StringBuilder sb = new StringBuilder();
for(int b=skip();!isSpaceChar(b);b=readByte())sb.append((char)b);
return sb.toString();
}
private static int[] nia(int n){
int[] res = new int[n];
for(int i=0;i<n;++i)res[i]=ni();
return res;
}
private static long[] nla(int n){
long[] res = new long[n];
for(int i=0;i<n;++i)res[i]=nl();
return res;
}
private static int ni(){
int res=0,b;
boolean minus=false;
while((b=readByte())!=-1 && !((b>='0'&&b<='9') || b=='-'));
if(b=='-'){
minus=true;
b=readByte();
}
for(;'0'<=b&&b<='9';b=readByte())res=res*10+(b-'0');
return minus ? -res:res;
}
private static long nl(){
long res=0,b;
boolean minus=false;
while((b=readByte())!=-1 && !((b>='0'&&b<='9') || b=='-'));
if(b=='-'){
minus=true;
b=readByte();
}
for(;'0'<=b&&b<='9';b=readByte())res=res*10+(b-'0');
return minus ? -res:res;
}
}
| Main.java:13: error: bad operand type int for unary operator '!'
while(!que.size()==1){
^
1 error
|
s294916101 | p03890 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int N;
vector<int> stones;
int kode_festival(int depth, int position){
if(depth == N){
return stones[position];
}else{
int left = kode_festival(depth + 1, position * 2);
int right = kode_festival(depth + 1, position * 2 + 1);
if(left == right){
return left;
}else{
return max(left, right) - min(left, right);
}
}
}
| /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
|
s300482733 | p03890 | C++ | #include<cstdio>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
#include<list>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<functional>
#include<queue>
using namespace std;
int segment[1 << 19];
int a;
int saiki(int b) {
if (segment[b] != -1)return segment[b];
int x = saiki(b * 2 + 1), y = saiki(b * 2 + 2);
if (abs(x - y))return abs(x - y);
return x;
}
signed main() {
memset(segment, -1, sizeof(segment));
cin >> a;
for (int b = 0; b < (1 << a); b++) {
scanf("%d", &segment[(1 << a) - 1 + b]);
}
cout << saiki(0) << endl;
} | a.cc: In function 'int main()':
a.cc:24:9: error: 'memset' was not declared in this scope
24 | memset(segment, -1, sizeof(segment));
| ^~~~~~
a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
12 | #include<queue>
+++ |+#include <cstring>
13 | using namespace std;
|
s931256182 | p03890 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner as = new Scanner(System.in);
int n = as.nexInt();
int l = n;
int[] a;
int b = 0;
int c = (int)Math.pow(2, n);
a = new int[c];
for(int i=0;i<c;i++){
a[i] = as.nextInt();
}
for(int s=0;s<n;s++){
for(int i=0;i<(int)(Math.pow(2,l));i+=2){
if(a[i]<a[i+1]){
a[i+1]-=a[i];
a[b]=a[i+1];
b+=1;
}else if(a[i]>a[i+1]){
a[i]-=a[i+1];
a[b]=a[i];
b+=1;
}else{
a[b]=a[i];
b+=1;
}
}
l-=1;
b = 0;
}
System.out.println(a[0]);
}
}
| Main.java:5: error: cannot find symbol
int n = as.nexInt();
^
symbol: method nexInt()
location: variable as of type Scanner
1 error
|
s931312809 | p03891 | C++ | #include <bits.stdc++.h>
using namespace std;
int main(){
int A,B,C;
cin>>A>>B>>C;
int G=A+B-C;
int F=A+G-C;
int I=B+C-G;
int go=A+C+I;
int D=go-A-B;
int E=go-C-F;
int H=go-G-I;
cout<<A<<" "<<B<<" "<<D<<endl;
cout<<E<<" "<<C<<" "<<F<<endl;
cout<<G<<" "<<H<<" "<<I<<endl;
}
| a.cc:1:10: fatal error: bits.stdc++.h: No such file or directory
1 | #include <bits.stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s810101863 | p03891 | C++ | #include<bits.stdc++.h>
using namespace std;
int main(){
int A,B,C;
cin>>A>>B>>C;
int G=A+B-C;
int F=A+G-C;
int I=B+C-G;
int go=A+C+I;
int D=go-A-B;
int E=go-C-F;
int H=go-G-I;
cout<<A<<" "<<B<<" "<<D<<endl;
cout<<E<<" "<<C<<" "<<F<<endl;
cout<<G<<" "<<H<<" "<<I<<endl;
} | a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory
1 | #include<bits.stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s100798062 | p03891 | C++ | {$asmmode intel}//开启汇编模式。
var a,b,c:longint;
_11,_12,_13,_21,_22,_23,_31,_32,_33:longint;
begin
readln(a,b,c);
asm
mov eax,a; //eax=a
mov _11,eax;//结果存放
mov eax,b; //eax=b
mov _12,eax;//结果存放
mov eax,c; //eax=c
mov ebx,c; //eax=c,ebx=c
add eax,ebx;//eax=2c,ebx=c
add eax,ebx;//eax=3c,ebx=c
mov ebx,a; //eax=3c,ebx=a
sub eax,ebx;//eax=3c-a,ebx=a
mov ebx,b; //eax=3c-a,ebx=b
sub eax,ebx;//eax=3c-a-b,ebx=b
mov _13,eax;//结果存放
mov eax,c; //eax=c,ebx=b
add eax,eax;//eax=2c,ebx=b
add eax,eax;//eax=4c,ebx=b
sub eax,ebx;//eax=4c-b,ebx=b
mov ebx,a; //eax=4c-b,ebx=a
add ebx,ebx;//eax=4c-b,ebx=2a
sub eax,ebx;//eax=4c-b-2a,ebx=2a
mov _21,eax;//结果存放
mov eax,c; //eax=c,ebx=2a
mov _22,eax;//结果存放
mov eax,a; //eax=a,ebx=2a
mov ebx,c; //eax=a,ebx=c
sub eax,ebx;//eax=a-c,ebx=c
add eax,eax;//eax=2a-2c,ebx=c
mov ebx,b; //eax=2a-2c,ebx=b
add eax,ebx;//eax=2a-2c+b,ebx=b
mov _23,eax;//结果存放
mov eax,a; //eax=a,ebx=b
add eax,ebx;//eax=a+b,ebx=b
mov ebx,c; //eax=a+b,ebx=c
sub eax,ebx;//eax=a+b-c,ebx=c
mov _31,eax;//结果存放
add ebx,ebx;//eax=a+b-c,ebx=2c
mov eax,b; //eax=b,ebx=2c
sub ebx,eax;//eax=b,ebx=2c-b
mov _32,ebx;//结果存放
add ebx,eax;//eax=b,ebx=2c
mov eax,a; //eax=a,ebx=2c
sub ebx,eax;//eax=a,ebx=2c-a
mov _33,ebx;//结果存放
end;
writeln(_11,' ',_12,' ',_13);
writeln(_21,' ',_22,' ',_23);
writeln(_31,' ',_32,' ',_33);
end. | a.cc:1:1: error: expected unqualified-id before '{' token
1 | {$asmmode intel}//开启汇编模式。
| ^
a.cc:2:1: error: 'var' does not name a type
2 | var a,b,c:longint;
| ^~~
a.cc:3:5: error: '_11' does not name a type
3 | _11,_12,_13,_21,_22,_23,_31,_32,_33:longint;
| ^~~
a.cc:4:1: error: 'begin' does not name a type
4 | begin
| ^~~~~
a.cc:7:5: error: expected '(' before 'mov'
7 | mov eax,a; //eax=a
| ^~~
| (
a.cc:7:5: error: 'mov' does not name a type
7 | mov eax,a; //eax=a
| ^~~
a.cc:8:5: error: 'mov' does not name a type
8 | mov _11,eax;//结果存放
| ^~~
a.cc:9:5: error: 'mov' does not name a type
9 | mov eax,b; //eax=b
| ^~~
a.cc:10:5: error: 'mov' does not name a type
10 | mov _12,eax;//结果存放
| ^~~
a.cc:11:5: error: 'mov' does not name a type
11 | mov eax,c; //eax=c
| ^~~
a.cc:12:5: error: 'mov' does not name a type
12 | mov ebx,c; //eax=c,ebx=c
| ^~~
a.cc:13:5: error: 'add' does not name a type
13 | add eax,ebx;//eax=2c,ebx=c
| ^~~
a.cc:14:5: error: 'add' does not name a type
14 | add eax,ebx;//eax=3c,ebx=c
| ^~~
a.cc:15:5: error: 'mov' does not name a type
15 | mov ebx,a; //eax=3c,ebx=a
| ^~~
a.cc:16:5: error: 'sub' does not name a type
16 | sub eax,ebx;//eax=3c-a,ebx=a
| ^~~
a.cc:17:5: error: 'mov' does not name a type
17 | mov ebx,b; //eax=3c-a,ebx=b
| ^~~
a.cc:18:5: error: 'sub' does not name a type
18 | sub eax,ebx;//eax=3c-a-b,ebx=b
| ^~~
a.cc:19:5: error: 'mov' does not name a type
19 | mov _13,eax;//结果存放
| ^~~
a.cc:20:5: error: 'mov' does not name a type
20 | mov eax,c; //eax=c,ebx=b
| ^~~
a.cc:21:5: error: 'add' does not name a type
21 | add eax,eax;//eax=2c,ebx=b
| ^~~
a.cc:22:5: error: 'add' does not name a type
22 | add eax,eax;//eax=4c,ebx=b
| ^~~
a.cc:23:5: error: 'sub' does not name a type
23 | sub eax,ebx;//eax=4c-b,ebx=b
| ^~~
a.cc:24:5: error: 'mov' does not name a type
24 | mov ebx,a; //eax=4c-b,ebx=a
| ^~~
a.cc:25:5: error: 'add' does not name a type
25 | add ebx,ebx;//eax=4c-b,ebx=2a
| ^~~
a.cc:26:5: error: 'sub' does not name a type
26 | sub eax,ebx;//eax=4c-b-2a,ebx=2a
| ^~~
a.cc:27:5: error: 'mov' does not name a type
27 | mov _21,eax;//结果存放
| ^~~
a.cc:28:5: error: 'mov' does not name a type
28 | mov eax,c; //eax=c,ebx=2a
| ^~~
a.cc:29:5: error: 'mov' does not name a type
29 | mov _22,eax;//结果存放
| ^~~
a.cc:30:5: error: 'mov' does not name a type
30 | mov eax,a; //eax=a,ebx=2a
| ^~~
a.cc:31:5: error: 'mov' does not name a type
31 | mov ebx,c; //eax=a,ebx=c
| ^~~
a.cc:32:5: error: 'sub' does not name a type
32 | sub eax,ebx;//eax=a-c,ebx=c
| ^~~
a.cc:33:5: error: 'add' does not name a type
33 | add eax,eax;//eax=2a-2c,ebx=c
| ^~~
a.cc:34:5: error: 'mov' does not name a type
34 | mov ebx,b; //eax=2a-2c,ebx=b
| ^~~
a.cc:35:5: error: 'add' does not name a type
35 | add eax,ebx;//eax=2a-2c+b,ebx=b
| ^~~
a.cc:36:5: error: 'mov' does not name a type
36 | mov _23,eax;//结果存放
| ^~~
a.cc:37:5: error: 'mov' does not name a type
37 | mov eax,a; //eax=a,ebx=b
| ^~~
a.cc:38:5: error: 'add' does not name a type
38 | add eax,ebx;//eax=a+b,ebx=b
| ^~~
a.cc:39:5: error: 'mov' does not name a type
39 | mov ebx,c; //eax=a+b,ebx=c
| ^~~
a.cc:40:5: error: 'sub' does not name a type
40 | sub eax,ebx;//eax=a+b-c,ebx=c
| ^~~
a.cc:41:5: error: 'mov' does not name a type
41 | mov _31,eax;//结果存放
| ^~~
a.cc:42:5: error: 'add' does not name a type
42 | add ebx,ebx;//eax=a+b-c,ebx=2c
| ^~~
a.cc:43:5: error: 'mov' does not name a type
43 | mov eax,b; //eax=b,ebx=2c
| ^~~
a.cc:44:5: error: 'sub' does not name a type
44 | sub ebx,eax;//eax=b,ebx=2c-b
| ^~~
a.cc:45:5: error: 'mov' does not name a type
45 | mov _32,ebx;//结果存放
| ^~~
a.cc:46:5: error: 'add' does not name a type
46 | add ebx,eax;//eax=b,ebx=2c
| ^~~
a.cc:47:5: error: 'mov' does not name a type
47 | mov eax,a; //eax=a,ebx=2c
| ^~~
a.cc:48:5: error: 'sub' does not name a type
48 | sub ebx,eax;//eax=a,ebx=2c-a
| ^~~
a.cc:49:5: error: 'mov' does not name a type
49 | mov _33,ebx;//结果存放
| ^~~
a.cc:50:3: error: 'end' does not name a type
50 | end;
| ^~~
a.cc:51:10: error: expected constructor, destructor, or type conversion before '(' token
51 | writeln(_11,' ',_12,' ',_13);
| ^
a.cc:52:10: error: expected constructor, destructor, or type conversion before '(' token
52 | writeln(_21,' ',_22,' ',_23);
| ^
a.cc:53:10: error: expected constructor, destructor, or type conversion before '(' token
53 | writeln(_31,' ',_32,' ',_33);
| ^
a.cc:54:1: error: 'end' does not name a type
54 | end.
| ^~~
|
s902621614 | p03891 | C++ | my $in=<STDIN>;
chomp $in;
$in=[split /[\s,]+/,$in];
$a=$in->[0];
$b=$in->[1];
$c=$in->[2];
$d=-$a-$b+3*$c;
$e=-2*$a-$b+4*$c;
$f=2*$a+$b-2*$c;
$g=$a+$b-$c;
$h=-$b+2*$c;
$i=-$a+2*$c;
print "$a $b $d\n$e $c $f\n$g $h $i";
Visul Basic Mono
Imports System
Module APlusB
Sub Main()
Dim ins As String() = Console.ReadLine().Split(New Char(){" "c})
Console.Write(Int(ins(0)))
Console.Write(" ")
Console.Write(Int(ins(1)))
Console.Write(" ")
Console.Write(-Int(ins(0))-Int(ins(1))+3*Int(int(2)))
Console.WriteLine("")
Console.Write(-2*Int(ins(0))-Int(ins(1))+4*Int(ins(2)))
Console.Write(" ")
Console.Write(Int(ins(2)))
Console.Write(" ")
Console.Write(2*Int(ins(0))+Int(ins(1))-2*Int(ins(2)))
Console.WriteLine("")
Console.Write(Int(ins(0))+Int(ins(1))-Int(ins(2)))
Console.Write(" ")
Console.Write(-Int(ins(1))+2*Int(ins(2)))
Console.Write(" ")
Console.Write(-Int(ins(0))+2*Int(ins(2)))
Console.WriteLine("")
End Sub
End Module | a.cc:3:14: error: stray '\' in program
3 | $in=[split /[\s,]+/,$in];
| ^
a.cc:1:1: error: 'my' does not name a type
1 | my $in=<STDIN>;
| ^~
a.cc:2:1: error: 'chomp' does not name a type
2 | chomp $in;
| ^~~~~
a.cc:3:1: error: '$in' does not name a type
3 | $in=[split /[\s,]+/,$in];
| ^~~
a.cc:4:1: error: '$a' does not name a type
4 | $a=$in->[0];
| ^~
a.cc:5:1: error: '$b' does not name a type
5 | $b=$in->[1];
| ^~
a.cc:6:1: error: '$c' does not name a type
6 | $c=$in->[2];
| ^~
a.cc:7:1: error: '$d' does not name a type
7 | $d=-$a-$b+3*$c;
| ^~
a.cc:8:1: error: '$e' does not name a type
8 | $e=-2*$a-$b+4*$c;
| ^~
a.cc:9:1: error: '$f' does not name a type
9 | $f=2*$a+$b-2*$c;
| ^~
a.cc:10:1: error: '$g' does not name a type
10 | $g=$a+$b-$c;
| ^~
a.cc:11:1: error: '$h' does not name a type
11 | $h=-$b+2*$c;
| ^~
a.cc:12:1: error: '$i' does not name a type
12 | $i=-$a+2*$c;
| ^~
a.cc:13:1: error: 'print' does not name a type; did you mean 'int'?
13 | print "$a $b $d\n$e $c $f\n$g $h $i";
| ^~~~~
| int
a.cc:14:1: error: 'Visul' does not name a type
14 | Visul Basic Mono
| ^~~~~
a.cc:19:72: error: expected unqualified-id before ')' token
19 | Dim ins As String() = Console.ReadLine().Split(New Char(){" "c})
| ^
|
s018262669 | p03891 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d,e,f,g;
scanf ("%d%d%d",&a,&b,&e);
c=3*e-a-b;
h=2*e-b;
f=2*a-h;
i=3*e-c-f;
d=2*e-f;
g=3*e-h-i;
printf ("%d %d %d\n",a,b,c);
printf ("%d %d %d\n",b,c,d);
printf ("%d %d %d",g,h,i);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'h' was not declared in this scope
7 | h=2*e-b;
| ^
a.cc:9:5: error: 'i' was not declared in this scope
9 | i=3*e-c-f;
| ^
|
s833574360 | p03891 | C++ | #include<bits/stdc++.h>
using namespace std ;
int main()
{
int a , b , c ;
cin >> a >> b >> c ;
cout << a <<" "<< b <<" "<< 3*c-a-b <<" "<< endl ;
cout << 4*c-2*a-b <<" "<< c <<" "<< 2*a+b-2*c <<" "<< endl ;
cout << a+b-c <<" "<< 2*c-b <<" "<< 2*c-a <<" "<< endl ;
return 0 ;
}} | a.cc:11:2: error: expected declaration before '}' token
11 | }}
| ^
|
s788548142 | p03891 | C++ | #include<iostream>
using namespace std ;
long long a,b,c
int main()
{
cin>>a>>b>>c;
cout<<a<<" "<<b<<" "<<3*c-a-b<<" "<<endl;
cout<<4*c-2*a-b<<" "<<c<<" "<<2*a+b-2*c<<" "<<endl ;
cout<<a+b-c<<" "<<2*c-b<<" "<<2*c-a<<" "<<endl ;
return 0 ;
} | a.cc:4:1: error: expected initializer before 'int'
4 | int main()
| ^~~
|
s687230185 | p03891 | C | #if 0
cat <<EOF >mistaken-paste
#endif
// thanks for @rsk0315_h4x
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define BIG 2000000007
#define VERYBIG 2000000000000007LL
#define MOD 1000000007
#define FOD 998244353
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 1048576
#ifdef __cplusplus
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <functional>
#include <array>
using std::queue;
using std::priority_queue;
using std::stack;
using std::tuple;
using std::set;
using std::map;
using std::vector;
using std::greater;
using std::pair;
using std::string;
using std::get;
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> l, pair<T, U> r) {
return pair<T, U>(l.first + r.first, l.second + r.second);
}
#endif
typedef struct {
int32_t a;
int32_t b;
} hw;
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
sll a;
sll b;
sll c;
} hwllc;
typedef struct {
hwll a;
hwll b;
} linell;
ull n, m;
ull h, w;
ull k;
ull q;
sll va, vb, vc, vd, ve, vf;
ull ua, ub, uc, ud, ue, uf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
char ch, dh;
ull umin (ull x, ull y) {
return (x < y) ? x : y;
}
ull umax (ull x, ull y) {
return (x > y) ? x : y;
}
sll smin (sll x, sll y) {
return (x < y) ? x : y;
}
sll smax (sll x, sll y) {
return (x > y) ? x : y;
}
ull gcd (ull x, ull y) {
if (x < y) {
return gcd(y, x);
} else if (y == 0) {
return x;
} else {
return gcd(y, x % y);
}
}
ull bitpow (ull a, ull x, ull modulo) {
ull result = 1;
while (x) {
if (x & 1) {
result *= a;
result %= modulo;
}
x /= 2;
a = (a * a) % modulo;
}
return result;
}
ull divide (ull a, ull b, ull modulo) {
return (a * bitpow(b, modulo - 2, modulo)) % modulo;
}
ull udiff (ull a, ull b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
sll sdiff (sll a, sll b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
int bitcount (ull n) {
int result = 0;
while (n) {
if (n & 1) result++;
n /= 2;
}
return result;
}
#define BEGCMP(NAME) int32_t NAME (const void *left, const void *right)
#define DEFLR(TYPE) TYPE l=*(TYPE*)left,r=*(TYPE*)right
#define CMPRET(L, R) if((L)<(R))return-1;if((L)>(R))return+1
// int32_t pullcomp (const void *left, const void *right) {
// ull l = *(ull*)left;
// ull r = *(ull*)right;
// if (l < r) {
// return -1;
// }
// if (l > r) {
// return +1;
// }
// return 0;
// }
BEGCMP(pullcomp){
DEFLR(ull);
CMPRET(l, r);
return 0;
}
BEGCMP(prevcomp){
DEFLR(ull);
CMPRET(r, l);
return 0;
}
BEGCMP(psllcomp){
DEFLR(sll);
CMPRET(l, r);
return 0;
}
BEGCMP(pcharcomp){
DEFLR(char);
CMPRET(l, r);
return 0;
}
BEGCMP(pdoublecomp){
DEFLR(double);
CMPRET(l, r);
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
BEGCMP(phwllABcomp){
DEFLR(hwll);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
BEGCMP(phwllREVcomp){
DEFLR(hwll);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
return 0;
}
BEGCMP(ptriplecomp){
DEFLR(hwllc);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
CMPRET(l.c, r.c);
return 0;
}
BEGCMP(ptripleREVcomp){
DEFLR(hwllc);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
CMPRET(l.c, r.c);
return 0;
}
int32_t pquadcomp (const void *left, const void *right) {
linell l = *(linell*)left;
linell r = *(linell*)right;
sll ac = phwllABcomp(&(l.a), &(r.a));
if (ac) return ac;
sll bc = phwllABcomp(&(l.b), &(r.b));
if (bc) return bc;
return 0;
}
bool isinrange (sll left, sll x, sll right) {
return (left <= x && x <= right);
}
bool isinrange_soft (sll left, sll x, sll right) {
return (left <= x && x <= right) || (left >= x && x >= right);
}
sll a[N_MAX + 5];
// ull a[N_MAX + 5];
// sll a[3001][3001];
sll b[N_MAX + 5];
// ull b[N_MAX + 5];
// sll b[3001][3001];
sll c[N_MAX + 5];
sll d[N_MAX + 5];
sll e[N_MAX];
char s[N_MAX + 1];
// char s[3010][3010];
char t[N_MAX + 1];
// char t[3010][3010];
char u[N_MAX + 1];
hwll xy[N_MAX + 5];
hwllc tup[N_MAX + 5];
// sll table[3005][3005];
ull gin[N_MAX];
// here we go
bool isok (ull x) {
ull y = 0;
while (x > 2) {
x = (x - 1) / 2;
y++;
}
return (y <= n);
}
ull solve () {
sll i, j, ki, li;
// ull result = 0;
sll result = 0;
double dresult = 0;
// ull maybe = 0;
sll maybe = 0;
// ull sum = 0;
sll sum = 0;
sll item;
ull *dpcell;
sll x[3][3];
x[0][0] = va;
x[0][1] = vb;
x[1][1] = vc;
sll sum = vc * 3;
x[0][2] = sum - va - vb;
x[2][0] = sum - vc - x[0][2];
x[1][0] = sum - x[0][0] - x[2][0];
x[1][2] = sum - x[1][0] - x[1][1];
x[2][1] = sum - x[0][1] - x[1][1];
x[2][2] = sum - x[0][0] - x[0][1];
for (i = 0; i < 3; i++) {
printf("%lld %lld %lld\n", x[i][0], x[i][1], x[i][2]);
}
// printf("%lld\n", result);
// printf("%.15lf\n", dresult);
// puts(s);
return 0;
success:
// puts("YES");
puts("Yes");
// printf("%llu\n", result);
// puts("0");
// puts("Hanako");
return 0;
fail:
// puts("NO");
// puts("No");
puts("0");
// puts("-1");
// puts("-1 -1 -1");
// puts("Jiro");
return 1;
}
int32_t main (int argc, char *argv[]) {
int32_t i, j;
n = 3;
m = 0;
// scanf("%llu%llu", &h, &w);
// scanf("%llu%llu", &n, &m);
// scanf("%llu", &k, &n, &m);
// scanf("%llu%llu", &h, &w);
// scanf("%s", s);
// scanf("%llu", &q);
scanf("%lld%lld%lld", &va, &vb, &vc, &vd);
// scanf("%llu%llu%llu", &ua, &ub, &uc, &ud, &ue);
// scanf("%s", t);
// scanf("%s", u);
// scanf("%llu", &k);
// scanf("%lld", &m);
// for (i = 0; i < n; i++) {
// scanf("%llu", &d[i]);
// }
// for (i = 0; i < n; i++) {
// // scanf("%lld%lld", &xy[i].a, &xy[i].b);
// // scanf("%lld%lld%lld", &tup[i].a, &tup[i].b, &tup[i].c);
// scanf("%lld", &a[i]);
// // scanf("%lld", &b[i]);
// // scanf("%lld", &c[i]);
// // scanf("%lld", &d[i]);
// // a[i]--;
// // b[i]--;
// // c[i]--;
// // d[i]--;
// // xy[i].a--;
// // xy[i].b--;
// // tup[i].a--;
// // tup[i].b--;
// }
// for (i = 0; i < m; i++) {
// // scanf("%lld%lld", &a[i], &b[i]);
// scanf("%lld", &b[i]);
// // a[i]--;
// // b[i]--;
// }
// for (i = 0; i < q; i++) {
// // scanf("%lld%lld", &xy[i].a, &xy[i].b);
// scanf("%lld", &c[i]);
// // xy[i].a--;
// // xy[i].b--;
// }
// for (i = 0; i < n; i++) {
// for (j = 0; j < m; j++) {
// scanf("%lld", &table[i][j]);
// // table[i][j]--;
// }
// }
// for (i = 0; i < h; i++) {
// scanf("%s", s[i]);
// }
// scanf("%llu", &q);
solve();
return 0;
}
| main.c: In function 'solve':
main.c:296:13: error: redefinition of 'sum'
296 | sll sum = vc * 3;
| ^~~
main.c:288:13: note: previous definition of 'sum' with type 'sll' {aka 'long int'}
288 | sll sum = 0;
| ^~~
|
s941385422 | p03891 | C++ | //G++/Gcc
#include<bits/stdc++.h>
using namespace std;
int f[5][5],i,j,x;
int main()
{
cin>>f[1][1]>>f[1][2]>>f[2][2];
x=f[2][2]*3;
f[1][3]=a-f[1][1]-f[1][2];
f[3][1]=a-f[1][3]-f[2][2];
f[3][3]=a-f[1][1]-f[2][2];
f[2][1]=a-f[1][1]-f[3][1];
f[2][3]=a-f[2][1]-f[2][2];
f[3][2]=a-f[1][2]-f[2][2];
for(i=1;i<=3;++i)
{
for(j=1;j<=3;++j) cout<<f[i][j];
cout<<endl;
}
return 0;
}
/*
QTR,U KICW TIY!!!
;EV,UPIT STR HPPF!!!
KJK,UPIT STR HPPF!!!
YKX,UPIT STR HPPF!!!
KUL,UPIT STR HPPF!!!
*/ | a.cc: In function 'int main()':
a.cc:9:15: error: 'a' was not declared in this scope
9 | f[1][3]=a-f[1][1]-f[1][2];
| ^
|
s890685028 | p03891 | C++ | #include<bits/stdc++.h>
using namespace std;
int f[4][4];
int main()
{
long long a;
cin>>f[1][1]>>f[1][2]>>f[2][2];
a=f[2][2]*3;
f[1][3]=a-f[1][1]-f[1][2];
f[3][1]=a-f[1][3]-f[2][2];
f[3][3]=a-f[1][1]-f[2][2];
f[2][1]=a-f[1][1]-f[3][1];
f[2][3]=a-f[2][1]-f[2][2];
f[3][2]=a-f[1][2]-f[2][2];
for(int i=1;i<=3;i++)
{
for(int j=1;j<=3;j++)
cout<<f[i][j]
cout<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:18:26: error: expected ';' before 'cout'
18 | cout<<f[i][j]
| ^
| ;
19 | cout<<endl;
| ~~~~
|
s946969556 | p03891 | C++ | #include <iostream>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;
int a[3][3]
int main()
{
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
cin >> a[0][0] >> a[0][1] >> a[1][1];
int m = a[1][1] * 3;
a[0][2] = m - a[0][0] - a[0][1];
a[2][2] = m - a[0][0] - a[1][1];
a[1][2] = m - a[0][2] - a[2][2];
a[1][0] = m - a[1][1] - a[1][2];
a[2][0] = m - a[0][0] - a[1][0];
for (int i = 0; i <= 2; ++i)
{
for (int j = 0; j <= 2; ++j)
cout << a[i][j] << " ";
cout << endl;
}
//system("pause");
return 0;
}
| a.cc:9:1: error: expected initializer before 'int'
9 | int main()
| ^~~
|
s860699172 | p03891 | C++ | a=input()
b=input()
c=input()
print a, b, 3*c-a-b
print 4*c-2*a-b, c, 2*a+b-2*c
print a+b-c, 2*c-b, 2*c-a | a.cc:1:1: error: 'a' does not name a type
1 | a=input()
| ^
|
s295724037 | p03892 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a[4];
for(int i=0;i<4;i++)
{
cin>>a[i];
}
if(a[i]%4==0)
{
cout<<a[i]<<endl;
return 0;
}
else
{
cout<<a[i]+4-a[i]%4<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:10: error: 'i' was not declared in this scope
10 | if(a[i]%4==0)
| ^
|
s696335780 | p03892 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int gcd(int a,int b){
if(b==0)return a;
return gcd(a,a%b);
}
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
int x=abs(a-c),y=abs(b-d);
cout<<((x/gcd(x,y))+(y/gcd(x,y))-1)*gcd(x,y)
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:49: error: expected ';' before 'return'
12 | cout<<((x/gcd(x,y))+(y/gcd(x,y))-1)*gcd(x,y)
| ^
| ;
13 | return 0;
| ~~~~~~
|
s022512710 | p03892 | C++ | #include <bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<map>
#include<cstring>
#include<string>
#include <math.h>
#include<algorithm>
// #include <boost/multiprecision/cpp_int.hpp>
#include<functional>
#define int long long
#define inf 1000000007
#define pa pair<int,int>
#define ll long long
#define pal pair<double,double>
#define ppap pair<pa,int>
#define PI 3.14159265358979323846
#define paa pair<int,char>
#define mp make_pair
#define pb push_back
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b))<EPS)
int dx[4]={0,-1,0,1};
int dy[4]={1,0,-1,0};
using namespace std;
class pa3{
public:
int x,y,z;
pa3(int x=0,int y=0,int z=0):x(x),y(y),z(z) {}
bool operator < (const pa3 &p) const{
if(x!=p.x) return x<p.x;
if(y!=p.y) return y<p.y;
return z<p.z;
//return x != p.x ? x<p.x: y<p.y;
}
bool operator > (const pa3 &p) const{
if(x!=p.x) return x>p.x;
if(y!=p.y) return y>p.y;
return z>p.z;
//return x != p.x ? x<p.x: y<p.y;
}
bool operator == (const pa3 &p) const{
return x==p.x && y==p.y && z==p.z;
}
bool operator != (const pa3 &p) const{
return !( x==p.x && y==p.y && z==p.z);
}
};
class pa4{
public:
int x;
int y,z,w;
pa4(int x=0,int y=0,int z=0,int w=0):x(x),y(y),z(z),w(w) {}
bool operator < (const pa4 &p) const{
if(x!=p.x) return x<p.x;
if(y!=p.y) return y<p.y;
if(z!=p.z)return z<p.z;
return w<p.w;
//return x != p.x ? x<p.x: y<p.y;
}
bool operator > (const pa4 &p) const{
if(x!=p.x) return x>p.x;
if(y!=p.y) return y>p.y;
if(z!=p.z)return z>p.z;
return w>p.w;
//return x != p.x ? x<p.x: y<p.y;
}
bool operator == (const pa4 &p) const{
return x==p.x && y==p.y && z==p.z &&w==p.w;
}
bool operator != (const pa4 &p) const{
return !(x==p.x && y==p.y && z==p.z &&w==p.w);
}
};
class pa2{
public:
int x,y;
pa2(int x=0,int y=0):x(x),y(y) {}
pa2 operator + (pa2 p) {return pa2(x+p.x,y+p.y);}
pa2 operator - (pa2 p) {return pa2(x-p.x,y-p.y);}
bool operator < (const pa2 &p) const{
return x!= p.x ? x<p.x: y<p.y;
}
bool operator > (const pa2 &p) const{
return x != p.x ? x>p.x: y>p.y;
}
bool operator == (const pa2 &p) const{
return abs(x-p.x)==0 && abs(y-p.y)==0;
}
bool operator != (const pa2 &p) const{
return !(abs(x-p.x)==0 && abs(y-p.y)==0);
}
};
#define ppa pair<int,pas>
class Point{
public:
double x,y;
Point(double x=0,double y=0):x(x),y(y) {}
Point operator + (Point p) {return Point(x+p.x,y+p.y);}
Point operator - (Point p) {return Point(x-p.x,y-p.y);}
Point operator * (double a) {return Point(x*a,y*a);}
Point operator / (double a) {return Point(x/a,y/a);}
double absv() {return sqrt(norm());}
double norm() {return x*x+y*y;}
bool operator < (const Point &p) const{
return x != p.x ? x<p.x: y<p.y;
}
bool operator == (const Point &p) const{
return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
}
};
typedef Point Vector;
#define pl pair<int,pas>
struct Segment{
Point p1,p2;
};
double dot(Vector a,Vector b){
return a.x*b.x+a.y*b.y;
}
double cross(Vector a,Vector b){
return a.x*b.y-a.y*b.x;
}
bool parareru(Point a,Point b,Point c,Point d){
// if(abs(cross(a-b,d-c))<EPS)cout<<"dd "<<cross(a-b,d-c)<<endl;
return abs(cross(a-b,d-c))<EPS;
}
double distance_ls_p(Point a, Point b, Point c) {
if ( dot(b-a, c-a) < EPS ) return (c-a).absv();
if ( dot(a-b, c-b) < EPS ) return (c-b).absv();
return abs(cross(b-a, c-a)) / (b-a).absv();
}
bool is_intersected_ls(Segment a,Segment b) {
if(a.p1==b.p1||a.p2==b.p1||a.p1==b.p2||a.p2==b.p2) return false;
if(parareru((a.p2),(a.p1),(a.p1),(b.p2))&¶reru((a.p2),(a.p1),(a.p1),(b.p1))){
// cout<<"sss"<<endl;
if(dot(a.p1-b.p1,a.p1-b.p2)<EPS) return true;
if(dot(a.p2-b.p1,a.p2-b.p2)<EPS) return true;
if(dot(a.p1-b.p1,a.p2-b.p1)<EPS) return true;
if(dot(a.p1-b.p2,a.p2-b.p2)<EPS) return true;
return false;
}
else return ( cross(a.p2-a.p1, b.p1-a.p1) * cross(a.p2-a.p1, b.p2-a.p1) < EPS ) && ( cross(b.p2-b.p1, a.p1-b.p1) * cross(b.p2-b.p1, a.p2-b.p1) < EPS );
}
double segment_dis(Segment a,Segment b){
if(is_intersected_ls(a,b))return 0;
double r=distance_ls_p(a.p1, a.p2, b.p1);
r=min(r,distance_ls_p(a.p1, a.p2, b.p2));
r=min(r,distance_ls_p(b.p1, b.p2, a.p2));
r=min(r,distance_ls_p(b.p1, b.p2, a.p1));
return r;
}
Point intersection_ls(Segment a, Segment b) {
Point ba = b.p2-b.p1;
double d1 = abs(cross(ba, a.p1-b.p1));
double d2 = abs(cross(ba, a.p2-b.p1));
double t = d1 / (d1 + d2);
return a.p1 + (a.p2-a.p1) * t;
}
string itos( int i ) {
ostringstream s ;
s << i ;
return s.str() ;
}
int gcd(int v,int b){
if(v>b) return gcd(b,v);
if(v==b) return b;
if(b%v==0) return v;
return gcd(v,b%v);
}
double distans(double x1,double y1,double x2,double y2){
double rr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
return sqrt(rr);
}
int mod;
int pr[2010];
int inv[2010];
int beki(int wa,int rr,int warukazu){
if(rr==0) return 1%warukazu;
if(rr==1) return wa%warukazu;
if(rr%2==1) return (beki(wa,rr-1,warukazu)*wa)%warukazu;
int zx=beki(wa,rr/2,warukazu);
return (zx*zx)%warukazu;
}
/*
double bekid(double w,int r){
if(r==0) return 1.0;
if(r==1) return w;
if(r%2) return bekid(w,r-1)*w;
double f=bekid(w,r/2);
return f*f;
}*/
/*
int comb(int nn,int rr){
int r=pr[nn]*inv[rr];
r%=mod;
r*=inv[nn-rr];
r%=mod;
return r;
}
*/
void gya(int ert){
pr[0]=1;
for(int i=1;i<ert;i++){
pr[i]=(pr[i-1]*i)%mod;
}
for(int i=0;i<ert;i++) inv[i]=beki(pr[i],mod-2,mod);
}
// cin.tie(0);
// ios::sync_with_stdio(false);
//priority_queue<pa3,vector<pa3>,greater<pa3>> pq;
//sort(ve.begin(),ve.end(),greater<int>());
//----------------kokomade tenpure------------
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
int a,b,c,d;
cin>>a>>b>>c>>d;
if(a==c || b==d){
cout<<0<<endl;
return 0;
}
int r1=abs(a-c),r2=abs(d-b);
int g=gcd(r1,r2);
cout<<g*(r1/g+r2/g-1)<<endl;
}
return 0;
} | a.cc:249:17: error: expected unqualified-id before 'return'
249 | return 0;
| ^~~~~~
a.cc:250:17: error: expected declaration before '}' token
250 | }
| ^
|
s198405948 | p03892 | C++ | #include <cstdio>
#include <algorithm>
int a,b,c,d,x,y;
int main(){
scanf("%d%d%d%d",&a,&b,&c,&d);
printf("%d\n",a-c+b-d-__gcd(a-c,b-d));
} | a.cc: In function 'int main()':
a.cc:8:27: error: '__gcd' was not declared in this scope; did you mean 'std::__gcd'?
8 | printf("%d\n",a-c+b-d-__gcd(a-c,b-d));
| ^~~~~
| std::__gcd
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: 'std::__gcd' declared here
1137 | __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
| ^~~~~
|
s671542128 | p03892 | C | #include<bits/stdc++.h>
using namespace std;
int main(){
int x1,y1,x2,y2;
cin>>x1>>y1>>x2>>y2;
int X=abs(x2-x1),Y=abs(y2-y1);
if(!X||!Y){
cout<<0<<endl;
return 0;
}
int ans=X+Y-1;
ans-=(X/(X/__gcd(X,Y))-1);
cout<<ans<<endl;
return 0;
}
| main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s989690593 | p03892 | C++ | import fractions
a,b,c,d=map(int,input().split())
c=abs(c-a)
d=abs(d-b)
g=fractions.gcd(max(c,d),min(c,d))
j=int(c/g)
k=int(d/g)
print((j+k-1)*g) | a.cc:1:1: error: 'import' does not name a type
1 | import fractions
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s079455701 | p03893 | C++ | #include <iostream>
using namespace std;
int main()
{
long long n,i,a[60];
cin>>n;
a[0]=2;
for (i=1;i<=n;i++) a[i]=a[i-1]+*2+2;
cout<<a[n]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:40: error: invalid type argument of unary '*' (have 'int')
8 | for (i=1;i<=n;i++) a[i]=a[i-1]+*2+2;
| ^~
|
s420222422 | p03893 | C++ | #include <iostream>
int main()
{
std::cout<<14<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
4 | std::cout<<14<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s433013502 | p03893 | C++ | #include<bits/stdc++.h>
using namespace std;
long long n,a[405];
int main()
{
cin>>n;
a[0]=2;
for(i=0;i<=n;i++) a[i]=a[i-1]*2+2;
cout<<a[n]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
8 | for(i=0;i<=n;i++) a[i]=a[i-1]*2+2;
| ^
|
s596031041 | p03893 | C++ | #include<bits/stdc++.h>
using namespace std;
long long a,b=2;
int main(){
cin>>a;
for(int i=0;i<a;i++)b=(b+1)*2;
cout<<b<<endl; | a.cc: In function 'int main()':
a.cc:7:19: error: expected '}' at end of input
7 | cout<<b<<endl;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s758705243 | p03893 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,x1=2.x2;
cin>>n;
for(int i=1;i<=n;++i)
{
x2=x1*2+2;
x1=x2;
}
cout<<x2;
return 0;
}
| a.cc: In function 'int main()':
a.cc:4:18: error: unable to find numeric literal operator 'operator""x2'
4 | int n,x1=2.x2;
| ^~~~
a.cc:8:17: error: 'x2' was not declared in this scope; did you mean 'x1'?
8 | x2=x1*2+2;
| ^~
| x1
a.cc:11:15: error: 'x2' was not declared in this scope; did you mean 'x1'?
11 | cout<<x2;
| ^~
| x1
|
s929636327 | p03893 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long a,b=2;
scanf("%d",&a);
for(int i=0;i<a;i++)
{
b=2b+2;
}
printf("%d\n",b);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:7: error: unable to find numeric literal operator 'operator""b'
9 | b=2b+2;
| ^~
|
s689687363 | p03893 | C++ | #include<iostream>
long long n,srx[101];
int i;
long long lgx(long long n)
{
if(srx[n])
return srx[n];
if(n>0)
srx[n]=lgx(n-1)*2+2;
}
int main()
{
cin>>n;
srx[0]=2;
lgx(n);
cout<<srx[n]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
13 | cin>>n;
| ^~~
| 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
| ^~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | cout<<srx[n]<<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:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
16 | cout<<srx[n]<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc: In function 'long long int lgx(long long int)':
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
10 | }
| ^
|
s665844215 | p03893 | C++ | using namespace std;
long long n;
long long m=2;
int main()
{
int i;
cin>>n;
for(i=0;i<n;i++)
{
m=(m+1)*2;
}
cout<<m<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
7 | cin>>n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:12:5: error: 'cout' was not declared in this scope
12 | cout<<m<<endl;
| ^~~~
a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:14: error: 'endl' was not declared in this scope
12 | cout<<m<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s591502450 | p03893 | C++ | using namespace std;
long long n;
long long m=2;
int main()
{
int i;
cin>>n;
for(i=0;i<a;i++)
{
m=(m+1)*2;
}
cout<<m<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
7 | cin>>n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:8:15: error: 'a' was not declared in this scope
8 | for(i=0;i<a;i++)
| ^
a.cc:12:5: error: 'cout' was not declared in this scope
12 | cout<<m<<endl;
| ^~~~
a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:14: error: 'endl' was not declared in this scope
12 | cout<<m<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s684961974 | p03893 | C++ | #include<bits/stdc++.h>
#include <stdlib.h>
#include <stdio.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n));
#define Vec(a,n) vector<string> (a)((n));
#define twovec(a,n,m) vector<vector<int>> a(n,vector<int>(m,0));
#define Twovec(a,n,m) vector<vector<double>> a(n,vector<double>(m,0));
#define P pair<int,int>
#define All(a) (a).begin(),(a).end()
#define Sort(a) sort(All(a));
#define Reverse(a) reverse(All(a));
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
#define print(a) cout << (a) << endl;
#define printD(a) cout << setprecision(10) << ans << endl;
using namespace std;
int max_int = 1000000007;
void Debug(auto a);
int nibul(auto a,auto b);
int nibuu(auto a,auto b);
void input(vector<int>& a,int n);
int n,m;
struct UnionFind {
vector<int> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2
UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
for(int i = 0; i < N; i++) par[i] = i;
}
int root(int x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根}
if (par[x] == x) return x;
return par[x] = root(par[x]);
}
void unite(int x, int y) { // xとyの木を併合
int rx = root(x); //xの根をrx
int ry = root(y); //yの根をry
if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時:xの根rxをyの根ryにつける
}
bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
int rx = root(x);
int ry = root(y);
return rx == ry;
}
};
signed main(){
cin >> n;
int ans = 2;
REP(i,n){
ans = ans*2+2;
}
peint(ans)
return 0;
}
void Debug(auto a){
cout << "{ ";
for(auto b: a){
cout << b << " ";
}
cout << "}" << endl;
}
int nibul(auto a,auto b){
int x = lower_bound(All(a),b) - a.begin();
//key以上の初めてのitr
return x;
}
int nibuu(auto a,auto b){
int x = upper_bound(All(a),b) - a.begin();
//key以下の最後のitr
return x-1;
}
void input(vector<int>& a,int n){
REP(i,n){
cin >> a[i];
}
}
| a.cc:21:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
21 | void Debug(auto a);
| ^~~~
a.cc:22:11: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
22 | int nibul(auto a,auto b);
| ^~~~
a.cc:22:18: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
22 | int nibul(auto a,auto b);
| ^~~~
a.cc:23:11: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
23 | int nibuu(auto a,auto b);
| ^~~~
a.cc:23:18: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
23 | int nibuu(auto a,auto b);
| ^~~~
a.cc: In function 'int main()':
a.cc:60:5: error: 'peint' was not declared in this scope; did you mean 'print'?
60 | peint(ans)
| ^~~~~
| print
a.cc: At global scope:
a.cc:64:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
64 | void Debug(auto a){
| ^~~~
a.cc:71:11: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
71 | int nibul(auto a,auto b){
| ^~~~
a.cc:71:18: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
71 | int nibul(auto a,auto b){
| ^~~~
a.cc:76:11: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
76 | int nibuu(auto a,auto b){
| ^~~~
a.cc:76:18: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
76 | int nibuu(auto a,auto b){
| ^~~~
|
s043650289 | p03893 | C++ | #include<cstdio>
#define ll long long
using namesapce std;
ll n,a[101];
int i;
ll f(ll n)
{
if(a[n])
{
return a[n];
}
if(n>0)
{
a[n]=f(n-1)*2+2;
}
}
int main()
{
scanf("%d",&n);
a[0]=2;
f(n);
printf("%lld\n",a[n]);
} | a.cc:3:7: error: expected nested-name-specifier before 'namesapce'
3 | using namesapce std;
| ^~~~~~~~~
a.cc: In function 'long long int f(long long int)':
a.cc:16:1: warning: control reaches end of non-void function [-Wreturn-type]
16 | }
| ^
|
s691947225 | p03893 | C++ | #include<bits/stdc++.h>
using namespace std;
long long n;
long long srd[1000001];
void dg(long long n){
srd[n]=srd[n-1]>>1+2;
return;
}
int main(){
cin>>n;
for(int i=1;i<=n;i++)
dg(n);
cout<<f[n];
return 0;
} | a.cc: In function 'int main()':
a.cc:13:15: error: 'f' was not declared in this scope
13 | cout<<f[n];
| ^
|
s575135578 | p03893 | C++ | #include<bits/stdc++.h>
using namespace std;
int n;
int srd[100000001]={2,};
int dg(int n){
if(srd[n])
return srd[n];
if(n>0)
srd[n]=dg(n-1)*2+2;
}
int main(){
cin>>n;
dg(n);
return 0;
} | a.cc: In function 'int dg(int)':
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
10 | }
| ^
g++: internal compiler error: File size limit exceeded signal terminated program as
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
|
s845553083 | p03893 | C++ | #include<bits/stdc++.h>
using namespace std;
int n;
int srd[100000001]={2,};
int dg(int n){
if(srx[n])
return srd[n];
if(n>0)
srd[n]=lgx(n-1)*2+2;
}
int main(){
cin>>n;
dg(n);
return 0;
} | a.cc: In function 'int dg(int)':
a.cc:6:12: error: 'srx' was not declared in this scope; did you mean 'srd'?
6 | if(srx[n])
| ^~~
| srd
a.cc:9:16: error: 'lgx' was not declared in this scope
9 | srd[n]=lgx(n-1)*2+2;
| ^~~
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
10 | }
| ^
|
s989137172 | p03893 | C++ | #include<bits/stdc++.h>
using namespace std;
int n;
int srd[100000001]={2,};
int dg(int n){
if(srx[n])
return srx[n];
if(n>0)
srx[n]=lgx(n-1)*2+2;
}
int main(){
cin>>n;
dg(n);
return 0;
} | a.cc: In function 'int dg(int)':
a.cc:6:12: error: 'srx' was not declared in this scope; did you mean 'srd'?
6 | if(srx[n])
| ^~~
| srd
a.cc:9:9: error: 'srx' was not declared in this scope; did you mean 'srd'?
9 | srx[n]=lgx(n-1)*2+2;
| ^~~
| srd
a.cc:9:16: error: 'lgx' was not declared in this scope
9 | srx[n]=lgx(n-1)*2+2;
| ^~~
|
s455153860 | p03893 | C++ | #include<iostream>
int n,f[1000];
int main()
{
std::cin>>n;
f[0]=2;
for(register int i=1;i<=n;i++)
f[i]=f[i-1]*2+2;
std::cout<<f[n]<<endl;
} | a.cc: In function 'int main()':
a.cc:9:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
9 | for(register int i=1;i<=n;i++)
| ^
a.cc:11:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | std::cout<<f[n]<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s422053176 | p03893 | C++ | #include <iostream>
using namespace std;
int f[300];
int main()
{
f[0]=2;
cin>>n;
for(int i=1;i<=n;i++)
f[n]=f[n-1]*2+2;
cout<<f[n]<<endl;
return 0;
}
//f[n]=f[n-1]*2+2 | a.cc: In function 'int main()':
a.cc:7:10: error: 'n' was not declared in this scope
7 | cin>>n;
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.