Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suenagasuenaga7/6cda4c55053d455887ead0b016e5172a to your computer and use it in GitHub Desktop.
Save suenagasuenaga7/6cda4c55053d455887ead0b016e5172a to your computer and use it in GitHub Desktop.
ARC022
import java.util.*;
 
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String S = sc.next();
boolean iflag = false;
boolean cflag = false;
boolean tflag = false;
for(int i = 0;i < S.length();i++){
if(S.charAt(i) == 'I' || S.charAt(i) == 'i'){
iflag = true;
continue;
}
if(iflag && (S.charAt(i) == 'C' || S.charAt(i) == 'c')){
cflag = true;
continue;
}
if(cflag && (S.charAt(i) == 'T' || S.charAt(i) == 't')){
tflag = true;
continue;
}
}
if(iflag && cflag && tflag){
System.out.println("YES");
}else{
System.out.println("NO");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment