結果
| 問題 |
No.2424 Josouzai
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-18 21:16:59 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 2,000 ms |
| コード長 | 456 bytes |
| コンパイル時間 | 1,973 ms |
| コンパイル使用メモリ | 170,952 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-28 05:19:39 |
| 合計ジャッジ時間 | 3,874 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(int i=0;i<int(n);i++)
int main(void){
cin.tie(nullptr); ios_base::sync_with_stdio(false);
int i,j,k;
int N,K;
cin >> N >> K;
vector<int> a(N+1);
a[N]=1e9+7;
REP(i,N) cin >> a[i];
sort(a.begin(),a.end());
REP(i,N+1){
if(K-a[i]>=0){
K-=a[i];
}else{
cout << i << ' ' << K << endl;
return 0;
}
}
return 0;
}