結果

問題 No.2424 Josouzai
ユーザー laneguelanegue
提出日時 2023-08-18 21:07:14
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 244 bytes
コンパイル時間 5,373 ms
コンパイル使用メモリ 210,252 KB
実行使用メモリ 13,368 KB
最終ジャッジ日時 2023-08-18 21:07:31
合計ジャッジ時間 5,030 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 20 ms
6,460 KB
testcase_05 AC 67 ms
11,500 KB
testcase_06 AC 62 ms
12,900 KB
testcase_07 AC 62 ms
12,908 KB
testcase_08 AC 64 ms
11,908 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 11 ms
6,484 KB
testcase_11 AC 33 ms
13,368 KB
testcase_12 AC 23 ms
7,240 KB
testcase_13 AC 20 ms
6,284 KB
testcase_14 AC 34 ms
7,000 KB
testcase_15 AC 6 ms
4,376 KB
testcase_16 AC 56 ms
12,360 KB
testcase_17 AC 15 ms
4,824 KB
testcase_18 AC 17 ms
6,160 KB
testcase_19 AC 28 ms
7,008 KB
testcase_20 AC 64 ms
12,292 KB
testcase_21 AC 43 ms
7,300 KB
testcase_22 AC 20 ms
7,076 KB
testcase_23 AC 26 ms
6,744 KB
testcase_24 AC 11 ms
6,492 KB
testcase_25 AC 58 ms
11,884 KB
testcase_26 AC 43 ms
7,504 KB
testcase_27 AC 63 ms
12,720 KB
testcase_28 AC 53 ms
12,052 KB
testcase_29 AC 47 ms
7,876 KB
testcase_30 AC 12 ms
4,516 KB
testcase_31 AC 28 ms
7,244 KB
testcase_32 AC 62 ms
12,752 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