Submission #942311


Source Code Expand

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
	
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		
		String s = sc.next();
		int c = s.indexOf('C');
		int f = s.lastIndexOf('F');
		if (c >= 0 && f >= 0 && c < f) {
			out.println("Yes");
		} else {
			out.println("No");
		}
		
		out.flush();
	}
	
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;
	
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}
	
	private byte readByte() {
		if (hasNextByte()) {
			return buffer[ptr++];
		} else {
			return -1;
		}
	}
	
	private boolean isPrintableChar(int c) {
		return '!' <= c && c <= '~';
	}
	
	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
			ptr++;
		}
	}
	
	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}
	
	public String next() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		byte b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
}

Submission Info

Submission Time
Task A - CF
User deka0106
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 1623 Byte
Status AC
Exec Time 97 ms
Memory 8148 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 4
AC × 12
Set Name Test Cases
Sample 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt
All 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt
Case Name Status Exec Time Memory
0_000.txt AC 95 ms 8148 KB
0_001.txt AC 94 ms 8148 KB
0_002.txt AC 95 ms 8016 KB
0_003.txt AC 95 ms 8016 KB
1_004.txt AC 95 ms 8016 KB
1_005.txt AC 95 ms 8016 KB
1_006.txt AC 96 ms 8020 KB
1_007.txt AC 96 ms 8020 KB
1_008.txt AC 94 ms 8148 KB
1_009.txt AC 95 ms 8020 KB
1_010.txt AC 96 ms 8016 KB
1_011.txt AC 97 ms 8016 KB