Language: C++


using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
 
int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }
 
int main() {
    string s;
    cin >> s;
    int n = s.length();
    int m = 7;
    REP(i,m){
        int j = m - i;
        string t = s.substr(0, i);
        t += s.substr(n - j, j);
        if (t == "keyence"){
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
    return 0;
}


Compiler output:
a.cc:10:9: error: 'vector' does not name a type
   10 | typedef vector<int> VI;
      |         ^~~~~~
a.cc:11:9: error: 'vector' does not name a type
   11 | typedef vector<ll> VL;
      |         ^~~~~~
a.cc:12:9: error: 'vector' does not name a type
   12 | typedef vector<VI> VVI;
      |         ^~~~~~
a.cc:13:9: error: 'vector' does not name a type
   13 | typedef vector<VL> VVL;
      |         ^~~~~~
a.cc:14:9: error: 'pair' does not name a type
   14 | typedef pair<int,int> P;
      |         ^~~~
a.cc:15:9: error: 'pair' does not name a type
   15 | typedef pair<ll,ll> PL;
      |         ^~~~
a.cc: In function 'int in()':
a.cc:17:19: error: 'scanf' was not declared in this scope
   17 | int in() { int x; scanf("%d", &x); return x; }
      |                   ^~~~~
a.cc: In function 'll lin()':
a.cc:18:18: error: 'scanf' was not declared in this scope
   18 | ll lin() { ll x; scanf("%lld", &x); return x; }
      |                  ^~~~~
a.cc: In function 'int main()':
a.cc:21:5: error: 'string' was not declared in this scope
   21 |     string s;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | 
a.cc:22:5: error: 'cin' was not declared in this scope
   22 |     cin >> s;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:22:12: error: 's' was not declared in this scope
   22 |     cin >> s;
      |            ^
a.cc:27:15: error: expected ';' before 't'
   27 |         string t = s.substr(0, i);
      |               ^~
      |               ;
a.cc:28:9: error: 't' was not declared in this scope
   28 |         t += s.substr(n - j, j);
      |         ^
a.cc:30:13: error: 'cout' was not declared in this scope
   30 |             cout << "YES" << endl;
      |             ^~~~
a.cc:30:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:30: error: 'endl' was not declared in this scope
   30 |             cout << "YES" << endl;
      |                              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | 
a.cc:34:5: error: 'cout' was not declared in this scope
   34 |     cout << "NO" << endl;
      |     ^~~~
a.cc:34:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:21: error: 'endl' was not declared in this scope
   34 |     cout << "NO" << endl;
      |                     ^~~~
a.cc:34:21: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'