QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#311144#7944. Max Minus MinOlegSmacWA 1ms3728kbC++201.2kb2024-01-21 23:09:572024-01-21 23:09:57

Judging History

你现在查看的是最新测评结果

  • [2024-01-21 23:09:57]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3728kb
  • [2024-01-21 23:09:57]
  • 提交

answer

#include<bits/stdc++.h>
#include<fstream>

using namespace std;

#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")

using ll = long long;
#define pb push_back
#define pr pair<ll, ll>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

ll mod = 1e9 + 7;
ll inf = 1e18;

void largestSum (vector<ll> Arr, int n)
{
    int max_sum = Arr[0];
    int curr_sum = 0;
    for (int i=0;i<n;i++)
    {
        curr_sum = curr_sum + Arr[i];
        if(curr_sum >= max_sum)
        {
                max_sum = curr_sum;
        }
        if(curr_sum < 0 )
        {
            curr_sum = 0;
        }
    }
    cout<<max_sum<<" ";
}


void solution() {
    ll n, k;
    cin >> n >> k;
    vector<ll> nums(n);
    for (ll i = 0; i < n; i++) {
        cin >> nums[i];
    }

    valarray<ll> subsequence_sums(k, 0);
    vector<ll> arr_to_subsequence;
    for (ll num : nums) {
        if (num == 1) {

        }
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll T = 1;
    //cin >> T;

    for (ll t = 0; t < T; t++) {
        solution();
    }

    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3728kb

input:

4
3
42 42 42
4
1 2 2 1
5
1 100 1 100 1
6
1 2 3 4 5 6

output:


result:

wrong answer Answer contains longer sequence [length = 4], but output contains 0 elements