結果

問題 No.1439 Let's Compare!!!!
ユーザー tentententen
提出日時 2024-02-07 12:58:22
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 1,886 bytes
コンパイル時間 2,905 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 66,160 KB
最終ジャッジ日時 2024-02-07 12:58:41
合計ジャッジ時間 19,165 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
54,892 KB
testcase_01 AC 79 ms
54,888 KB
testcase_02 AC 78 ms
54,888 KB
testcase_03 AC 81 ms
54,880 KB
testcase_04 AC 82 ms
54,884 KB
testcase_05 AC 81 ms
54,928 KB
testcase_06 AC 80 ms
54,884 KB
testcase_07 AC 149 ms
56,176 KB
testcase_08 AC 160 ms
56,692 KB
testcase_09 AC 147 ms
56,300 KB
testcase_10 AC 579 ms
65,748 KB
testcase_11 AC 1,514 ms
66,116 KB
testcase_12 AC 1,440 ms
65,940 KB
testcase_13 AC 568 ms
65,800 KB
testcase_14 AC 595 ms
65,936 KB
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 AC 1,470 ms
65,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        List<StringBuilder> strings = IntStream.range(0, 2).mapToObj(i -> new StringBuilder(sc.next())).toList();
        Map<String, Integer> idxes = Map.of("S", 0, "T", 1);
        int q = sc.nextInt();
        String result = IntStream.range(0, q).mapToObj(i -> {
            int x = idxes.get(sc.next());
            int positon = sc.nextInt() - 1;
            char c = (char)(sc.nextInt() + '0');
            strings.get(x).setCharAt(positon, c);
            int comp = strings.get(0).compareTo(strings.get(1));
            if (comp == 0) {
                return "=";
            } else if (comp < 0) {
                return "<";
            } else {
                return ">";
            }
        }).collect(Collectors.joining("\n"));
        System.out.println(result);
    }
}
class Scanner {
    BufferedReader br;
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
        } catch (Exception e) {
            
        }
    }
    
    public int nextInt() {
        return Integer.parseInt(next());
    }
    
    public long nextLong() {
        return Long.parseLong(next());
    }
    
    public double nextDouble() {
        return Double.parseDouble(next());
    }
    
    public String next() {
        try {
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            return st.nextToken();
        }
    }
    
}
0