Submission #2934723


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
string str;
string o1 = "ADOPQR";
int cnt;
bool check(int j) {
  for (int i = 0; i < 6; ++i) {
    if (o1[i] == str[j]) {
      return 1;
    }
  }
  return 0;
}
int main() {
  cin >> str;
  if (str[0] == "B" || str[1] == "B" || str[2] == "B" || str[3] == "B") 
    puts("no");
  else if (!check(0) && !check(1) && check(2) && !check(3))
    puts("yes");
  else
    puts("no");
  return 0;
}

Submission Info

Submission Time
Task A - UTPC
User luogu_bot5
Language C++ (GCC 5.4.1)
Score 0
Code Size 461 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:16:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if (str[0] == "B" || str[1] == "B" || str[2] == "B" || str[3] == "B") 
                 ^
./Main.cpp:16:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if (str[0] == "B" || str[1] == "B" || str[2] == "B" || str[3] == "B") 
                                  ^
./Main.cpp:16:51: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if (str[0] == "B" || str[1] == "B" || str[2] == "B" || str[3] == "B") 
                                                   ^
./Main.cpp:16:68: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if (str[0] == "B" || str[1] == "B" || str[2] == "B" || str[3] == "B") 
                                                                    ^