QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#888230 | #795. Cloud Computing | I_love_Riley_Andersen# | 0 | 0ms | 4352kb | C++17 | 2.6kb | 2025-02-08 01:22:29 | 2025-02-08 01:22:29 |
Judging History
answer
#include"bits/stdc++.h"
#include"ext/pb_ds/tree_policy.hpp"
#include"ext/pb_ds/assoc_container.hpp"
using namespace std;
using namespace __gnu_pbds;
#define FOR(i,a,b)for(int i=a;i<b;i++)
#define F0R(i,a)FOR(i,0,a)
#define ROF(i,a,b)for(int i=b-1;a<=i;i--)
#define R0F(i,a)ROF(i,0,a)
#define rep(a)F0R(_,a)
#define each(a,x)for(auto&a:x)
#define all(a)begin(a),end(a)
#define sz(x)int(size(x))
#define lla(x)rbegin(x),rend(x)
#define SUM(a)accumulate(all(a),0ll)
#define SUMM(a,b)accumulate(a,a+b,0ll)
#define MAX(a)*max_element(all(a))
#define MAXX(a,b)*max_element(a,a+b)
#define MIN(a)*min_element(all(a))
#define MINN(a,b)*min_element(a,a+b)
#define con const int
#define lwb lower_bound
#define upb upper_bound
#define bry binary_search
#ifdef LOCAL
#define print(x)cout<<x;
#else
#define print(...)
#endif
#define debug(x)print(#x<<" = "<<x<<endl)
using ld=long double;
using ll=long long;
using str=string;
template<class T>using oset=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
template<class T>using omset=tree<T,null_type,less_equal<T>,rb_tree_tag,tree_order_statistics_node_update>;
template<class T>T minn(T a){return a;}
template<class T,class...Args>T minn(T a,Args... args){return min(a,minn(args...));}
template<class T>T maxx(T a){return a;}
template<class T,class...Args>T maxx(T a,Args... args){return max(a,maxx(args...));}
#define SMIN(a,b...)a=min(a,minn(b))
#define SMAX(a,b...)a=max(a,maxx(b))
void fileset(str a){assert(nullptr!=freopen((a+".in").c_str(),"r",stdin)&&nullptr!=freopen((a+".out").c_str(),"w",stdout));}
vector<tuple<int,int,int>> comps;
vector<tuple<int,int,int>> ordrs;
con mxSm = 1e5 + 5;
ll mx[mxSm];
ll mn[mxSm];
int main(){
int N;
cin >> N;
ll smN = 0;
F0R (i, N){
int c, f, v;
cin >> c >> f >> v;
comps.emplace_back(c, f, v);
smN += c;
}
int M;
cin >> M;
int smM = 0;
F0R (i, M){
int C, F, V;
cin >> C >> F >> V;
ordrs.emplace_back(C, F, V);
smM += C;
}
memset(mn, 0x3f, sizeof(mn));
mn[0] = 0;
F0R (i, N){
auto& [c, f, v] = comps[i];
ROF (j, c, smN + 1){
SMIN(mn[j], mn[j - c] + v);
}
}
F0R (i, M){
auto& [C, F, V] = ordrs[i];
ROF (j, C, smM + 1){
SMAX(mx[j], mx[j - C] + V);
}
}
ll bst = -1e18;
ll ans = 0;
F0R (i, smN){
SMAX(ans, bst - mn[i]);
SMAX(bst, mx[i]);
}
cout << ans << endl;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 4352kb
input:
1 3 3253 744 1 1 2012 798
output:
0
result:
wrong answer 1st lines differ - expected: '54', found: '0'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Wrong Answer
Test #18:
score: 0
Wrong Answer
time: 0ms
memory: 4352kb
input:
12 1 3728 3883 1 2483 1377 1 2421 2213 1 4866 648 1 2292 1737 1 4027 657 1 2119 2801 1 2559 859 1 3859 3261 1 2908 3110 1 2917 2467 1 2011 3406 18 1 2558 4956 1 3468 2947 1 4577 4082 1 2886 2222 1 2979 3572 1 2266 4860 1 2868 3183 1 3665 4259 1 2607 4802 1 2811 3874 1 2314 4212 1 2638 3152 1 2944 44...
output:
21610
result:
wrong answer 1st lines differ - expected: '23934', found: '21610'
Subtask #4:
score: 0
Wrong Answer
Test #26:
score: 18
Accepted
time: 0ms
memory: 4352kb
input:
10 2 1 2274 2 1 2524 1 1 2699 5 1 2930 4 1 1802 2 1 2734 4 1 1036 3 1 2741 5 1 1138 1 1 2132 6 5 1 3573 1 1 4847 2 1 3885 1 1 2183 2 1 2534 1 1 4659
output:
17705
result:
ok single line: '17705'
Test #27:
score: 0
Wrong Answer
time: 0ms
memory: 4352kb
input:
10 5 1 19 3 1 14 4 1 10 3 1 10 4 1 20 2 1 9 1 1 4 4 1 10 1 1 2 3 1 10 6 5 1 13 5 1 13 3 1 10 1 1 3 5 1 13 5 1 13
output:
1
result:
wrong answer 1st lines differ - expected: '4', found: '1'
Subtask #5:
score: 0
Wrong Answer
Test #34:
score: 18
Accepted
time: 0ms
memory: 4224kb
input:
4 43 2536 1 48 2001 1 49 3407 1 48 3778 1 2 42 3314 1 43 3073 1
output:
0
result:
ok single line: '0'
Test #35:
score: 0
Wrong Answer
time: 0ms
memory: 4352kb
input:
57 47 1212 1 42 1104 1 48 1247 1 44 1420 1 41 1428 1 46 1364 1 47 1245 1 40 1199 1 48 1027 1 49 1113 1 50 1439 1 45 1208 1 41 1231 1 41 1131 1 48 1080 1 43 1218 1 45 1145 1 44 1071 1 43 1393 1 47 1314 1 45 1306 1 47 1439 1 42 1124 1 49 1383 1 47 1175 1 45 1099 1 46 1378 1 45 1285 1 46 1323 1 41 1234...
output:
5
result:
wrong answer 1st lines differ - expected: '0', found: '5'
Subtask #6:
score: 0
Skipped
Dependency #1:
0%