QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#354142 | #3054. Surface Area of Cubes | Kevin5307 | WA | 1ms | 3780kb | C++20 | 583b | 2024-03-14 22:27:55 | 2024-03-14 22:27:56 |
Judging History
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'