Submission #187305
Source Code Expand
import java.io.*; import java.util.*; public class Main { FastScanner in = new FastScanner(System.in); PrintWriter out = new PrintWriter(System.out); public void run() { String s = in.next(); String res = ""; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (i == 0) { if (Character.isLowerCase(c)) res += (char)(c - 32); else res += c; } else { if (Character.isUpperCase(c)) res += (char)(c + 32); else res += c; } } System.out.println(res); out.close(); } public static void main(String[] args) { new Main().run(); } public void mapDebug(int[][] a) { System.out.println("--------map display---------"); for (int i = 0; i < a.length; i++) { for (int j = 0; j < a[i].length; j++) { System.out.printf("%3d ", a[i][j]); } System.out.println(); } System.out.println("----------------------------"); System.out.println(); } public void debug(Object... obj) { System.out.println(Arrays.deepToString(obj)); } class FastScanner { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; public FastScanner(InputStream stream) { this.stream = stream; //stream = new FileInputStream(new File("dec.in")); } int read() { if (numChars == -1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) return -1; } return buf[curChar++]; } boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } boolean isEndline(int c) { return c == '\n' || c == '\r' || c == -1; } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String next() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } String nextLine() { int c = read(); while (isEndline(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isEndline(c)); return res.toString(); } } }
Submission Info
Submission Time | |
---|---|
Task | B - 名前の確認 |
User | hiro116s |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 2591 Byte |
Status | AC |
Exec Time | 385 ms |
Memory | 20756 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | test_AzielehadfJD.txt, test_Oq.txt, test_P.txt, test_Wi.txt, test_ZNEFzealEAkD.txt, test_aAZaz.txt, test_z.txt, test_zDkElDjNVmAq.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 380 ms | 20656 KB |
sample_02.txt | AC | 380 ms | 20660 KB |
test_AzielehadfJD.txt | AC | 378 ms | 20660 KB |
test_Oq.txt | AC | 382 ms | 20756 KB |
test_P.txt | AC | 380 ms | 20692 KB |
test_Wi.txt | AC | 375 ms | 20660 KB |
test_ZNEFzealEAkD.txt | AC | 380 ms | 20664 KB |
test_aAZaz.txt | AC | 374 ms | 20660 KB |
test_z.txt | AC | 385 ms | 20660 KB |
test_zDkElDjNVmAq.txt | AC | 378 ms | 20664 KB |