摘要: #include<bits/stdc++.h>#define ll long longusing namespace std;/*发现这个题只有两种情况,只要把短的两边都定为b,长边定为c,如果短的两边太短直接算出中间一边的合适长度输出就行情况一:1 3 5 73 3 5情况二:1 3 9 113 阅读全文
posted @ 2020-05-23 10:24 SyrupWRLD 阅读(118) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>#define ll long longusing namespace std;//这道题不用考虑k等于几,根据公式得x=n/(1+2+4+...),只要得到整数x即可int main(){ ll t,k,x,n; cin>>t; for(int i=0 阅读全文
posted @ 2020-05-23 09:45 SyrupWRLD 阅读(120) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>#define ll long longusing namespace std;//题意是给你n个数,让你在其中找一串长度为k的数的最左端,使这段k中山峰数最多,并求最多的山峰数int main( ){ int t; cin>>t; while(t--) 阅读全文
posted @ 2020-05-20 15:04 SyrupWRLD 阅读(117) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>#define ll long longusing namespace std;/* max 7*23=161 max2 1197 min 7*17=119 min2 83 如果超过119,不符合题意 max 11*21=231 max2 236 最高不 阅读全文
posted @ 2020-05-19 11:56 SyrupWRLD 阅读(104) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>#define ll long longusing namespace std;//根据样例可看出分为两种情况,还要注意只输入一个字符的情况,按以下分情况判断即可int main( ){ int n; string s="10"; string t; c 阅读全文
posted @ 2020-05-19 09:04 SyrupWRLD 阅读(175) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>#define ll long longusing namespace std;//方法是通过在每个数的前后补上相应不重复的数,因此发现规律只要找出没出现过的数,和原有的数一起存入集合,再循环输出//eg: 5 4// 2 1 2 41//1234123 阅读全文
posted @ 2020-05-18 23:02 SyrupWRLD 阅读(142) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>#define ll long longusing namespace std;//花a的钱可以让x或y加1或减1,花b的钱可以让x和y同时加1或减1,求使a=b=0所花最少的钱int main( ){ ll t,k=0,x,y,a,b,s1,s2; c 阅读全文
posted @ 2020-05-18 12:13 SyrupWRLD 阅读(129) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>#define ll long longusing namespace std;//让最大的数和前面n/2-1个较小的数加和,再减去剩下的数,就是答案int main( ){ int t,n,k=0; cin>>t; int a[t]; for(int 阅读全文
posted @ 2020-05-18 11:21 SyrupWRLD 阅读(106) 评论(0) 推荐(0)
摘要: 链接:https://ac.nowcoder.com/acm/contest/5600/H来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 我有个神奇的字母。 但我不告诉你是什么 阅读全文
posted @ 2020-05-17 23:25 SyrupWRLD 阅读(357) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>#define ll long longusing namespace std;int dfs(string s,int le,int ri)//定义dfs函数{ int res=0; while(le>=0&&ri<s.length()&&s.at(l 阅读全文
posted @ 2020-05-16 22:55 SyrupWRLD 阅读(240) 评论(0) 推荐(0)