当前位置:网站首页>2022 Henan Mengxin League game (2)
2022 Henan Mengxin League game (2)
2022-07-21 09:32:00 【Rong AI】
2022 Henan Mengxin League No ( Two ) site
Water topic
Catalog
F Garage Kit
Ideas : Is there a cubic number of violence n Factor of
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll inf=0x3f3f3f3f3f;
const ll maxn=2e5+10;
map<ll,ll> mp;
ll t,n;
ll cnt[maxn];
ll m;
void init(){
for(int i=1;;i++){
if((ll)i*i*i>1e9){
break;
}
cnt[++m]=i*i*i;
}
}
int main()
{
init();
scanf("%lld",&t);
while(t--){
scanf("%lld",&n);
ll ans=0;
for(int i=1;i<=m;i++){
if(n%cnt[i]==0){
ans++;
}
}
printf("%lld\n",ans);
}
return 0;
}
G Infinite
Ideas : Thinking questions .
Found by typing the table , Satisfy the following formula :
f[n]=f[n-1]+f[n-2]+1
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll inf=0x3f3f3f3f3f;
const ll maxn=2e5+10;
const ll mod=998244353;
ll p;
ll pqow(ll a,ll b){
ll res=1;
while(b){
if(b&1)res=res^a%mod;
a=a^a%mod;
b>>=1;
}
return res%mod;
}
int main()
{
cin>>p;
ll x=0,y=0;
ll ans=0;
for(int i=1;i<=p;i++){
ans=(x+y+1)%mod;
x=y%mod;
y=ans%mod;
}
cout<<ans;
return 0;
}
J Sign in
Ideas : First count d-c Result , Whether there is corresponding violence a+b
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll maxn=1e5+10;
ll n;
ll a[maxn];
map<ll,ll> mp;
int main()
{
scanf("%lld",&n);
for(int i=1;i<=n;i++){
scanf("%lld",&a[i]);
}
sort(a+1,a+1+n);
for(int i=n;i>1;i--){
for(int j=i-1;j>=1;j--){
mp[(a[i]-a[j])]=1;
//cout<<(a[i]-a[j])<<endl;
}
}
for(int i=1;i<=n;i++){
if(mp[a[i]*2]){
printf("Yes");
return 0;
}
}
for(int i=1;i<n;i++){
for(int j=i+1;j<=n;j++){
if(mp[(a[i]+a[j])])
{
printf("Yes");
return 0;
}
}
}
printf("No");
return 0;
}
L HPU
Ideas : violence , use substr function
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll inf=0x3f3f3f3f3f;
const ll maxn=2e5+10;
string s;
string t="HPU";
int main()
{
cin>>s;
int n=s.length();
ll ans=0;
for(int i=0;i<n;i++){
if(s.substr(i,3)==t){
ans++;
}
}
cout<<ans;
return 0;
}
Conclusion
- Never decide Ask the spring breeze
- The spring breeze is silent That is, follow your heart
- If my heart can settle How can you not make up your mind when you are in trouble Spring breeze also has spring breeze sorrow Don't worry about me .
- Since then, the spring breeze has filled my sleeves , Just for the sake of peace .
边栏推荐
- WireShark 抓包及快速定位数据包技巧
- Compréhension approfondie de la haute concurrence
- 《懒人Shell脚本》之四——日志条数动态实时统计
- Commonly used lithium battery charging IC chip
- Smart lamp pole exhibition | 2022 Nanjing International Smart lamp pole and smart street lamp Exhibition
- Efcore table relationship, one-to-one, use case
- 5W无线充SOC方案芯片FS68001封装SOP16和SOP8
- One of the tools of SAP ui5 system test: uiveri5
- Deep understanding of high concurrency
- 瓜分30万奖金!DeepRec CTR模型性能优化天池挑战赛来啦
猜你喜欢
BisinessCardGen
【字体反爬】猫X眼YingShi,我们又来欺负你了,用到了 OCR 识别技术
可观测性提升软件工程质量,观测云出席2022 QECon全球软件质量&效能大会
Understanding of Zhongtai
7.24聚会通知
瓜分30万奖金!DeepRec CTR模型性能优化天池挑战赛来啦
Observability improves the quality of software engineering, and observation cloud attends the 2022 qecon global software quality & effectiveness conference
Nacos custom extended data ID configuration
Unity Image控件和RawImage
Efcore table relationship, one-to-one, use case
随机推荐
2022 the 15th Nanjing international industrial automation and industrial robots Exhibition
How to cut out only the people in the gait contour of the human body
最短 hamilton 路径 题解
此 Visual 未连接到 PresentationSource。
「USACO2006NOV」Corn Fields 题解
Association between roles, roles collection and scopes on SAP BTP
(作业)C语言做题:结构体对齐数、位段、联合体
matlab基础语法总结
常用的锂电池升压IC
Commonly used lithium battery charging IC chip
Summer summary 1
C#递归获取文件夹下所有文件 并绑定到 TreeView控件中
Educational Codeforces Round 89 (Rated for Div. 2)ABC题解
volley7–NetworkDispatcher从网络中获取数据[通俗易懂]
Compréhension approfondie de la haute concurrence
Seata 多语言体系建设
About whether the processing of SSR will continue after SAP Spartacus CSR fallback
MongoDB数据库的简单使用
iOS_ Calculate cache file size and clear cache
C语言词语翻译(通过单词基本含义帮助理解)不定期更新……