摘要:
组合数时间限制:3000 ms | 内存限制:65535 KB 难度:3描述找出从自然数1、2、... 、n(0#include #include using namespace std;int n, r;int book[11],a[15];void dfs(int step,int n, int... 阅读全文
摘要:
自己写的超时了,傻乎乎的查询一次走一遍数组。可以在数组里存储和信息,这样查询的时候只需要一个操作就可以了,否则一百万个数字走几遍绝对超时。#include int m, n;int a[1000010];int main(){ int x,y; scanf("%d%d",&m,&n);... 阅读全文
摘要:
关键是判断循环的长度,若某一步的余数已出现过,则循环确定#include #include int s[10000], y[10000],sign[10000];int main(){ int a, b, sz, yu, k , cnt; while(scanf("%d%d",&a,&b... 阅读全文