题目 求1+2+3+...+n的值。 数据规模与约定 1 ? n ? 1,000,000,000。 正确答案 #include <iostream> using namespace std; int main() { long long n = 0; scanf("%d",&n); if(n>=1 ...
分类:
编程语言 时间:
2020-07-12 22:46:55
阅读次数:
97
CoreFrist多个上下文 出现这个怎么解决:No DbContext was found in assembly' ShopCore'. Ensure that you' re using the correct assembly and that the type is neither abs ...
分类:
其他好文 时间:
2020-07-12 22:19:09
阅读次数:
89
方法:找着找着规律,发现是斐波那契数列,还是使用迭代的方法,驾轻就熟了,第一次一遍过 1 //找规律过程中,发现是斐波那契数列 f(n) = f(n-1) + f(n-2) 2 3 #include <iostream> 4 5 using namespace std; 6 7 class Solu ...
分类:
编程语言 时间:
2020-07-12 22:18:34
阅读次数:
83
#T1 搜索 和以前做过一道关于排序的题有亿点点像,看到这么小的数据范围竟然脑抽没去想搜索.... #T2 筛法 换个方向思考,我们考虑这个数是几个数的倍数 #include <bits/stdc++.h> using namespace std; const int maxn = 1000000+ ...
分类:
其他好文 时间:
2020-07-12 22:15:34
阅读次数:
66
题目链接:https://codeforces.com/problemset/problem/1114/F 题目大意:给你n个数,q次操作,类型1,将区间[l,r]中每个数乘以x,类型2,询问$\varphi (\prod_{i=l}^{r}a_i)$。其中初始的n个数每个小于等于300,x<=30 ...
分类:
其他好文 时间:
2020-07-12 19:09:23
阅读次数:
52
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render fun... ...
分类:
其他好文 时间:
2020-07-12 18:50:22
阅读次数:
74
Algorithm: 225: Implement Stack using Queues (Easy) 232: Implement Queue using Stacks (Easy) 栈和队列互相表达虽然很简单,但是有多种办法,比如使用队列时的双队列、单队列、操作头部、操作尾部、peek优化等,最 ...
分类:
其他好文 时间:
2020-07-12 18:33:10
阅读次数:
50
传送门 将n×n的矩阵旋转90度,而且不能额外开辟新的空间 可以分为两步骤:①、矩阵转置;②、对矩阵的每一列,关于纵轴对换。 算法复杂度$O(n^{2})$ #include <algorithm> using namespace std; class Solution { public: void ...
分类:
其他好文 时间:
2020-07-12 17:12:31
阅读次数:
86
这道题考察的是unique函数。用一个数组a来存下这10个数,并在读入时进行%42的运算,然后在进行sort排序后用去重函数unique求出其中不重复的元素个数即可。 代码: 1 #include<iostream> 2 #include<algorithm> 3 using namespace s ...
分类:
其他好文 时间:
2020-07-12 16:52:02
阅读次数:
57
学习地址:https://www.bilibili.com/video/BV1mf4y1S72o?p=18 实例练习一(创建一个柱的族) using System; using System.Collections.Generic; using System.Linq; using System.T ...
分类:
其他好文 时间:
2020-07-12 16:24:00
阅读次数:
82