結果

問題 No.2424 Josouzai
ユーザー YugimnYugimn
提出日時 2023-09-08 06:45:22
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 630 ms / 2,000 ms
コード長 796 bytes
コンパイル時間 6,225 ms
コンパイル使用メモリ 308,080 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-08 06:45:53
合計ジャッジ時間 29,785 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 522 ms
4,380 KB
testcase_01 AC 519 ms
4,380 KB
testcase_02 AC 525 ms
4,376 KB
testcase_03 AC 520 ms
4,376 KB
testcase_04 AC 523 ms
4,376 KB
testcase_05 AC 629 ms
4,380 KB
testcase_06 AC 615 ms
4,388 KB
testcase_07 AC 630 ms
4,380 KB
testcase_08 AC 601 ms
4,384 KB
testcase_09 AC 538 ms
4,376 KB
testcase_10 AC 507 ms
4,384 KB
testcase_11 AC 575 ms
4,376 KB
testcase_12 AC 546 ms
4,384 KB
testcase_13 AC 543 ms
4,380 KB
testcase_14 AC 562 ms
4,384 KB
testcase_15 AC 530 ms
4,376 KB
testcase_16 AC 591 ms
4,388 KB
testcase_17 AC 517 ms
4,376 KB
testcase_18 AC 521 ms
4,384 KB
testcase_19 AC 548 ms
4,380 KB
testcase_20 AC 586 ms
4,376 KB
testcase_21 AC 573 ms
4,384 KB
testcase_22 AC 528 ms
4,380 KB
testcase_23 AC 535 ms
4,388 KB
testcase_24 AC 542 ms
4,384 KB
testcase_25 AC 593 ms
4,380 KB
testcase_26 AC 604 ms
4,380 KB
testcase_27 AC 607 ms
4,380 KB
testcase_28 AC 617 ms
4,380 KB
testcase_29 AC 586 ms
4,384 KB
testcase_30 AC 537 ms
4,380 KB
testcase_31 AC 547 ms
4,376 KB
testcase_32 AC 624 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//Normal-2

#define _GLIBCXX_DEBUG
#define ll long long
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

void p(auto a){
  cout << a;
}

void ps(auto a){
  cout << a << " ";
}

void ps(){
  cout << " ";
}

void pl(auto a){
  cout << a << endl;
}

void pl(){
  cout << endl;
}

void fix15(){
  cout << fixed << setprecision(15);
}

void YES(){
  pl("YES");
}

void NO(){
  pl("NO");
}

void Yes(){
  pl("Yes");
}

void No(){
  pl("No");
}

void yes(){
  pl("yes");
}

void no(){
  pl("no");
}

//Normal-2
int main(){
  int N, K; cin >> N >> K;

  vector<int> X(3e5, 1e9+1);
  for(int i = 0; i < N; i++) cin >> X[i];

  sort(X.begin(), X.end());
  for(int i = 0; i <= N; i++){
    if(K < X[i]){
      ps(i);
      pl(K);

      return 0;
    }

    K -= X[i];
  }
}
0