第十四届蓝桥杯三月真题刷题训练——第 5 天(3.8)
目录
数的分解 - 蓝桥云课 (lanqiao.cn)
#include <iostream>
#include <bits/stdc++.h>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#define x first
#define y second
#define endl '\n'
#define ms(x,y) memset(x,y,sizeof x)
#define ios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<double,double> PDD;
typedef pair<double,int> PDI;
typedef pair<char,int> PCI;
typedef pair<string,int> PSI;
typedef pair<int,string> PIS;
typedef pair<LL,LL> PLL;
//typedef __int128 i128;
typedef unsigned long long ULL;
const int N = 100+ 10,M = N * 2 ,INF = 0x3f3f3f3f ;
const double eps = 1e-7;
int p[N],cnt;
struct node{
int a,b,c;
};
bool check(int x)
{
int t;
while(x)
{
t = x % 10;x/=10;
if(t == 2 || t == 4 )return 0;
}
return 1;
}
int n = 2019,ans =0 ;
int q[N];
void solve()
{
map<node,int> mp;
for(int i=1;i<=n ;i++)
for(int j=i+1;j<=n;j ++)
{
int k = n - i - j;
if(check(i) && check(j) && check(k) && k > j )
{
if(i + j + k == n ) ans ++ ;
}
}
cout <<ans <<endl;
}
signed main()
{
// freopen("1.txt","w",stdout);
// ios
int T=1;
// cin>>T;
int now = 1;
while(T -- )
{
// cout<<"Case ";
// cout<<"Case #";
// cout<< now ++ <<": ";
solve();
}
return 0;
}
猜生日 - 蓝桥云课 (lanqiao.cn)
#include <iostream>
#include <bits/stdc++.h>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#define x first
#define y second
#define endl '\n'
#define ms(x,y) memset(x,y,sizeof x)
#define ios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<double,double> PDD;
typedef pair<double,int> PDI;
typedef pair<char,int> PCI;
typedef pair<string,int> PSI;
typedef pair<int,string> PIS;
typedef pair<LL,LL> PLL;
//typedef __int128 i128;
typedef unsigned long long ULL;
const int N = 100+ 10,M = N * 2 ,INF = 0x3f3f3f3f ;
const double eps = 1e-7;
int n =20120312,m=19000101;
void solve()
{
for(int i=m;i<=n;i++)
{
int year = i / 10000,month = i %10000 / 100 ,day = i % 100;
if(month != 6 ) continue;
if(i % 2012 || i % 3 || i % 12 ) continue;
if(month > 12 || month == 0 )continue;
if(day > 30 ) continue;
cout <<i <<endl;
}
}
signed main()
{
// freopen("1.txt","w",stdout);
// ios
int T=1;
// cin>>T;
int now = 1;
while(T -- )
{
// cout<<"Case ";
// cout<<"Case #";
// cout<< now ++ <<": ";
solve();
}
return 0;
}
成绩统计 - 蓝桥云课 (lanqiao.cn)
#include <iostream>
#include <bits/stdc++.h>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#define x first
#define y second
#define endl '\n'
#define ms(x,y) memset(x,y,sizeof x)
#define ios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<double,double> PDD;
typedef pair<double,int> PDI;
typedef pair<char,int> PCI;
typedef pair<string,int> PSI;
typedef pair<int,string> PIS;
typedef pair<LL,LL> PLL;
//typedef __int128 i128;
typedef unsigned long long ULL;
const int N = 100+ 10,M = N * 2 ,INF = 0x3f3f3f3f ;
const double eps = 1e-7;
void solve()
{
int n;cin >> n;
int a1=0,a2=0;
int t;
for(int i=1;i<=n;i ++)
{
cin >> t;
if(t >= 85 )a1 ++;
if(t >= 60) a2 ++ ;
}
a1 = a1 * 100.0 / n + 0.5;
a2 = a2 * 100.0 / n + 0.5 ;
cout<< a2 <<"%\n"<<a1 <<"%\n";
}
signed main()
{
// freopen("1.txt","w",stdout);
// ios
int T=1;
// cin>>T;
int now = 1;
while(T -- )
{
// cout<<"Case ";
// cout<<"Case #";
// cout<< now ++ <<": ";
solve();
}
return 0;
}
最大和 - 蓝桥云课 (lanqiao.cn)
#include <iostream>
#include <bits/stdc++.h>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#define x first
#define y second
#define endl '\n'
#define ms(x,y) memset(x,y,sizeof x)
#define ios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<double,double> PDD;
typedef pair<double,int> PDI;
typedef pair<char,int> PCI;
typedef pair<string,int> PSI;
typedef pair<int,string> PIS;
typedef pair<LL,LL> PLL;
//typedef __int128 i128;
typedef unsigned long long ULL;
const int N = 10000+ 10,M = N * 2 ,INF = 0x3f3f3f3f ;
const double eps = 1e-7;
int get(int x)
{
for(int i=2;i<=x;i ++ )
if(x % i == 0 ) return i;
return 1;
}
int n;
int a[N],f[N];
void solve()
{
cin >> n;
for(int i=1;i<=n; i++ ) cin >> a[i];
ms(f,-0x3f);
f[1] = a[1];
for(int i=1;i<=n;i++)
{
int len= get(n-i);
for(int r=i+1;r<=i + len ;r ++ )
f[r] = max(f[r],f[i] + a[r]);
}
cout << f[n]<<endl;
}
signed main()
{
// freopen("1.txt","w",stdout);
// ios
int T=1;
// cin>>T;
int now = 1;
while(T -- )
{
// cout<<"Case ";
// cout<<"Case #";
// cout<< now ++ <<": ";
solve();
}
return 0;
}
...全文
相关推荐
第十三届蓝桥杯EDA组省赛真题 训练题
"第十三届蓝桥杯EDA组省赛真题 训练题"这个主题涵盖了电子设计自动化(EDA)领域的知识,这是电子信息工程中一个重要的分支。
蓝桥杯18天的刷题量,共180道题
总的来说,蓝桥杯18天刷题计划是一个挑战性的训练项目,对于准备参加蓝桥杯的选手来说,这是一次难得的提升机会。
python蓝桥杯省赛刷题总结+真题
【Python蓝桥杯省赛刷题总结】在Python编程领域,蓝桥杯竞赛是一个非常重要的比赛,它旨在考察参赛者的编程能力、算法理解和问题解决技巧。
蓝桥杯历年真题及测试数据.zip
在准备蓝桥杯的过程中,除了刷题,还应注重理论知识的学习,关注算法的最新发展,保持对新技术的兴趣。同时,团队合作、项目实践也是提升技能的重要途径。
13-15届蓝桥杯EDA模拟题和真题
第十三届蓝桥杯EDA赛训练试题一资源包第十三届蓝桥杯EDA赛训练试题二资源包第十三届蓝桥杯EDA赛训练试题三资源包第十四届蓝桥杯EDA赛模拟题一第十四届蓝桥杯EDA赛模拟题二第十四届蓝桥杯EDA省赛真


