摘要: 链接:https://ac.nowcoder.com/acm/contest/19483/I 来源:牛客网 输入 52 3 4 1 2 输出 5 说明 其中一种可行的最佳方案,依次选择[1,5] [1,3] [2,3] [3,3] [5,5] 备注: 对于 ... 阅读全文
posted @ 2021-08-22 22:56 泥烟 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 递归快速幂 (对大素数取模) typedef long long ll;ll Quick_pow(ll a,int n){ if(n == 0) return 1;//出口为"a^0=1" else if(n % 2 == 1) return Qu... 阅读全文
posted @ 2021-08-22 21:33 泥烟 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 链接:https://ac.nowcoder.com/acm/contest/19483/A 来源:牛客网 输入 5 35 2 3 10 61 52 32 5 输出 18006360 #include #include #include using nam... 阅读全文
posted @ 2021-08-22 19:44 泥烟 阅读(24) 评论(0) 推荐(0) 编辑