ログイン
新規登録
AtsuoCoder Waseda Tour Finals 2025
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 f5173f7b-3ab1-4086-b9f0-fe432696579d
コード
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; ll h; cin>>n>>m>>h; vector<int>d(n),t(n); for(int i=0;i<n;i++) cin>>d[i]>>t[i]; int ans=1e9+1; for(int S=0;S<1<<n;S++){ int mx=0,cnt=0; ll sum=0; for(int i=0;i<n;i++){ if(S>>i&1){ cnt++; mx=max(mx,t[i]); sum+=d[i]; } } if(cnt==m&&sum<=h) ans=min(ans,mx); } if(ans==1e9+1) cout<<-1<<endl; else cout<<ans<<endl; }
結果
問題
点数
言語
結果
実行時間
メモリ
G - Contest
0
C++
CE
コンパイルエラー
Main.cpp: In function 'int main()': Main.cpp:5:5: error: 'll' was not declared in this scope 5 | ll h; | ^~ Main.cpp:6:16: error: 'h' was not declared in this scope 6 | cin>>n>>m>>h; | ^ Main.cpp:13:11: error: expected ';' before 'sum' 13 | ll sum=0; | ^~~~ | ; Main.cpp:18:17: error: 'sum' was not declared in this scope 18 | sum+=d[i]; | ^~~ Main.cpp:21:20: error: 'sum' was not declared in this scope 21 | if(cnt==m&&sum<=h) | ^~~
テストセット
セット名
点数
結果
実行時間
メモリ
ケース
テストケース
ケース名
結果
実行時間
メモリ