結果

問題 No.1795 AtCoder Heuristic Rating coloring
ユーザー tentententen
提出日時 2021-12-24 09:23:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 770 ms / 2,000 ms
コード長 1,409 bytes
コンパイル時間 6,114 ms
コンパイル使用メモリ 79,340 KB
実行使用メモリ 78,732 KB
最終ジャッジ日時 2023-10-20 07:52:42
合計ジャッジ時間 23,554 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
52,416 KB
testcase_01 AC 56 ms
52,416 KB
testcase_02 AC 57 ms
52,384 KB
testcase_03 AC 59 ms
52,408 KB
testcase_04 AC 146 ms
56,008 KB
testcase_05 AC 148 ms
56,488 KB
testcase_06 AC 150 ms
56,040 KB
testcase_07 AC 154 ms
56,116 KB
testcase_08 AC 151 ms
56,420 KB
testcase_09 AC 156 ms
56,148 KB
testcase_10 AC 157 ms
56,072 KB
testcase_11 AC 155 ms
56,500 KB
testcase_12 AC 60 ms
52,416 KB
testcase_13 AC 62 ms
53,440 KB
testcase_14 AC 60 ms
53,436 KB
testcase_15 AC 58 ms
52,412 KB
testcase_16 AC 60 ms
53,452 KB
testcase_17 AC 58 ms
51,388 KB
testcase_18 AC 60 ms
52,780 KB
testcase_19 AC 57 ms
53,428 KB
testcase_20 AC 61 ms
53,448 KB
testcase_21 AC 58 ms
53,444 KB
testcase_22 AC 61 ms
53,432 KB
testcase_23 AC 58 ms
53,380 KB
testcase_24 AC 60 ms
53,440 KB
testcase_25 AC 60 ms
53,440 KB
testcase_26 AC 60 ms
53,432 KB
testcase_27 AC 60 ms
52,852 KB
testcase_28 AC 59 ms
53,428 KB
testcase_29 AC 61 ms
53,428 KB
testcase_30 AC 58 ms
53,440 KB
testcase_31 AC 58 ms
53,428 KB
testcase_32 AC 403 ms
66,256 KB
testcase_33 AC 323 ms
61,248 KB
testcase_34 AC 493 ms
68,516 KB
testcase_35 AC 446 ms
66,288 KB
testcase_36 AC 501 ms
68,564 KB
testcase_37 AC 347 ms
62,732 KB
testcase_38 AC 332 ms
63,588 KB
testcase_39 AC 548 ms
68,444 KB
testcase_40 AC 422 ms
66,496 KB
testcase_41 AC 523 ms
68,616 KB
testcase_42 AC 394 ms
65,888 KB
testcase_43 AC 395 ms
66,240 KB
testcase_44 AC 462 ms
68,420 KB
testcase_45 AC 402 ms
65,976 KB
testcase_46 AC 571 ms
68,520 KB
testcase_47 AC 268 ms
58,836 KB
testcase_48 AC 379 ms
66,296 KB
testcase_49 AC 577 ms
68,812 KB
testcase_50 AC 385 ms
65,120 KB
testcase_51 AC 363 ms
62,904 KB
testcase_52 AC 658 ms
70,232 KB
testcase_53 AC 652 ms
70,172 KB
testcase_54 AC 759 ms
78,692 KB
testcase_55 AC 770 ms
78,732 KB
testcase_56 AC 729 ms
78,692 KB
testcase_57 AC 722 ms
78,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int m = sc.nextInt();
        TreeMap<String, Integer> points = new TreeMap<>();
        for (int i = 0; i < n; i++) {
            points.put(sc.next(), sc.nextInt());
        }
        for (int i = 0; i < m; i++) {
            points.put(sc.next(), sc.nextInt());
        }
        StringBuilder sb = new StringBuilder();
        for (Map.Entry<String, Integer> entry : points.entrySet()) {
            sb.append(entry.getKey()).append(" ").append(entry.getValue()).append("\n");
        }
        System.out.print(sb);
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0