Zhu and 772002
来源:互联网 发布:淘宝产品图片尺寸留白 编辑:程序博客网 时间:2024/05/29 18:12
Zhu and 772002
Problem Description
Zhu and 772002 are both good at math. One day, Zhu wants to test the ability of 772002, so he asks 772002 to solve a math problem.
But 772002 has a appointment with his girl friend. So 772002 gives this problem to you.
There are n numbers a1,a2,…,an. The value of the prime factors of each number does not exceed 2000, you can choose at least one number and multiply them, then you can get a number b.
How many different ways of choices can make b is a perfect square number. The answer maybe too large, so you should output the answer modulo by 1000000007.
Input
First line is a positive integer T , represents there are T test cases.
For each test case:
First line includes a number n(1≤n≤300),next line there are n numbers a1,a2,…,an,(1≤ai≤1018).
Output
For the i-th test case , first output Case #i: in a single line.
Then output the answer of i-th test case modulo by 1000000007.
Sample Input
2
3
3 3 4
3
2 2 2
Sample Output
Case #1:
3
Case #2:
3
#include <stdio.h>int main(int argc, char *argv[]){ long int num[26],i,t,temp,sum,n; char str[100009],*p; scanf("%ld",&t); n=1; while(t--) { scanf("%s",str); p=str; sum=0; for(i=0;i<26;i++) { num[i]=0; } while(*p!='\0') { temp=*p-97; if(num[temp]==0) { num[temp]=1; } p++; } for(i=0;i<26;i++) { sum=sum+num[i]; } printf("Case #%ld: %ld\n",n,sum); n++; } return 0;}
- Zhu and 772002
- Zhu and 772002
- hdu5833 Zhu and 772002
- Zhu and 772002
- hdu5833 Zhu and 772002
- Zhu and 772002
- Zhu and 772002 HDU
- Zhu and 772002 HDU
- HDU 5833 Zhu and 772002
- HDU 5833 Zhu and 772002
- HDU 5833 Zhu and 772002
- hdu 5833 Zhu and 772002
- HDU-5833-Zhu and 772002
- Hdu-5833 Zhu and 772002(高斯消元)
- hdu 5833 Zhu and 772002(高斯消元)
- HDU 5833 Zhu and 772002 (高斯消元)
- HDU 5833 Zhu and 772002 (高斯求元)
- HDU 5833 Zhu and 772002 (高斯消元)
- poj-3159【差分约束+Dijkstra算法的优化】
- 排序总结系列二:直接插入排序
- 双向链表的Java实现,以及相关函数的实现
- 【工控安全产品】工业控制系统信息安全检查工具箱
- [Android]XML和JSON的区别
- Zhu and 772002
- 某个个人公众号阅读量和点赞数分析
- Http协议详解
- 在ubuntu中添加widows启动项的简单方法
- C++ 模板类
- android快速开发框架,集成了底部tab键切换界面、toolbar、沉浸式状态栏、BaseActivity、BaseAdapter、BaseFragment等
- Java可变参数
- Swift - AppDelegate.swift类中默认方法的介绍
- 152. Maximum Product Subarray