結果
| 問題 |
No.2424 Josouzai
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-18 21:07:20 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 448 bytes |
| コンパイル時間 | 1,876 ms |
| コンパイル使用メモリ | 171,012 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-28 04:50:54 |
| 合計ジャッジ時間 | 3,745 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 32 WA * 1 |
ソースコード
#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);
REP(i,N) cin >> a[i];
sort(a.begin(),a.end());
int s=0;
REP(i,N){
if(K-a[i]>=0){
K-=a[i];
}else{
cout << i << ' ' << K << endl;
return 0;
}
}
return 0;
}