当前位置:网站首页>Krypton saikr daily question - CTF
Krypton saikr daily question - CTF
2022-07-04 04:24:00 【GHOSTANDBREAD】
Description
After vaguely entering the University , You decided to take part in the competition and stand out , But you in the computer college , But I found that competition is not equal to E-sports , You choose left and right , Found out acm and ctf, You always wanted to be a hacker , Decided to go ctf Study there , But when ctf There are so many things to learn ,pwn,web, reverse ...., As a sprout, you decide to brush more questions .
The senior assigned you a study plan , Considering that the essence of computer is binary , So you will be 2^121 Brush one question every day for one day ,2^222 Brush two questions every day for one day , That is to say 1,21,2 Brush one question every day , The first 33 To 66 Brush two questions every day ,2^x2x Brush every day xx topic , And so on , With the basis of algorithm, you decide to write a program to see how many problems you want to write in the specified number of days
Input
An integer tt Days (1 \leq t \leq 10^7)(1≤t≤107).
Output
An integer xx Indicates the number of topics to brush .
Sample Input 1
9
Sample Output 1
19
The code is as follows :
#include<iostream>
#include<cmath>
using namespace std;
int n, sum = 0;
int main()
{
ios::sync_with_stdio(false);
cout.tie(NULL);
cin >> n;
int i = 1;
while(n - pow(2, i) > 0)
{
sum += i * pow(2, i);
n -= pow(2, i);
i ++;
}
sum += n * i;
cout << sum;
return 0;
}
边栏推荐
- 01 QEMU starts the compiled image vfs: unable to mount root FS on unknown block (0,0)
- I was tortured by my colleague's null pointer for a long time, and finally learned how to deal with null pointer
- Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
- *. No main manifest attribute in jar
- Katalon使用script实现查询List大小
- [book club issue 13] packaging format of video files
- Confession code collection, who says program apes don't understand romance
- 【微服务|openfeign】使用openfeign远程调用文件上传接口
- ROS2中CMake编译选项的设置
- VIM mapping command
猜你喜欢
The maximum expiration time of client secret in azure ad application registration is modified to 2 years
LNK2038 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MDd_DynamicDebug”(main.obj 中)
Restore the subtlety of window position
【罗技】m720
leetcode刷题:二叉树05(翻转二叉树)
02 ls 命令的具体实现
Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
Tcp- simple understanding of three handshakes and four waves
Redis:集合Set类型数据的操作命令
Flink learning 6: programming model
随机推荐
Huawei cloud Kunpeng engineer training (Guangxi University)
精品网址导航主题整站源码 wordpress模板 自适应手机端
统计遗传学:第三章,群体遗传
[webrtc] M98 Ninja build and compile instructions
SDP中的SPA
tdk-lambda电源主要应用
vim正确加区间注释
2020 Bioinformatics | TransformerCPI
Flink learning 7: application structure
Katalon中控件的参数化
浅谈一篇优质的小红书文案需要具备什么
架构实战营 - 第 6 期 模块九之毕业设计
Keysight N9320B射频频谱分析仪解决轮胎压力监测方案
[book club issue 13] packaging format of video files
C语言单向链表练习
What does software testing do? Find defects and improve the quality of software
Configuration and hot update of nocturnal simulator in hbuildx
(指针)编写函数void fun(int x,int *pp,int *n)
How to add custom API objects in kubernetes (1)
北漂程序员,月薪20K,一年攒15W,正常吗?