QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#177390 | #7118. Closing Time | triple321# | 0 | 1ms | 4112kb | C++20 | 1.7kb | 2023-09-12 22:05:52 | 2024-04-28 07:39:44 |
Judging History
answer
#include <bits/stdc++.h>
#ifndef CYBER
#include "closing.h"
#endif
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
#define lg long long
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int max_score(int n, int x, int y, lg k, vector<int> u, vector<int> v, vector<int> w)
{
int ans = 0;
x++, y++;
lg a[n+2], b[n+2], c[n+2], d[n+2];
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
memset(c, 0, sizeof(c));
memset(d, 0, sizeof(d));
for(int i = x-1; i >= 1; i--)
{
a[i] = a[i+1]+w[i-1];
}
for(int i = y-1; i >= 1; i--)
{
c[i] = c[i+1]+w[i-1];
}
for(int i = x+1; i <= n; i++)
{
b[i] = b[i-1]+w[i-2];
}
for(int i = y+1; i <= n; i++)
{
d[i] = d[i-1]+w[i-2];
}
lg sum = 0;
vector<lg> mxm(n+2);
for(int i = x; i >= 1; i--)
{
sum += max(0ll, a[i]-mxm[i]);
mxm[i] = max(mxm[i], a[i]);
vector<lg> fake3 = mxm;
lg o3 = sum;
for(int j = x; j <= n; j++)
{
sum += max(0ll, b[j]-mxm[j]);
mxm[j] = max(mxm[j], b[j]);
vector<lg> fake2 = mxm;
lg o2 = sum;
for(int z = y; z >= 1; z--)
{
sum += max(0ll, c[z]-mxm[z]);
mxm[z] = max(mxm[z], c[z]);
lg rem = k-sum, beg = max({y, z, j, i});
int l = max({y, z, j, i}), r = n;
while(l <= r)
{
int mid = (l+r)/2;
if(d[mid]-d[beg-1] > rem)
{
r = mid-1;
}
else{
l = mid+1;
ans = max(ans, j-i+1+mid-z+1);
}
}
}
mxm = fake2;
sum = o2;
}
mxm = fake3;
sum = o3;
}
return ans;
}
详细
Subtask #1:
score: 0
Time Limit Exceeded
Test #1:
score: 0
Time Limit Exceeded
input:
cc61ad56a4797fb3f5c9529f73ce6fcedd85669b 1 200000 31011 61157 8517583098 31011 129396 964383 1655 129396 331139 1655 191487 566483 110385 191487 865248 43212 110385 542661 43212 81682 13766 81682 91774 546589 91774 124706 780638 124706 175650 118706 10421 175650 615314 10421 151953 436270 140430 151...
output:
result:
Subtask #2:
score: 0
Wrong Answer
Test #4:
score: 0
Wrong Answer
time: 1ms
memory: 4068kb
input:
cc61ad56a4797fb3f5c9529f73ce6fcedd85669b 1 50 23 25 382806473 0 1 375710 1 2 898637 2 3 10402 3 4 536577 4 5 385023 5 6 71075 6 7 543368 7 8 301497 8 9 174394 9 10 711312 10 11 923006 11 12 675532 12 13 838667 13 14 565729 14 15 979816 15 16 862618 16 17 576015 17 18 177751 18 19 306989 19 20 881492...
output:
081ce3c351cbf526b37954b9ad30f2b531a7585c OK 98
result:
wrong answer 1st lines differ - on the 1st token, expected: '96', found: '98'
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Wrong Answer
Test #36:
score: 0
Wrong Answer
time: 0ms
memory: 4112kb
input:
cc61ad56a4797fb3f5c9529f73ce6fcedd85669b 1 4 0 1 9 0 2 2 1 2 3 2 3 3
output:
081ce3c351cbf526b37954b9ad30f2b531a7585c OK 5
result:
wrong answer 1st lines differ - on the 1st token, expected: '6', found: '5'
Subtask #6:
score: 0
Skipped
Dependency #2:
0%
Subtask #7:
score: 0
Skipped
Dependency #3:
0%
Subtask #8:
score: 0
Skipped
Dependency #4:
0%
Subtask #9:
score: 0
Skipped
Dependency #1:
0%