AtCoder Beginner Contest 011

Submission #3977360

Source codeソースコード

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



public class Main{



	public static void main(String args[])throws Exception{

		FastScanner sc = new FastScanner();
		String S = sc.next();
		
		String T = S.substring(1);
		String t = T.toLowerCase();
		S = S.substring(0, 1);
		String s = S.toUpperCase();
		System.out.println(s+t);
	}

}





class FastScanner {
    private final java.io.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 int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    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();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return (minus ? -n : n);
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return (int) (minus ? -n : n);
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
}


Submission

Task問題 B - 名前の確認
User nameユーザ名 Suunn
Created time投稿日時
Language言語 Java8 (OpenJDK 1.8.0)
Status状態 AC
Score得点 100
Source lengthソースコード長 3073 Byte
File nameファイル名
Exec time実行時間 72 ms
Memory usageメモリ使用量 21332 KB

Test case

Set

Set name Score得点 / Max score Cases
All 100 / 100 sample_01.txt,sample_02.txt,test_AzielehadfJD.txt,test_Oq.txt,test_P.txt,test_Wi.txt,test_ZNEFzealEAkD.txt,test_aAZaz.txt,test_z.txt,test_zDkElDjNVmAq.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
sample_01.txt AC 72 ms 19796 KB
sample_02.txt AC 68 ms 17876 KB
test_AzielehadfJD.txt AC 70 ms 19668 KB
test_Oq.txt AC 67 ms 21332 KB
test_P.txt AC 68 ms 20564 KB
test_Wi.txt AC 68 ms 17620 KB
test_ZNEFzealEAkD.txt AC 68 ms 17364 KB
test_aAZaz.txt AC 70 ms 20692 KB
test_z.txt AC 70 ms 20820 KB
test_zDkElDjNVmAq.txt AC 69 ms 21076 KB