In this winter holiday, Bob has a plan for skiing at the mountain resort. This ski resort has MM different ski paths and NN different flags situated at those turning points. The ii-th path from the
The numbers 11, 33, 66, 1010, 1515, 2121, 2828, 3636, 4545 and t_i=\frac{1}{2}i(i+1)ti=21i(i+1), are called half-consecutive. For given NN, find the smallest rr which is no smaller than NN
题目链接:https://nanti.jisuanke.com/t/T1797 算法特工队QQ群:979618872 (伸手党绕边,欢迎有良好基础的人加入) //// Created by Leo Lee on 2019/4/5.//#include <iostream>using namespace std;int main(){int counts;cin>>counts;int t
题目链接:https://nanti.jisuanke.com/t/T1725 算法特工队QQ群:979618872 (伸手党绕边,欢迎有良好基础的人加入) //// Created by Leo Lee on 2019/4/5.//#include <iostream>#include <string>using namespace std;unsigned long minLong
题目链接:https://nanti.jisuanke.com/t/T1677 算法特工队QQ群:979618872 (伸手党绕边,欢迎有良好基础的人加入) //// Created by Leo Lee on 2019/4/5.//#include <iostream>using namespace std;void getGroups(int bulls,int k);int gr
题目链接:https://nanti.jisuanke.com/t/T1560 算法特工队QQ群:979618872 (伸手党绕边,欢迎有良好基础的人加入) //// Created by Leo Lee on 2019/4/5.//#include <iostream>#include <algorithm>using namespace std;long long arr[1000
题目链接:https://nanti.jisuanke.com/t/T1319 算法特工队QQ群:979618872 (伸手党绕边,欢迎有良好基础的人加入) //// Created by Leo Lee on 2019/4/5.//#include <iostream>#include <math.h>using namespace std;bool isprime(long lon
题目链接:https://nanti.jisuanke.com/t/T1109 https://nanti.jisuanke.com/t/T1109 //// Created by Leo Lee on 2019/4/5.//#include <iostream>#include <string>using namespace std;int main(){string str;cha
题目链接:https://nanti.jisuanke.com/t/T1044 算法特工队QQ群:979618872 (伸手党绕边,欢迎有良好基础的人加入) //// Created by Leo Lee on 2019/4/5.//#include <iostream>using namespace std;int main(){int max = INT32_MIN,tmp;for(
题目链接https://nanti.jisuanke.com/t/T1315 算法特工队QQ群:979618872 (伸手党绕边,欢迎有良好基础的人加入) //// Created by Leo Lee on 2019/4/6.//#include <iostream>using namespace std;int main(){int cases;cin>>cases;double s
There are NN cities in the country, and MM directional roads from uu to v(1\le u, v\le n)v(1≤u,v≤n). Every road has a distance c_ic i . Haze is a Magical Girl that lives in City 11, she can choose
注意unsigned long long int 比long long int表示的范围要大,前者能表示-2^63+1~2^63-1,后者能表示的范围是0~2^64-1,与题目中的范围相符,这个问题导致我浪费了很多时间。。。。。。 #include <iostream>using namespace std;int main(){unsigned long long int m,n;ci
蒜头君得到了 nn 个数,他想对这些数进行下面这样的操作,选出最左边的相邻的差的绝对值为 11 的两个数,只保留较小的数,删去较大的数,直到没有两个相邻的差的绝对值为 11 的数,问最多可以进行多少次这样的操作? 输入格式 输入第一行为一个整数 n(1 \leq n \leq 10^5)n(1≤n≤105),表示数字的总数 第二行为 nn 个整数 x_1,x_2,...,x_n(0 \leq x