学习
kaka_d
这个作者很懒,什么都没留下…
展开
-
被3整除的子序列
链接:https://ac.nowcoder.com/acm/problem/21302 来源:牛客网 题目描述 给你一个长度为50的数字串,问你有多少个子序列构成的数字可以被3整除 答案对1e9+7取模 输入描述: 输入一个字符串,由数字构成,长度小于等于50 输出描述: 输出一个整数 示例1 输入 复制132 132 输出 复制3 3 示例2 输入 复制9 9 输出 复制1 1 示例3 输入 复制333 333 输出 复制7 7 .原创 2021-04-28 19:49:07 · 65 阅读 · 0 评论 -
A1046-shortest distance
题目描述 1046 Shortest Distance (20 分)The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits. 输入格式 Each input file contains one test case. For each case, the f原创 2021-04-20 21:32:13 · 60 阅读 · 0 评论 -
算法笔记-数组元素循环右移问题
#include <iostream> using namespace std; int main() { int a[110]; int n,m,count=0;//count记录已经输出数的个数 cin>>n>>m; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=n-m;i<n;i++){//输出n-m号到n-1号 ...原创 2021-04-17 11:12:51 · 71 阅读 · 0 评论 -
数组默认的初始值问题
静态数组,全局数组 不初始化默认是0;而局部数组不初始化,默认的值时系统随机分配的垃圾值原创 2021-04-11 20:53:29 · 401 阅读 · 0 评论