QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#888224#795. Cloud ComputingI_love_Riley_Andersen#0 0ms3712kbC++172.4kb2025-02-08 00:43:122025-02-08 00:43:13

Judging History

This is the latest submission verdict.

  • [2025-02-08 00:43:13]
  • Judged
  • Verdict: 0
  • Time: 0ms
  • Memory: 3712kb
  • [2025-02-08 00:43:12]
  • Submitted

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));}
con mxN = 2e3 + 3;

vector<tuple<int,int,int>> comps;
vector<tuple<int,int,int>> ordrs;

int dp[mxN][mxN];

int N, M;

int go(int i, int j){
    if (i == N || j == M) {
        return 0;
    }

    if (0 == dp[i][j]){
        auto& [c, f, v] = comps[i];
        auto& [C, F, V] = ordrs[i];

        if (f >= F){
            cout << i << ' ' << j << ' ' << V - v << endl;
            SMAX(dp[i][j], go(i + 1, j + 1) + V - v);
        }

        SMAX(dp[i][j], go(i + 1, j));
        SMAX(dp[i][j], go(i, j + 1));
    }

    return dp[i][j];
}

int main(){
    cin >> N;

    F0R (i, N){
        int c, f, v;
        cin >> c >> f >> v;

        comps.emplace_back(c, f, v);
    }

    cin >> M;

    F0R (i, M){
        int C, F, V;
        cin >> C >> F >> V;

        ordrs.emplace_back(C, F, V);
    }

    cout << go(0, 0) << endl;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

1
3 3253 744
1
1 2012 798

output:

0 0 54
54

result:

wrong answer 1st lines differ - expected: '54', found: '0 0 54'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Wrong Answer

Test #18:

score: 0
Wrong Answer
time: 0ms
memory: 3712kb

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:

0 0 1073
3 1 1574
5 2 4203
8 3 1541
9 4 764
10 5 1745
10 6 1745
10 7 1745
10 8 1745
10 9 1745
10 10 1745
10 11 1745
10 12 1745
10 13 1745
10 14 1745
10 15 1745
10 16 1745
10 17 1745
10 4 1745
9 5 764
9 6 764
9 7 764
9 8 764
9 9 764
9 10 764
9 11 764
9 12 764
9 13 764
9 14 764
9 15 764
9 16 764
9 17 ...

result:

wrong answer 1st lines differ - expected: '23934', found: '0 0 1073'

Subtask #4:

score: 0
Wrong Answer

Test #26:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

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:

0 0 1299
1 1 2323
2 2 1186
3 3 -747
4 4 732
5 5 1925
6 5 0
7 5 0
8 5 -1138
5 4 1925
6 5 0
7 5 0
8 5 -1138
6 4 0
7 5 0
8 5 -1138
7 4 0
8 5 -1138
8 4 -1138
8 5 -1138
7 5 0
8 5 -1138
6 5 0
7 5 0
8 5 -1138
4 5 732
4 3 732
5 3 1925
6 4 0
7 5 0
8 5 -1138
7 4 0
8 5 -1138
8 4 -1138
8 5 -1138
7 5 0
8 5 -1138...

result:

wrong answer 1st lines differ - expected: '17705', found: '0 0 1299'

Subtask #5:

score: 0
Wrong Answer

Test #34:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

4
43 2536 1
48 2001 1
49 3407 1
48 3778 1
2
42 3314 1
43 3073 1

output:

2 0 32
3 1 5
3 0 5
2 1 32
37

result:

wrong answer 1st lines differ - expected: '0', found: '2 0 32'

Subtask #6:

score: 0
Skipped

Dependency #1:

0%