[arc062e]Building Cubes with AtCoDeer

题意:

给出N个正方形,每个正方形正面的四个角各有一种颜色,要求组成不同的正方体的方案数。两种方案视为相同,当且仅当一个正方体可以通过各种旋转得到另一个。(方向不同也算不同方案)

$6\leq N\leq 400$

题解:

输出样例+puts("0")就可以得到40分的好成绩!

然后这是一道暴力题!

那么写个暴力就ok了!

 1 #include<algorithm>
 2 #include<iostream>
 3 #include<cstring>
 4 #include<cstdio>
 5 #include<cmath>
 6 #include<unordered_map>
 7 #include<map>
 8 using namespace std;
 9 typedef long long ________________________;
10 typedef int _________________________;
11 const ________________________ _=1000,__=1000000,___=1000000000;
12 _________________________ ____,_____[401][4];
13 unordered_map<________________________,________________________>______;
14 ________________________ _______=0,________,_________[4];
15 ________________________ __________(_________________________ __________________,_________________________ ___________________,_________________________ ____________________,_________________________ _____________________){
16     return (________________________)(__________________+___________________*_+____________________*__+_____________________*___);
17 }
18 void ____________(_________________________ __________________,_________________________ ___________________,_________________________ ____________________,_________________________ _____________________,_________________________ _______________________){
19     ______[__________(__________________,___________________,____________________,_____________________)]+=_______________________;
20     ______[__________(___________________,____________________,_____________________,__________________)]+=_______________________;
21     ______[__________(____________________,_____________________,__________________,___________________)]+=_______________________;
22     ______[__________(_____________________,__________________,___________________,____________________)]+=_______________________;
23 }
24 void _____________(________________________ ______________________,_________________________ _______________________){
25     _________________________ __________________,___________________,____________________,_____________________;
26     __________________=______________________%_,______________________/=_,___________________=______________________%_,______________________/=_,____________________=______________________%_,______________________/=_,_____________________=______________________%_,______________________/=_;
27     ____________(__________________,___________________,____________________,_____________________,_______________________);
28 }
29 _________________________ main(){
30     scanf("%d",&____);
31     for(_________________________ ______________=1;______________<=____;______________++){
32         scanf("%d%d%d%d",&_____[______________][0],&_____[______________][1],&_____[______________][2],&_____[______________][3]);
33         ____________(_____[______________][0],_____[______________][1],_____[______________][2],_____[______________][3],1);
34     }
35     for(_________________________ ______________=1;______________<____;______________++){
36         ____________(_____[______________][0],_____[______________][1],_____[______________][2],_____[______________][3],-1);
37         for(_________________________ _______________=______________+1;_______________<=____;_______________++){
38             ____________(_____[_______________][0],_____[_______________][1],_____[_______________][2],_____[_______________][3],-1);
39             for(_________________________ ________________=0;________________<4;________________++){
40                 ________=1;
41                 for(_________________________ _________________=0;_________________<4;_________________++){
42                     _________[_________________]=__________(_____[______________][_________________],_____[_______________][(________________+5-_________________)&3],_____[_______________][(________________+4-_________________)&3],_____[______________][(_________________+1)&3]);
43                 }
44                 if(!______[_________[0]]||!______[_________[1]]||!______[_________[2]]||!______[_________[3]])continue;
45                 for(_________________________ _________________=0;_________________<4;_________________++){
46                     ________*=______[_________[_________________]];
47                     _____________(_________[_________________],-1);
48                 }
49                 for(_________________________ _________________=0;_________________<4;_________________++)_____________(_________[_________________],1);
50                 _______+=________;
51             }    
52             ____________(_____[_______________][0],_____[_______________][1],_____[_______________][2],_____[_______________][3],1);
53         }
54     }
55     printf("%lld",_______);
56     return 0;
57 }

本文到此结束!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

以上是我的口胡。嗯,被这题的题解感动到语无伦次的后果。

但是题解实际上就是暴力。。。。。。注意到一个性质就是如果两个对面的正方形确定了,那么整个正方体就唯一确定了。由于n特别小,所以可以直接暴力枚举两个正方形,用map存储方案即可。注意正方形可以旋转,所以四个方向都要加入map中。

看起来很简单,但是场上只有myh过了。。。其他人大多是40$\rightarrow$_$\rightarrow$(打表出奇迹)

代码放过就不给啦!

转载于:https://www.cnblogs.com/dcdcbigbig/p/9525900.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值