結果

問題 No.400 鏡
ユーザー 37zigen37zigen
提出日時 2016-07-23 00:17:36
言語 Java19
(openjdk 21)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 491 bytes
コンパイル時間 2,008 ms
コンパイル使用メモリ 72,136 KB
実行使用メモリ 56,276 KB
最終ジャッジ日時 2023-08-06 07:01:01
合計ジャッジ時間 4,124 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
55,632 KB
testcase_01 AC 114 ms
56,104 KB
testcase_02 AC 115 ms
55,460 KB
testcase_03 AC 115 ms
56,056 KB
testcase_04 AC 114 ms
55,392 KB
testcase_05 AC 114 ms
55,620 KB
testcase_06 AC 114 ms
56,276 KB
testcase_07 AC 114 ms
55,812 KB
testcase_08 AC 115 ms
55,996 KB
testcase_09 AC 112 ms
55,380 KB
testcase_10 AC 116 ms
56,044 KB
testcase_11 AC 114 ms
55,968 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