結果

問題 No.400 鏡
ユーザー 37zigen37zigen
提出日時 2016-07-23 00:17:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 491 bytes
コンパイル時間 2,185 ms
コンパイル使用メモリ 74,724 KB
実行使用メモリ 54,556 KB
最終ジャッジ日時 2024-04-24 03:11:55
合計ジャッジ時間 3,947 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
53,916 KB
testcase_01 AC 115 ms
53,936 KB
testcase_02 AC 117 ms
54,072 KB
testcase_03 AC 120 ms
53,928 KB
testcase_04 AC 109 ms
53,368 KB
testcase_05 AC 113 ms
54,004 KB
testcase_06 AC 112 ms
54,192 KB
testcase_07 AC 105 ms
52,732 KB
testcase_08 AC 119 ms
54,556 KB
testcase_09 AC 104 ms
54,324 KB
testcase_10 AC 106 ms
52,868 KB
testcase_11 AC 119 ms
53,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		solver();
	}

	static void solver() {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuilder sb = new StringBuilder();
		for (int i = s.length() - 1; i >= 0; i--) {
			if (s.charAt(i) == '<') {
				sb.append(">");
			} else if (s.charAt(i) == '>') {
				sb.append("<");
			}else{
				throw new AssertionError();
			}
		}
		System.out.println(sb.toString());
		sc.close();
	}
}
0