EducationalCodeforcesRound90(RatedforDiv.2)题解中,如何巧妙运用长尾词提升解题效率?
- 内容介绍
- 文章标签
- 相关推荐
本文共计1141个文字,预计阅读时间需要5分钟。
原文:本文由编程笔记整理。
本篇内容整理自编程记录。
本文由编程笔记#自由互联小编为大家整理,主要介绍了EducationalCodeforcesRound90(RatedforDiv.2)题解相关的知识,希望对你有一定的参考价值。 本文由编程笔记#自由互联小编为大家整理,主要介绍了Educational Codeforces Round 90 (Rated for Div. 2)题解相关的知识,希望对你有一定的参考价值。A. Donut Shops- 题目传送门
- 水题,就用a * b和c比一下大小就行了,要求买第一种饼干便宜的情况就假设只买一块,比较a和c的大小,求买第二种便宜就比较 a * b和c比大小就行了
#includeusing namespace std;#pragma GCC optimize(2)typedef long long ll;typedef unsigned long long ull;typedef long double ld;ll t,a,b,c; int main(){ ios::sync_with_stdio(false); cin>>t; while(t--){ cin>>a>>b>>c; ll a1=0,a2=0; if(c>a){ cout<<"1"<<" "; }else{ cout<<"-1"<<" "; } ll tmp=a*b; if(tmp>c){ cout<B. 01 Game
#includeusing namespace std;#pragma GCC optimize(2)typedef long long ll;typedef unsigned long long ull;typedef long double ld;int t;string s; int main(){ ios::sync_with_stdio(false); cin>>t; while(t--){ cin>>s; int ans=0; int a0=0,a1=0; for(int i=0;i 题目传送门 这个其实很简单就把cur=0开始,把每个符号的cur都走一遍,比如 --+- 对应 -1 -2 -1 -2对应的为cur数组(代码中就是r数组)那么就从-1开始走,标记ans=0,如果遇到比cur[i]更小的,那么ans就加上这个cur的下标。最后再加一个整个数组的长度 这题不开long long 会爆int,wa on test7,我就wa了一发(彩笔落泪 #includeusing namespace std;#pragma GCC optimize(2)typedef long long ll;typedef unsigned long long ull;typedef long double ld;ll t;string s;const int inf = 0x3f3f3f3f;const int maxn = 1e6 + 10;ll r[maxn];int main(){ ios::sync_with_stdio(false); cin >> t; while (t--) { cin >> s; //int rec=0; //int a=0,r=0; if (s[0] == ‘+‘) r[0] = 1; else r[0] = -1; ll len = s.size(); for (ll i = 1; i 题目传送门 这个题比赛的时候想假了,最后还是看的dalao的(pxy,yyds!)下来之后其实仔细想想,这题是以前做过的一道题,只是这里把奇偶分开考虑了而已,我真的太菜了,这题其实只要发现只有偶数长度的子串翻转才有效,奇数长度的反转对结果没影响,然后再简单想想就有了(我真的太菜了,落泪 #includeusing namespace std;const int maxn = 2e5 + 10;typedef long long ll;ll t, n, a[maxn], r1[maxn], r2[maxn];int main(){ ios::sync_with_stdio(false); cin >> t; while (t--) { cin >> n; for (int i = 0; i > a[i]; int f = 1; for (int i = 0; i #includeusing namespace std;typedef long long ll;int s[200010],d[200010];long long MaxSubseqSum4( int A[], int N ) { long long ThisSum, MaxSum, i; ThisSum = MaxSum = 0; for( i = 1; i
本文共计1141个文字,预计阅读时间需要5分钟。
原文:本文由编程笔记整理。
本篇内容整理自编程记录。
本文由编程笔记#自由互联小编为大家整理,主要介绍了EducationalCodeforcesRound90(RatedforDiv.2)题解相关的知识,希望对你有一定的参考价值。 本文由编程笔记#自由互联小编为大家整理,主要介绍了Educational Codeforces Round 90 (Rated for Div. 2)题解相关的知识,希望对你有一定的参考价值。A. Donut Shops- 题目传送门
- 水题,就用a * b和c比一下大小就行了,要求买第一种饼干便宜的情况就假设只买一块,比较a和c的大小,求买第二种便宜就比较 a * b和c比大小就行了
#includeusing namespace std;#pragma GCC optimize(2)typedef long long ll;typedef unsigned long long ull;typedef long double ld;ll t,a,b,c; int main(){ ios::sync_with_stdio(false); cin>>t; while(t--){ cin>>a>>b>>c; ll a1=0,a2=0; if(c>a){ cout<<"1"<<" "; }else{ cout<<"-1"<<" "; } ll tmp=a*b; if(tmp>c){ cout<B. 01 Game
#includeusing namespace std;#pragma GCC optimize(2)typedef long long ll;typedef unsigned long long ull;typedef long double ld;int t;string s; int main(){ ios::sync_with_stdio(false); cin>>t; while(t--){ cin>>s; int ans=0; int a0=0,a1=0; for(int i=0;i 题目传送门 这个其实很简单就把cur=0开始,把每个符号的cur都走一遍,比如 --+- 对应 -1 -2 -1 -2对应的为cur数组(代码中就是r数组)那么就从-1开始走,标记ans=0,如果遇到比cur[i]更小的,那么ans就加上这个cur的下标。最后再加一个整个数组的长度 这题不开long long 会爆int,wa on test7,我就wa了一发(彩笔落泪 #includeusing namespace std;#pragma GCC optimize(2)typedef long long ll;typedef unsigned long long ull;typedef long double ld;ll t;string s;const int inf = 0x3f3f3f3f;const int maxn = 1e6 + 10;ll r[maxn];int main(){ ios::sync_with_stdio(false); cin >> t; while (t--) { cin >> s; //int rec=0; //int a=0,r=0; if (s[0] == ‘+‘) r[0] = 1; else r[0] = -1; ll len = s.size(); for (ll i = 1; i 题目传送门 这个题比赛的时候想假了,最后还是看的dalao的(pxy,yyds!)下来之后其实仔细想想,这题是以前做过的一道题,只是这里把奇偶分开考虑了而已,我真的太菜了,这题其实只要发现只有偶数长度的子串翻转才有效,奇数长度的反转对结果没影响,然后再简单想想就有了(我真的太菜了,落泪 #includeusing namespace std;const int maxn = 2e5 + 10;typedef long long ll;ll t, n, a[maxn], r1[maxn], r2[maxn];int main(){ ios::sync_with_stdio(false); cin >> t; while (t--) { cin >> n; for (int i = 0; i > a[i]; int f = 1; for (int i = 0; i #includeusing namespace std;typedef long long ll;int s[200010],d[200010];long long MaxSubseqSum4( int A[], int N ) { long long ThisSum, MaxSum, i; ThisSum = MaxSum = 0; for( i = 1; i

