2014鞍山区域赛(简单几何+polya)HDU5080

Colorful Toy

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 171    Accepted Submission(s): 65


Problem Description
A toy is made up of N vertices and M undirected edges in the 2D plane. As usual, you want to know how many ways there are to color the vertices of the toy. You have totally C colors. And of course, to make things fun, you think that if one color configuration can be rotated to get another, these two configurations should be considered the same. Rotation means 2D in-plane rotation and reflection is not considered as rotation.


For instance, consider coloring the following toy with 2 colors. The coordinates of the vertices are:

1. (0,0)
2. (1,0)
3. (0,1)
4. (-1,0)
5. (0,-1)

The toy has 6 edges: (1,2), (1,3), (2,3), (3,4), (4,5), (5,2).

As a 2D being, this toy has no symmetry. So there are 32 ways to color it. Had the first two edges been removed, there would be only 12 different ways.

You should output the answer modulo 10 9 + 7.
 

Input
The first line contains an integer T (T ≤ 20) denoting the number of the test cases.

Each test case begins with three positive integers N (1 ≤ N ≤ 50), M (0 ≤ M ≤ N (N - 1)/2) and C(1 ≤ C ≤ 100).

Then follow N lines. Each line contains 2 integers in range [-10000,10000] describing a vertex.

Then follow M lines. Each line contains 2 integers in range [1,N] representing an edge. There are neither duplicate edges nor self-loops.
 

Output
For each test case, output one line containing the answer.
 

Sample Input
   
   
2 5 6 2 0 0 1 0 0 1 -1 0 0 -1 1 2 1 3 2 3 3 4 4 5 5 2 5 4 2 0 0 1 0 0 1 -1 0 0 -1 2 3 3 4 4 5 5 2
 

Sample Output
   
   
32 12

题意:RT

思路:找出置换群,然后polya计数

           可以先将所有的点按极角排序,然后按顺序枚举旋转的角度,判断一下所有点是否重合以及边是否重合

           如果都满足就可以找出置换中的循环数量,然后polya计数,可以参考算法竞赛入门经典训练指南144-146页

#include 
   
   
    
    
#include 
    
    
     
     
#include 
     
     
      
      
#include 
      
      
       
       
#include 
       
       
         #include 
        
          #include 
         
           using namespace std; const int MOD = (int)(1e9+7); const int MAXN = 55; const double eps = 1e-8; typedef __int64 ll; int cmp(double x){ if(fabs(x) 
          
            x-a.x,this->y-a.y); double Cos=cos(angle); double Sin=sin(angle); point an(a.x+Cos*c.x-Sin*c.y , a.y+Sin*c.x+Cos*c.y); return an; } }; point P[MAXN],center; int edge[MAXN][MAXN]; int next[MAXN]; int n; vector 
           
             q; bool cmp1(int a,int b) { if(cmp(P[a].jiao-P[b].jiao)==0) return P[a].dis(center) 
            
              =MOD)x-=MOD; return x; } int main() { int t; scanf("%d",&t); while(t--){ int m,c; scanf("%d%d%d",&n,&m,&c); memset(edge,0,sizeof(edge)); for(int i=1;i<=n;i++){ int x,y; scanf("%d%d",&x,&y); P[i].x=x; P[i].y=y; } for(int i=0;i 
              
             
            
           
          
         
       
      
      
     
     
    
    
   
   
内容概要:文章详细介绍了HarmonyOS的目录结构及其重要性,从整体框架到核心目录的具体功能进行了全面剖析。HarmonyOS凭借其分布式架构和跨设备协同能力迅速崛起,成为全球操作系统领域的重要力量。文章首先概述了HarmonyOS的背景和发展现状,强调了目录结构对开发的重要性。接着,具体介绍了根目录文件、AppScope、entry和oh_modules等核心目录的功能和作用。例如,AppScope作为全局资源配置中心,存放应用级的配置文件和公共资源;entry目录是应用的核心入口,负责源代码和界面开发。此外,文章还对比了HarmonyOS与Android、iOS目录结构的异同,突出了HarmonyOS的独特优势。最后,通过旅游应用和电商应用的实际案例,展示了HarmonyOS目录结构在资源管理和代码组织方面的应用效果。; 适合人群:具备一定编程基础,尤其是对移动操作系统开发感兴趣的开发者,包括初学者和有一定经验的研发人员。; 使用场景及目标:①帮助开发者快速理解HarmonyOS的目录结构,提高开发效率;②为跨设备应用开发提供理论和技术支持;③通过实际案例学习资源管理和代码组织的最佳实践。; 其他说明:HarmonyOS的目录结构设计简洁明了,模块职责划分明确,有助于开发者更好地管理和组织代码和资源。随着万物互联时代的到来,HarmonyOS有望在开发便利性和生态建设方面取得更大进展,吸引更多开发者加入其生态系统。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值