QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#344780#7964. 转化knightzzz1WA 71ms7768kbC++17940b2024-03-05 10:33:432024-03-06 22:08:08

Judging History

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

  • [2024-03-06 22:08:08]
  • 管理员手动重测该提交记录
  • 测评结果:WA
  • 用时:71ms
  • 内存:7768kb
  • [2024-03-05 10:33:43]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;
using ll = long long;
const int N = 361010;
int a[N],b[N],n,c[N];

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

    cin >> n;
    for(int i = 0; i < n; ++i) cin >> a[i];
    for(int i = 0; i < n; ++i) cin >> b[i];
    for(int i = 0; i < n; ++i) cin >> c[i];

    ll s = 0, ans = 0;
    for(int i = 0; i < n; ++i){
        if(a[i]){
            s += min(a[i] + c[i], b[i]);
            ans += a[i] + c[i];
        }
    }

    for(int i = 0; i < n; ++i){
        if(a[i] == 0 && b[i] && c[i]){
            if(s){
                s--;
                s += min(b[i],c[i]);
                ans += c[i];
            }
        }
    }

    for(int i = 0; i < n; ++i){
        if(s == 0) cout << 0 << " ";
        else cout << s + c[i] << " ";
    }

    cout << "\n";
    cout << ans << "\n";

    return 0;      
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 71ms
memory: 7768kb

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:

60074220364323 60073547907436 60073484365493 60073526051104 60073752833514 60074068039886 60073746333382 60073583790982 60074057327593 60074078744624 60073481493869 60073577405536 60074117115683 60073480623570 60073720996641 60073877899468 60073688492646 60073695990858 60073921754943 60073736855759 ...

result:

wrong answer 1st lines differ - expected: '60073965049724 60073472376204 ...4 60073701685447 60073472376204', found: '60074220364323 60073547907436 ... 60073934364401 60073509290867 '