Skip to content

Instantly share code, notes, and snippets.

@narita1980
Created January 21, 2019 15:47
Show Gist options
  • Save narita1980/19ee5bcdbeff4abf5708978d6cba7d04 to your computer and use it in GitHub Desktop.
Save narita1980/19ee5bcdbeff4abf5708978d6cba7d04 to your computer and use it in GitHub Desktop.
提出 #4065410
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(System.in);
String input = scanner.nextLine();
if (input.matches("keyence.*")) {System.out.println("YES"); return;}
if (input.matches("keyenc.*e")) {System.out.println("YES"); return;}
if (input.matches("keyen.*ce")) {System.out.println("YES"); return;}
if (input.matches("keye.*nce")) {System.out.println("YES"); return;}
if (input.matches("key.*ence")) {System.out.println("YES"); return;}
if (input.matches("ke.*yence")) {System.out.println("YES"); return;}
if (input.matches("k.*eyence")) {System.out.println("YES"); return;}
if (input.matches(".*keyence")) {System.out.println("YES"); return;}
System.out.println("NO");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment