简单题,求一下所有数的2和3的幂是任意调整的,把2和3的因子除掉以后必须相等。

求lcm,爆了long long。我得好好反省一下,对连乘不敏感

#include<bits/stdc++.h>
using namespace std;
typedef long long ll; const int maxn = 1e5+;
ll a[maxn]; int main()
{
//freopen("in.txt","r",stdin);
int n;
scanf("%d",&n);
for(int i = ; i < n; i++){
scanf("%I64d",a+i);
while(a[i]% == ) a[i]/=;
while(a[i]% == ) a[i]/=;
}
for(int i = ; i < n; i++){
if(a[i]!=a[i-]) {
puts("NO"); return ;
}
}
puts("YES");
return ;
}

Codeforces Round #318 (Div. 2) C Bear and Poker (数学)的更多相关文章

  1. Codeforces Round #318 (Div. 2) D Bear and Blocks (数学)

    不难发现在一次操作以后,hi=min(hi-1,hi-1,hi+1),迭代这个式子得到k次操作以后hi=min(hi-j-(k-j),hi-k,hi+j-(k-j)),j = 1,2,3... 当k ...

  2. Codeforces Round #318 (Div. 2) B Bear and Three Musketeers (暴力)

    算一下复杂度.发现可以直接暴.对于u枚举a和b,判断一下是否连边,更新答案. #include<bits/stdc++.h> using namespace std; int n,m; ; ...

  3. Codeforces Round #318 (Div. 2) A Bear and Elections (优先队列模拟,水题)

    优先队列模拟一下就好. #include<bits/stdc++.h> using namespace std; priority_queue<int>q; int main( ...

  4. Codeforces Round #368 (Div. 2) C. Pythagorean Triples(数学)

    Pythagorean Triples 题目链接: http://codeforces.com/contest/707/problem/C Description Katya studies in a ...

  5. Codeforces Round #622 (Div. 2) B. Different Rules(数学)

    Codeforces Round #622 (Div. 2) B. Different Rules 题意: 你在参加一个比赛,最终按两场分赛的排名之和排名,每场分赛中不存在名次并列,给出参赛人数 n ...

  6. Codeforces Round #318(Div 1) 573A, 573B,573C

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud 这场的前两题完全是手速题...A题写了7分钟,交的时候已经500+了,好在B题出的 ...

  7. Codeforces Round #284 (Div. 2)A B C 模拟 数学

    A. Watching a movie time limit per test 1 second memory limit per test 256 megabytes input standard ...

  8. Codeforces Round #356 (Div. 2) C. Bear and Prime 100(转)

    C. Bear and Prime 100 time limit per test 1 second memory limit per test 256 megabytes input standar ...

  9. Codeforces Round #356 (Div. 2)B. Bear and Finding Criminals(水题)

    B. Bear and Finding Criminals time limit per test 2 seconds memory limit per test 256 megabytes inpu ...

随机推荐

  1. Understand中的Graphical Views使用

    Graphical Views 用于浏览代码结构. 下面以dso为例 1.Butterfly 显示include关系.例: 2.Declaration 文件中的类.例: 3.UML Class Dia ...

  2. 删除多余的OracleOraDb11g_home1TNSListenerLISTENER1

    oracle 监听服务有 OracleOraDb11g_home1TNSListenerLISTENER 和OracleOraDb11g_home1TNSListenerLISTENER1 两个. 用 ...

  3. man帮助的使用

    本篇博文转自Linux社区,谨在此记录使用: ——————Linux系统man帮助的使用技巧———————— man的查询后面的数字含义:1用户在shell换机中可以操作的指令或可执行文件2系统核心可 ...

  4. E20180519-hm

    distinct adj. 明显的,清楚的; 卓越的,不寻常的; 有区别的; 确切的;

  5. 2014-5-10 NOIP模拟赛 by coolyangzc

    Problem 1 机器人(robot.cpp/c/pas) [题目描述] 早苗入手了最新的Gundam模型.最新款自然有着与以往不同的功能,那就是它能够自动行走,厉害吧. 早苗的新模型可以按照输入的 ...

  6. jzoj5988. 【WC2019模拟2019.1.4】珂学计树题 (burnside引理)

    传送门 题面 liu_runda曾经是个喜欢切数数题的OIer,往往看到数数题他就开始刚数数题.于是liu_runda出了一个数树题.听说OI圈子珂学盛行,他就在题目名字里加了珂学二字.一开始liu_ ...

  7. Java之多线程优先级基础

    线程得到cpu的给的时间才能运行 有一个同步方法,里面有一个线程进去了,外面A,B俩线程在排队,A优先级比B优先级高,等到同步方法里面的线程出去了, 一定是A先进去; 但是: 因此,仅将高优先级赋予一 ...

  8. PJzhang:robots协议的实际场景

    猫宁!!! 参考链接: https://bbs.360.cn/thread-15062960-1-1.html https://ziyuan.baidu.com/college/courseinfo? ...

  9. dream(2018.10.17)

    一句话题意:讲什么题意啊,见usaco2017feb silver的T1,一模一样,就是牛和鸡的读入顺序反过来了一下,数据范围大了10倍,卡掉了\(O(n^2)\)的算法. 数据范围: 对于 30%的 ...

  10. Vuex目录结构推荐

    目录结构如下: - src - store // 在src目录下 新建一个store文件夹 - mutations.js // mutations - mutaions_types.js // mut ...