提出番号 | 2169 |
---|---|

提出者 | Laika. |

言語 | C++ |

提出日時 | 2018-08-23 06:28:10 |

問題名 | (68)単位 |

結果 | AC |

点数 | 100% |

テストケース | 結果 | 得点 | 実行時間 | メモリ使用量 |
---|---|---|---|---|

1 | AC | 100% | 1ms | 8096KB |

2 | AC | 100% | 2ms | 8096KB |

3 | AC | 100% | 2ms | 8128KB |

4 | AC | 100% | 2ms | 7248KB |

5 | AC | 100% | 2ms | 8080KB |

6 | AC | 100% | 2ms | 7792KB |

7 | AC | 100% | 2ms | 8432KB |

8 | AC | 100% | 1ms | 8272KB |

9 | AC | 100% | 2ms | 8160KB |

10 | AC | 100% | 2ms | 8432KB |

11 | AC | 100% | 2ms | 7968KB |

12 | AC | 100% | 2ms | 8096KB |

13 | AC | 100% | 2ms | 8160KB |

14 | AC | 100% | 2ms | 7648KB |

15 | AC | 100% | 2ms | 7920KB |

16 | AC | 100% | 2ms | 7792KB |

17 | AC | 100% | 2ms | 8352KB |

18 | AC | 100% | 2ms | 8048KB |

19 | AC | 100% | 2ms | 7552KB |

20 | AC | 100% | 2ms | 8064KB |

21 | AC | 100% | 2ms | 7984KB |

22 | AC | 100% | 1ms | 8336KB |

23 | AC | 100% | 2ms | 8720KB |

24 | AC | 100% | 2ms | 7520KB |

25 | AC | 100% | 2ms | 8432KB |

26 | AC | 100% | 2ms | 7520KB |

27 | AC | 100% | 2ms | 8192KB |

28 | AC | 100% | 2ms | 8336KB |

29 | AC | 100% | 2ms | 8032KB |

30 | AC | 100% | 2ms | 8480KB |

31 | AC | 100% | 2ms | 7552KB |

32 | AC | 100% | 2ms | 8704KB |

33 | AC | 100% | 5ms | 8336KB |

34 | AC | 100% | 2ms | 8416KB |

35 | AC | 100% | 2ms | 8384KB |

36 | AC | 100% | 2ms | 8384KB |

37 | AC | 100% | 2ms | 8160KB |

38 | AC | 100% | 2ms | 7808KB |

39 | AC | 100% | 2ms | 7920KB |

40 | AC | 100% | 2ms | 8416KB |

41 | AC | 100% | 2ms | 8080KB |

42 | AC | 100% | 2ms | 8432KB |

43 | AC | 100% | 2ms | 8080KB |

44 | AC | 100% | 2ms | 8432KB |

45 | AC | 100% | 1ms | 8112KB |

46 | AC | 100% | 2ms | 7248KB |

47 | AC | 100% | 2ms | 8736KB |

48 | AC | 100% | 1ms | 7504KB |

49 | AC | 100% | 2ms | 7904KB |

50 | AC | 100% | 1ms | 8352KB |

51 | AC | 100% | 1ms | 8736KB |

52 | AC | 100% | 2ms | 8192KB |

53 | AC | 100% | 2ms | 8080KB |

54 | AC | 100% | 1ms | 8480KB |

55 | AC | 100% | 2ms | 8400KB |

56 | AC | 100% | 2ms | 8400KB |

57 | AC | 100% | 1ms | 8480KB |

58 | AC | 100% | 2ms | 8448KB |

59 | AC | 100% | 2ms | 8384KB |

60 | AC | 100% | 2ms | 8080KB |

```
#include <bits/stdc++.h>
using namespace std;
//repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define euc_dis(x, y) sqrt(x*x + y*y)
#define pb push_back
#define mp make_pair
#define INF 999999999
#define MOD 1000000007
#define sp ' '
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
//typedef
typedef long long ll;
typedef pair<int, int> pint;
typedef map<int, int> mint;
typedef vector<int> vint;
typedef vector<char> vchr;
typedef vector<long long> vll;
typedef vector<string> vstr;
int mod(int a, int b){return (a%b+b)%b;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll a, ll b){ll ans=1; rep(i, b){ans=ans*a%MOD;} return ans;}
template<typename T>
void ppp(T n){cout << n << endl;}
template<typename T>
void dpp(T n){cerr << n << endl;}
template<typename T>
void vpp(T a){rep(i,a.size()){cout << a[i] << endl;}}
template<typename T>
void vdp(T a){rep(i,a.size()){cerr << a[i] << endl;}}
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int ddx[8] = {1,0,-1,0,1,-1,-1,1};
const int ddy[8] = {0,1,0,-1,1,1,-1,-1};
template < typename T > std::string to_string( const T& n )
{
std::ostringstream stm ;
stm << n ;
return stm.str() ;
}
vector<string> split(const string &str, char sep)
{
vector<string> v;
stringstream ss(str);
string buffer;
while( getline(ss, buffer, sep) ) {
v.pb(buffer);
}
return v;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n, m;
cin >> n >> m;
vint a(n);
rep(i, n){
cin >> a[i];
}
sort(ALL(a), greater<int>());
int tani = 0;
int cnt = 0;
rep(i, n){
if(tani >= m) break;
tani += a[i];
cnt++;
}
ppp(cnt);
return 0;
}
```