博客
关于我
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/

    你可能感兴趣的文章
    OA项目之我的会议(查询)
    查看>>
    Object c将一个double值转换为时间格式
    查看>>
    object detection之Win10配置
    查看>>
    object detection训练自己数据
    查看>>
    object detection错误Message type "object_detection.protos.SsdFeatureExtractor" has no field named "bat
    查看>>
    object detection错误之Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
    查看>>
    object detection错误之no module named nets
    查看>>
    Object of type 'ndarray' is not JSON serializable
    查看>>
    Object Oriented Programming in JavaScript
    查看>>
    object references an unsaved transient instance - save the transient instance before flushing
    查看>>
    Object.keys()的详解和用法
    查看>>
    OBJECTIVE C (XCODE) 绘图功能简介(转载)
    查看>>
    Objective-C ---JSON 解析 和 KVC
    查看>>
    Objective-C 编码规范
    查看>>
    Objective-C——判断对象等同性
    查看>>
    Objective-C之成魔之路【7-类、对象和方法】
    查看>>
    Objective-C享元模式(Flyweight)
    查看>>
    Objective-C以递归的方式实现二叉搜索树算法(附完整源码)
    查看>>
    Objective-C内存管理教程和原理剖析(三)
    查看>>
    Objective-C实现 Greedy Best First Search最佳优先搜索算法(附完整源码)
    查看>>