結果
| 問題 | No.3634 Made to order |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-21 22:23:46 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,549 bytes |
| 記録 | |
| コンパイル時間 | 3,047 ms |
| コンパイル使用メモリ | 263,816 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-21 22:23:53 |
| 合計ジャッジ時間 | 6,287 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| サブタスク $1$ | 20 % | AC * 8 |
| サブタスク $2$ | 10 % | AC * 16 WA * 5 |
| サブタスク $3$ | 70 % | AC * 21 WA * 5 |
| 合計 | 3 * 20% = 60 点 |
ソースコード
#include <iostream>
#include <ranges>
#include <algorithm>
#include <vector>
using namespace std;
using ll=long long;
#include <atcoder/all>
using mint=atcoder::modint998244353;
ostream& operator<<(ostream& os,mint& x){
os<<x.val();
return os;
}
istream& operator>>(istream& is,mint& x){
int t;
is>>t;
x=t;
return is;
}
template <typename S,typename T>
ostream& operator<<(ostream& os,const pair<S,T>& p);
template <typename S,typename T>
istream& operator>>(istream& is,pair<S,T>& p);
template <typename T,size_t n>
ostream& operator<<(ostream& os,const array<T,n>& arr);
template <typename T,size_t n>
istream& operator>>(istream& is,array<T,n>& arr);
template <typename T>
ostream& operator<<(ostream& os,const vector<T>& vec);
template <typename T>
istream& operator>>(istream& is,vector<T>& vec);
template <typename S,typename T>
ostream& operator<<(ostream& os,pair<S,T>& p){
os<<p.first<<" "<<p.second;
return os;
}
template <typename S,typename T>
istream& operator>>(istream& is,pair<S,T>& p){
is>>p.first>>p.second;
return is;
}
template <typename T,size_t n>
ostream& operator<<(ostream& os,array<T,n>& arr){
for(int i=0;i<n;i++)os<<arr[i]<<(i+1==n?"":" ");
return os;
}
template <typename T,size_t n>
istream& operator>>(istream& is,array<T,n>& arr){
for(int i=0;i<n;i++)is>>arr[i];
return is;
}
template <typename T>
ostream& operator<<(ostream& os,vector<T>& vec){
for(int i=0;i<vec.size();i++)os<<vec[i]<<(i+1==vec.size()?"":" ");
return os;
}
template <typename T>
istream& operator>>(istream& is,vector<T>& vec){
for(int i=0;i<vec.size();i++)is>>vec[i];
return is;
}
template <typename T>
vector<T> make_unique(vector<T> vec){
ranges::sort(vec);
vec.erase(unique(vec.begin(),vec.end()),vec.end());
return vec;
}
template <typename T>
vector<int> make_rank(vector<T> vec){
int n=vec.size();
vector<int> res(n);
iota(res.begin(),res.end(),0);
ranges::sort(vec,{},[&](int i)->T{
return vec[i];
});
return res;
}
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n,d;
cin>>n>>d;
vector<array<ll,3>> dp(1<<n,array<ll,3>({(ll)1e5,(ll)1e5,(ll)1e5}));
dp[0]={0ll,0ll,0ll};
vector<array<ll,3>> abc(n);
cin>>abc;
for(int i=0;i<(1<<n);i++){
//cout<<i<<" "<<dp[i]<<endl;
for(int j=0;j<n;j++){
if(i>>j&1)continue;
auto res=dp[i];
res[0]+=abc[j][0];
res[1]=max(res[0],res[1])+abc[j][1];
res[2]=max(res[1],res[2])+abc[j][2];
dp[i+(1<<j)]=min(dp[i+(1<<j)],res);
}
}
//cout<<dp[(1<<n)-1]<<endl;
if(dp[(1<<n)-1][2]<=d)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}