結果

問題 No.2424 Josouzai
ユーザー laneguelanegue
提出日時 2023-08-18 21:07:14
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 244 bytes
コンパイル時間 4,942 ms
コンパイル使用メモリ 212,992 KB
実行使用メモリ 10,876 KB
最終ジャッジ日時 2024-05-06 02:38:33
合計ジャッジ時間 7,582 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 23 ms
5,376 KB
testcase_05 AC 77 ms
10,688 KB
testcase_06 AC 72 ms
10,748 KB
testcase_07 AC 75 ms
10,876 KB
testcase_08 AC 76 ms
10,820 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 12 ms
5,376 KB
testcase_11 AC 35 ms
10,292 KB
testcase_12 AC 24 ms
6,472 KB
testcase_13 AC 23 ms
5,376 KB
testcase_14 AC 39 ms
5,956 KB
testcase_15 AC 6 ms
5,376 KB
testcase_16 AC 73 ms
10,312 KB
testcase_17 AC 16 ms
5,376 KB
testcase_18 AC 19 ms
5,376 KB
testcase_19 AC 33 ms
5,552 KB
testcase_20 AC 65 ms
10,328 KB
testcase_21 AC 47 ms
6,596 KB
testcase_22 AC 21 ms
5,376 KB
testcase_23 AC 25 ms
5,376 KB
testcase_24 AC 12 ms
5,376 KB
testcase_25 AC 68 ms
10,556 KB
testcase_26 AC 48 ms
6,724 KB
testcase_27 AC 70 ms
10,636 KB
testcase_28 AC 60 ms
9,964 KB
testcase_29 AC 52 ms
6,984 KB
testcase_30 AC 13 ms
5,376 KB
testcase_31 AC 30 ms
5,376 KB
testcase_32 AC 69 ms
10,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;
void main(){
  auto input = readln.chomp.split.to!(int[]);
  int k = input[1];
  int[] a = readln.chomp.split.to!(int[]);
  int c = 0;
  foreach(x; a.sort){
    if(x > k) break;
    k -= x;
    c++;
  }
  writefln("%d %d", c, k);
}
0