当前位置:网站首页>aaaaaaaaaaA heH heH nuN
aaaaaaaaaaA heH heH nuN
2022-07-25 12:11:00 【Lie drunk and wake up in a dream】
aaaaaaaaaaA heH heH nuN
The question :
Specify that the prefix of a string fragrance is nunhehheh, The suffix is a number a; Given a n , To find a n String of aromatic subsequences .
Ideas :
nunhehheh + a * x, Yes 2^x - 1 Valid subsequences
nunhehhe hhhha , Yes p individual h, Then there are p Valid subsequences
So in the last one a Add one in front h It can form 2 ^ x Valid substrings
for example haha == 4 haaha == 8
It corresponds directly to 2 Base number , So we directly enumerate how many binary bits there are 1, Then in the front a Back plus h And the corresponding binary bit plus h( namely a And a Space between ) You can construct
AC Code :
#include <iostream>
#include <algorithm>
#include <bitset>
#include <string.h>
using namespace std;
int s[50];
void solve(){
int n;cin >> n;
bitset<33>q(n);
memset(s,0,sizeof s);
if(q.test(0)) s[1] ++;
for(int i = 1;i <= 31;i ++)
if(q.test(i)) s[i]++,s[1]++;
cout << "nunhehhe";
for(int i = 31;i > 0;i --){
for(int j = 0;j < s[i];j ++)
cout << "h";
cout << "a";
}
cout << endl;
return;
}
int main(){
int t;cin >> t;
while(t --){
solve();
}
return 0;
}
边栏推荐
- 知识图谱用于推荐系统问题(MVIN,KERL,CKAN,KRED,GAEAT)
- flink sql client 连接mysql报错异常,如何解决?
- Power BI----这几个技能让报表更具“逼格“
- 【多模态】《TransRec: Learning Transferable Recommendation from Mixture-of-Modality Feedback》 Arxiv‘22
- Hydrogen entrepreneurship competition | Liu Yafang, deputy director of the science and Technology Department of the National Energy Administration: building a high-quality innovation system is the cor
- Brpc source code analysis (VI) -- detailed explanation of basic socket
- Word中的空白页,怎么也删不掉?如何操作?
- Solutions to the failure of winddowns planning task execution bat to execute PHP files
- 【6篇文章串讲ScalableGNN】围绕WWW 2022 best paper《PaSca》
- 【RS采样】A Gain-Tuning Dynamic Negative Sampler for Recommendation (WWW 2022)
猜你喜欢

【AI4Code】《Unified Pre-training for Program Understanding and Generation》 NAACL 2021

Brpc source code analysis (VI) -- detailed explanation of basic socket

Innovation and breakthrough! AsiaInfo technology helped a province of China Mobile complete the independent and controllable transformation of its core accounting database

OSPF comprehensive experiment

【AI4Code】《CodeBERT: A Pre-Trained Model for Programming and Natural Languages》 EMNLP 2020

Learning to Pre-train Graph Neural Networks(图预训练与微调差异)

Learning to pre train graph neural networks

Brpc source code analysis (VII) -- worker bthread scheduling based on parkinglot

PHP curl post length required error setting header header

【无标题】
随机推荐
【AI4Code】《Unified Pre-training for Program Understanding and Generation》 NAACL 2021
Transformer变体(Routing Transformer,Linformer,Big Bird)
brpc源码解析(二)—— brpc收到请求的处理过程
【多模态】《TransRec: Learning Transferable Recommendation from Mixture-of-Modality Feedback》 Arxiv‘22
Meta-learning(元学习与少样本学习)
The applet image cannot display Base64 pictures. The solution is valid
[untitled]
Zero-Shot Image Retrieval(零样本跨模态检索)
Return and finally? Everyone, please look over here,
selenium使用———xpath和模拟输入和模拟点击协作
【图攻防】《Backdoor Attacks to Graph Neural Networks 》(SACMAT‘21)
Power Bi -- these skills make the report more "compelling"“
Learning to Pre-train Graph Neural Networks(图预训练与微调差异)
Sword finger offer 22. the penultimate node in the linked list
客户端开放下载, 欢迎尝鲜
知识图谱用于推荐系统问题(MVIN,KERL,CKAN,KRED,GAEAT)
Intelligent information retrieval (overview of intelligent information retrieval)
Figure neural network for recommending system problems (imp-gcn, lr-gcn)
一文入门Redis
【GCN-RS】Are Graph Augmentations Necessary? Simple Graph Contrastive Learning for RS (SIGIR‘22)