結果
問題 | No.649 ここでちょっとQK! |
ユーザー | denderaKawazu |
提出日時 | 2018-02-10 00:11:18 |
言語 | Java21 (openjdk 21) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,400 bytes |
コンパイル時間 | 4,558 ms |
コンパイル使用メモリ | 86,780 KB |
実行使用メモリ | 74,456 KB |
最終ジャッジ日時 | 2024-04-17 14:19:53 |
合計ジャッジ時間 | 15,047 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 141 ms
46,776 KB |
testcase_01 | AC | 142 ms
41,524 KB |
testcase_02 | AC | 143 ms
41,408 KB |
testcase_03 | AC | 869 ms
53,308 KB |
testcase_04 | AC | 1,308 ms
74,456 KB |
testcase_05 | AC | 1,345 ms
72,580 KB |
testcase_06 | AC | 1,348 ms
72,112 KB |
testcase_07 | AC | 140 ms
41,156 KB |
testcase_08 | AC | 143 ms
41,392 KB |
testcase_09 | AC | 143 ms
41,636 KB |
testcase_10 | AC | 144 ms
41,436 KB |
testcase_11 | AC | 146 ms
41,496 KB |
testcase_12 | TLE | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
ソースコード
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; import java.util.LinkedList; import java.util.Collections; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskD solver = new TaskD(); solver.solve(1, in, out); out.close(); } static class TaskD { public void solve(int testNumber, Scanner in, PrintWriter out) { int q = in.nextInt(); int k = in.nextInt(); LinkedList<Long> num = new LinkedList<>(); for (int i = 0; i < q; i++) { int qn = in.nextInt(); if (qn == 1) { num.add(in.nextLong()); } else { if (num.size() < k) { out.println(-1); } else { Collections.sort(num); long cn = num.get(k - 1); out.println(cn); num.remove(k - 1); } } } } } }