QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#715643#7964. 转化sdmrlh#WA 78ms17768kbC++141.3kb2024-11-06 12:51:122024-11-06 12:51:12

Judging History

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

  • [2024-11-06 12:51:12]
  • 评测
  • 测评结果:WA
  • 用时:78ms
  • 内存:17768kb
  • [2024-11-06 12:51:12]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define sf(x) scanf("%lld",&x)
#define sff(x,y) scanf("%lld%lld",&x,&y)
#define endl '\n'
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pf(x) printf("%lld",x)
#define pii pair<int,int> 
#define f first 
#define s second
#define int long long



//
const int N = 1e6+10;
int ss;
int res=0;
int a[N],b[N],c[N];
//
//


void solve()
{
	int m;
	cin>>m;
	
	for(int i=1;i<=m;i++) cin>>a[i];
	for(int i=1;i<=m;i++) cin>>b[i];
	for(int i=1;i<=m;i++) cin>>c[i];
	vector<int> ab,bc;
	int sum=0,res1=0,res2=0;
	for(int i=1;i<=m;i++)
	{
		sum+=c[i]+a[i];
		if(a[i]&&b[i]) ab.push_back(i);
		else if(b[i]&&c[i]) bc.push_back(i);
		
	}
	
	for(auto i:ab)
		res1+=min(a[i]+c[i],b[i]);
	if(!res1){
		for(int i=1;i<m;i++) cout<<a[i]+c[i]<<" ";
			cout<<a[m]+c[m]<<endl<<sum<<endl;
		return ;
	}
	for(auto i:bc) 
		res2+=min(b[i],c[i]);
	res2-=(bc.size()-1);
	
	for(int i=1;i<=m;i++)
	{
		if(!b[i]) cout<<res1+res2+a[i]+c[i]-1;
		else 
		{
			if(a[i]) cout<<res1-min(a[i]+c[i],b[i])+res2+a[i]+c[i]-1;
			else if(!c[i]) cout<<res1+res2-1;
			else res1-1+res2-min(b[i],c[i])+1;
		}
		if(i==m) cout<<endl;
		else cout<<" ";
	}
	cout<<sum<<endl;
}
signed main()
{
	IOS;
	int _=1;
	while(_--)
		solve();
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 78ms
memory: 17768kb

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:

 60073472317480 60073472317480 60073481668977 60073472317480  60073528069840 60073472317480 60073844299939     60073472317480  60073667126721 60073550275205 60073472317480 60073631489605 60073472317480  60073472317480 60073472317480  60073472317480 60073472317480 60073472317480 60073472317480 600734...

result:

wrong answer 1st lines differ - expected: '60073965049724 60073472376204 ...4 60073701685447 60073472376204', found: ' 60073472317480 60073472317480...0073472317480 60073475862829   '