QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#311144 | #7944. Max Minus Min | OlegSmac | WA | 1ms | 3728kb | C++20 | 1.2kb | 2024-01-21 23:09:57 | 2024-01-21 23:09:57 |
Judging History
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