博客
关于我
Bear and Poker CodeForces - 573A
阅读量:259 次
发布时间:2019-03-01

本文共 1005 字,大约阅读时间需要 3 分钟。

????n??????????3??????2???????????????????

???

  • ???????????????2^a * 3^b * k??????k??2?3?????k?????????????2?3??????

  • ???k???????k?????????????a?b???????????????????k????????????2?3????????

  • ??????????k????????????2?3???????

  • ?????

  • ????????????????2?3??????
  • ????????????????
  • ????????YES????????NO??
  • ?????

    #include 
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    using namespace std;int root(int x) { while (x % 2 == 0) x /= 2; while (x % 3 == 0) x /= 3; return x;}int main() { int n; cin >> n; vector
    a(n); for (int i = 0; i < n; ++i) { a[i] = root(a[i]); } bool same = true; int first = a[0]; for (size_t i = 1; i < n; ++i) { if (a[i] != first) { same = false; break; } } if (same) { cout << "YES"; } else { cout << "NO"; }}

    ???

    • ????????root??????????????2?3?????????????
    • ???????????n????????
    • ????????????????????2?3?????????????
    • ??????????????????????
    • ??????????????YES???NO??

    ???????????????????????????????

    转载地址:http://tdnt.baihongyu.com/

    你可能感兴趣的文章
    npm错误Error: Cannot find module ‘postcss-loader‘
    查看>>
    NPOI之Excel——合并单元格、设置样式、输入公式
    查看>>
    NPOI利用多任务模式分批写入多个Excel
    查看>>
    NPOI在Excel中插入图片
    查看>>
    NPOI格式设置
    查看>>
    Npp删除选中行的Macro录制方式
    查看>>
    NR,NF,FNR
    查看>>
    nrf开发笔记一开发软件
    查看>>
    NS3 IP首部校验和
    查看>>
    NSDateFormatter的替代方法
    查看>>
    NSError 的使用方法
    查看>>
    nsis 安装脚本示例(转)
    查看>>
    NSJSON的用法(oc系统自带的解析方法)
    查看>>
    nslookup 的基本知识与命令详解
    查看>>
    NSOperation基本操作
    查看>>
    NSRange 范围
    查看>>
    NSSet集合 无序的 不能重复的
    查看>>
    NSURLSession下载和断点续传
    查看>>
    NSUserdefault读书笔记
    查看>>
    NT AUTHORITY\NETWORK SERVICE 权限问题
    查看>>