Submission #00121
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | #include<deque> #include<queue> #include<vector> #include<algorithm> #include<iostream> #include<set> #include<cmath> #include<tuple> #include<string> #include<chrono> #include<functional> #include<iterator> #include<random> #include<unordered_set> #include<array> #include<map> #include<iomanip> #include<assert.h> #include<bitset> #include<stack> #include<memory> using namespace std; using namespace std::chrono; typedef long long int llint; typedef double lldo; #define mp make_pair #define mt make_tuple #define pub push_back #define puf push_front #define pob pop_back #define pof pop_front #define fir first #define sec second #define res resize #define ins insert #define era erase /* cout<<fixed<<setprecision(20); cin.tie(0); ios::sync_with_stdio(false); */ const llint mod=1000000007; const llint big=2.19e15+1; const long double pai=3.141592653589793238462643383279502884197; const long double eps=1e-15; template < class T, class U> bool mineq(T& a,U b){ if (a>b){a=b; return true ;} return false ;} template < class T, class U> bool maxeq(T& a,U b){ if (a<b){a=b; return true ;} return false ;} llint gcd(llint a,llint b){ if (a%b==0){ return b;} else return gcd(b,a%b);} llint lcm(llint a,llint b){ if (a==0){ return b;} return a/gcd(a,b)*b;} template < class T> void SO(T& ve){sort(ve.begin(),ve.end());} template < class T> void REV(T& ve){reverse(ve.begin(),ve.end());} template < class T>llint LBI(vector<T>&ar,T in){ return lower_bound(ar.begin(),ar.end(),in)-ar.begin();} template < class T>llint UBI(vector<T>&ar,T in){ return upper_bound(ar.begin(),ar.end(),in)-ar.begin();} int main( void ){ cin.tie(0); ios::sync_with_stdio( false ); int n,m,L,i,j;cin>>n>>m>>L; int dp[10000]={0}; for (i=1;i<=n;i++){ int m,h;cin>>m>>h; for (j=m;j<L;j++){maxeq(dp[j],dp[j-m]+h);} } cout<<dp[L-1]<<endl; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0008 - 試食 |
ユーザー名 | WA_TLE |
投稿日時 | 2018-11-24 14:38:06 |
言語 | C++17 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 1858 Byte |
最大実行時間 | 30 ms |
最大メモリ使用量 | 700 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 400 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
input01.in | WA | 28 ms | 600 KB |
1
|
input02.in | WA | 19 ms | 400 KB |
1
|
input03.in | WA | 19 ms | 452 KB |
1
|
input04.in | WA | 23 ms | 500 KB |
1
|
input05.in | AC | 23 ms | 548 KB |
1
|
input06.in | WA | 24 ms | 596 KB |
1
|
input07.in | WA | 24 ms | 648 KB |
1
|
input08.in | WA | 25 ms | 700 KB |
1
|
input09.in | WA | 24 ms | 624 KB |
1
|
input10.in | AC | 30 ms | 552 KB |
1
|
input11.in | WA | 21 ms | 472 KB |
1
|
input12.in | WA | 25 ms | 520 KB |
1
|
input13.in | WA | 23 ms | 700 KB |
1
|
input14.in | WA | 26 ms | 620 KB |
1
|
input15.in | WA | 22 ms | 672 KB |
1
|
input16.in | WA | 22 ms | 588 KB |
1
|
input17.in | WA | 18 ms | 632 KB |
1
|
input18.in | WA | 25 ms | 548 KB |
1
|
input19.in | WA | 25 ms | 600 KB |
1
|
input20.in | WA | 25 ms | 648 KB |
1
|
sample.in | AC | 24 ms | 700 KB |
1
|