QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#287605 | #7964. 转化 | ScapeGoatTree | WA | 252ms | 26964kb | C++14 | 1.2kb | 2023-12-20 20:12:33 | 2023-12-20 20:12:33 |
Judging History
answer
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/hash_policy.hpp>
#include<ext/pb_ds/trie_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>
#define int long long
char freadgetchar(){
static char buf[100000],*p1=buf,*p2=buf;
if(p1==p2){
p2=(p1=buf)+fread(buf,1,100000,stdin);
if (p1==p2)return EOF;
}
return *p1++;
}
void read(int&x){
static char c;
c=freadgetchar();
int b=1;
for(x=0;!(c>='0'&&c<='9');c=freadgetchar()) if(c=='-') b=-b;
for(;c>='0'&&c<='9';x=x*10+c-'0',c=freadgetchar());x*=b;
}
const int MAXN=4e6+5;
int a[MAXN],b[MAXN],c[MAXN];
int maxa[MAXN],maxb[MAXN];
int suma=0,sumb;
int n;
signed main(){
std::cin>>n;
for(int i=1;i<=n;i++){
std::cin>>a[i];
}
for(int i=1;i<=n;i++)std::cin>>b[i];
for(int i=1;i<=n;i++)std::cin>>c[i];
for(int i=1;i<=n;i++){
if(a[i]!=0)maxa[i]=a[i]+c[i];
maxb[i]=std::min(maxa[i],b[i]);
suma+=maxa[i];
sumb+=maxb[i];
}
for(int i=1;i<=n;i++){
std::cout<<maxa[i]+sumb-maxb[i]<<' ';
}
std::cout<<'\n'<<suma;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 252ms
memory: 26964kb
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:
42482492819203 42482492819203 42482492819203 42482502170700 42482492819203 42482492819203 42482548571563 42482492819203 42482864801662 42482492819203 42482492819203 42482492819203 42482492819203 42482492819203 42482492819203 42482687628444 42482570776928 42482492819203 42482651991328 42482492819203 ...
result:
wrong answer 1st lines differ - expected: '60073965049724 60073472376204 ...4 60073701685447 60073472376204', found: '42482492819203 42482492819203 ... 42482492819203 42482492819203 '