QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#354142#3054. Surface Area of CubesKevin5307WA 1ms3780kbC++20583b2024-03-14 22:27:552024-03-14 22:27:56

Judging History

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

  • [2024-03-14 22:27:56]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3780kb
  • [2024-03-14 22:27:55]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	map<array<int,3>,int> Mp;
	int a,b,c;
	cin>>a>>b>>c;
	ll ans=2ll*a*b+2ll*b*c+2ll*a*c;
	int n;
	cin>>n;
	while(n--)
	{
		int x,y,z;
		cin>>x>>y>>z;
		for(int dx=-1;dx<=1;dx+=2)
		for(int dy=-1;dy<=1;dy+=2)
		for(int dz=-1;dz<=1;dz+=2)
		{
			int nx=x+dx,ny=y+dy,nz=z+dz;
			if(nx<0||ny<0||nz<0||nx>=a||ny>=b||nz>=c||Mp[{nx,ny,nz}])
				ans--;
			else
				ans++;
		}
		Mp[{x,y,z}]=1;
	}
	cout<<ans<<endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3780kb

input:

2 2 2 1
0 0 0

output:

18

result:

wrong answer 1st lines differ - expected: '24', found: '18'