Submission #5548112


Source Code Expand

Copy
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
 
#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define SUR 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}
using namespace std;

int main(){
    int A;
    string str= "No";
    string s;
    cin >> A;
    cin >> s;
    const char* x= s.c_str();
    int len= strlen(x);
    for(int i=0; i<len; i++){
        if(x[i]=="+"){
            A++;
        }else{
            if(A==1){
                str= "Yes"; 
                break;
            }
        }
    }
    cout << str << endl;
}

Submission Info

Submission Time
Task B - セキュリティ
User miiifa
Language C++14 (Clang 3.8.0)
Score 0
Code Size 1258 Byte
Status

Compile Error

./Main.cpp:42:16: warning: result of comparison against a string literal is unspecified (use strncmp instead) [-Wstring-compare]
        if(x[i]=="+"){
               ^ ~~~
./Main.cpp:42:16: error: comparison between pointer and integer ('int' and 'const char *')
        if(x[i]=="+"){
           ~~~~^ ~~~
1 warning and 1 error generated.