結果

問題 No.1362 [Zelkova 8th Tune] Black Sheep
ユーザー ks2mks2m
提出日時 2021-01-22 22:06:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 388 ms / 1,000 ms
コード長 490 bytes
コンパイル時間 2,179 ms
コンパイル使用メモリ 78,284 KB
実行使用メモリ 62,756 KB
最終ジャッジ日時 2023-08-27 19:19:34
合計ジャッジ時間 14,256 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 149 ms
56,644 KB
testcase_01 AC 149 ms
56,856 KB
testcase_02 AC 148 ms
56,856 KB
testcase_03 AC 148 ms
56,996 KB
testcase_04 AC 150 ms
56,972 KB
testcase_05 AC 148 ms
56,856 KB
testcase_06 AC 152 ms
56,708 KB
testcase_07 AC 153 ms
56,560 KB
testcase_08 AC 152 ms
56,756 KB
testcase_09 AC 150 ms
56,744 KB
testcase_10 AC 154 ms
56,656 KB
testcase_11 AC 152 ms
56,804 KB
testcase_12 AC 155 ms
56,608 KB
testcase_13 AC 355 ms
62,480 KB
testcase_14 AC 360 ms
60,060 KB
testcase_15 AC 249 ms
60,152 KB
testcase_16 AC 299 ms
60,236 KB
testcase_17 AC 370 ms
61,724 KB
testcase_18 AC 337 ms
60,312 KB
testcase_19 AC 380 ms
62,164 KB
testcase_20 AC 349 ms
61,560 KB
testcase_21 AC 320 ms
60,064 KB
testcase_22 AC 351 ms
62,092 KB
testcase_23 AC 356 ms
62,128 KB
testcase_24 AC 369 ms
61,920 KB
testcase_25 AC 357 ms
61,464 KB
testcase_26 AC 359 ms
61,828 KB
testcase_27 AC 362 ms
61,916 KB
testcase_28 AC 358 ms
62,756 KB
testcase_29 AC 384 ms
62,100 KB
testcase_30 AC 360 ms
61,732 KB
testcase_31 AC 388 ms
62,212 KB
testcase_32 AC 377 ms
61,904 KB
testcase_33 AC 362 ms
61,744 KB
testcase_34 AC 355 ms
61,980 KB
testcase_35 AC 150 ms
56,768 KB
testcase_36 AC 150 ms
56,680 KB
testcase_37 AC 151 ms
56,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();

		Map<Character, Integer> map = new HashMap<>();
		for (char c : s) {
			map.put(c, map.getOrDefault(c, 0) + 1);
		}

		for (int i = 0; i < s.length; i++) {
			if (map.get(s[i]) == 1) {
				System.out.println(i + 1 + " " + s[i]);
			}
		}
	}
}
0