結果
問題 | No.945 YKC饅頭 |
ユーザー | tenten |
提出日時 | 2021-11-19 16:02:38 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 714 ms / 2,000 ms |
コード長 | 1,690 bytes |
コンパイル時間 | 2,792 ms |
コンパイル使用メモリ | 80,208 KB |
実行使用メモリ | 67,336 KB |
最終ジャッジ日時 | 2024-06-09 22:59:01 |
合計ジャッジ時間 | 31,466 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 73 ms
38,296 KB |
testcase_01 | AC | 76 ms
38,776 KB |
testcase_02 | AC | 86 ms
40,140 KB |
testcase_03 | AC | 109 ms
40,960 KB |
testcase_04 | AC | 80 ms
40,320 KB |
testcase_05 | AC | 93 ms
40,288 KB |
testcase_06 | AC | 107 ms
40,704 KB |
testcase_07 | AC | 99 ms
40,684 KB |
testcase_08 | AC | 88 ms
40,124 KB |
testcase_09 | AC | 99 ms
40,688 KB |
testcase_10 | AC | 103 ms
40,416 KB |
testcase_11 | AC | 92 ms
40,704 KB |
testcase_12 | AC | 102 ms
40,516 KB |
testcase_13 | AC | 112 ms
40,832 KB |
testcase_14 | AC | 106 ms
40,960 KB |
testcase_15 | AC | 91 ms
40,568 KB |
testcase_16 | AC | 83 ms
40,512 KB |
testcase_17 | AC | 105 ms
40,616 KB |
testcase_18 | AC | 106 ms
40,552 KB |
testcase_19 | AC | 88 ms
40,548 KB |
testcase_20 | AC | 80 ms
38,516 KB |
testcase_21 | AC | 85 ms
40,448 KB |
testcase_22 | AC | 120 ms
40,660 KB |
testcase_23 | AC | 121 ms
40,944 KB |
testcase_24 | AC | 112 ms
40,656 KB |
testcase_25 | AC | 115 ms
41,032 KB |
testcase_26 | AC | 117 ms
40,944 KB |
testcase_27 | AC | 86 ms
40,496 KB |
testcase_28 | AC | 91 ms
40,504 KB |
testcase_29 | AC | 84 ms
40,780 KB |
testcase_30 | AC | 86 ms
38,896 KB |
testcase_31 | AC | 253 ms
45,612 KB |
testcase_32 | AC | 335 ms
51,644 KB |
testcase_33 | AC | 505 ms
60,916 KB |
testcase_34 | AC | 525 ms
61,828 KB |
testcase_35 | AC | 578 ms
63,816 KB |
testcase_36 | AC | 403 ms
47,748 KB |
testcase_37 | AC | 397 ms
47,788 KB |
testcase_38 | AC | 408 ms
48,292 KB |
testcase_39 | AC | 336 ms
50,480 KB |
testcase_40 | AC | 365 ms
53,940 KB |
testcase_41 | AC | 302 ms
49,120 KB |
testcase_42 | AC | 511 ms
51,900 KB |
testcase_43 | AC | 361 ms
49,084 KB |
testcase_44 | AC | 604 ms
67,336 KB |
testcase_45 | AC | 540 ms
61,624 KB |
testcase_46 | AC | 255 ms
53,936 KB |
testcase_47 | AC | 714 ms
51,708 KB |
testcase_48 | AC | 259 ms
45,720 KB |
testcase_49 | AC | 430 ms
50,556 KB |
testcase_50 | AC | 509 ms
51,920 KB |
testcase_51 | AC | 625 ms
64,836 KB |
testcase_52 | AC | 644 ms
66,660 KB |
testcase_53 | AC | 665 ms
64,860 KB |
testcase_54 | AC | 597 ms
55,500 KB |
testcase_55 | AC | 631 ms
64,464 KB |
testcase_56 | AC | 288 ms
53,412 KB |
testcase_57 | AC | 247 ms
55,936 KB |
testcase_58 | AC | 679 ms
63,056 KB |
testcase_59 | AC | 677 ms
62,892 KB |
testcase_60 | AC | 544 ms
62,244 KB |
testcase_61 | AC | 686 ms
63,376 KB |
testcase_62 | AC | 674 ms
63,032 KB |
testcase_63 | AC | 284 ms
56,584 KB |
testcase_64 | AC | 570 ms
63,084 KB |
testcase_65 | AC | 529 ms
62,408 KB |
testcase_66 | AC | 516 ms
62,504 KB |
testcase_67 | AC | 636 ms
63,912 KB |
testcase_68 | AC | 564 ms
62,904 KB |
testcase_69 | AC | 404 ms
59,244 KB |
testcase_70 | AC | 421 ms
61,128 KB |
testcase_71 | AC | 423 ms
60,752 KB |
testcase_72 | AC | 577 ms
62,844 KB |
testcase_73 | AC | 709 ms
63,328 KB |
ソースコード
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(); TreeSet<Integer> remain = new TreeSet<>(); for (int i = 1; i <= n; i++) { remain.add(i); } int y = 0; int k = 0; int c = 0; for (int i = 0; i < m; i++) { Integer key = sc.nextInt() - 1; int end = sc.nextInt(); char x = sc.next().charAt(0); while ((key = remain.higher(key)) != null) { if (key > end) { break; } if (x == 'Y') { y++; } else if (x == 'K') { k++; } else { c++; } remain.remove(key); } } System.out.println(y + " " + k + " " + c); } } 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(); } }