QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#487139 | #7964. 转化 | lsflsf2023# | WA | 94ms | 9536kb | C++14 | 1.6kb | 2024-07-22 16:45:14 | 2024-07-22 16:45:14 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
struct Ball
{
int a, b, c;
}B[351500], C[351500];
int Min(int a, int b)
{
return a < b ? a : b;
}
int main()
{
int n;
scanf("%d", &n);
for (int i = 1 ; i <= n ; ++ i)
scanf("%d", &B[i].a);
for (int i = 1 ; i <= n ; ++ i)
scanf("%d", &B[i].b);
for (int i = 1 ; i <= n ; ++ i)
scanf("%d", &B[i].c);
long long R1 = 0, R2 = 0;
for (int i = 1 ; i <= n ; ++ i)
if (B[i].a > 0)
R1 += Min(B[i].a + B[i].c, B[i].b);
else
if (Min(B[i].b - 1, B[i].c) >= 0)
R2 += Min(B[i].b - 1, B[i].c);
bool Flag = false;
for (int i = 1 ; i <= n ; ++ i)
if (B[i].a > 0 && B[i].b > 0)
Flag = true;
for (int i = 1 ; i <= n ; ++ i)
{
if (B[i].a > 0)
R1 -= Min(B[i].a + B[i].c, B[i].b);
else
if (Min(B[i].b - 1, B[i].c) >= 0)
R2 -= Min(B[i].b - 1, B[i].c);
if (!Flag)
if (B[i].a == 0)
printf("0 ");
else
printf("%lld ", B[i].a + B[i].c);
else
printf("%lld ", B[i].a + B[i].c + R1 + R2);
if (B[i].a > 0)
R1 += Min(B[i].a + B[i].c, B[i].b);
else
if (Min(B[i].b - 1, B[i].c) >= 0)
R2 += Min(B[i].b - 1, B[i].c);
}
long long Ans = 0;
long long R = 0;
for (int i = 1 ; i <= n ; ++ i)
if (B[i].a > 0)
Ans += B[i].a + B[i].c;
else
if (Min(B[i].b - 1, B[i].c) >= 0)
R += Min(B[i].b - 1, B[i].c);
if (!Flag)
printf("\n%lld", Ans);
else
printf("\n%lld", Ans + R);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 94ms
memory: 9536kb
input:
351493 0 37836791 46095966 46912389 21595941 0 3 86568894 3 0 0 0 0 39910208 0 2 4 86885825 1 67660833 0 24488082 52447896 0 67190942 70457491 11166998 90470470 11095822 0 0 5 47222930 2 49736354 0 0 0 77339472 0 5 3 0 25347727 0 3 2 0 48844622 0 65142757 1 73733079 80634668 46683173 0 31644647 9760...
output:
60073965049724 60073472376204 60073472376204 60073481727701 60073472376204 60073788737330 60073528128564 60073472376204 60073844358663 60073784179153 60073472376204 60073472376204 60073948665985 60073472376204 60073472376204 60073667185445 60073550333929 60073472376204 60073631548329 60073472376204 ...
result:
wrong answer 2nd lines differ - expected: '90874342016986', found: '76310068900191'