当前位置:网站首页>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;
}边栏推荐
- RHCSA 04 - 进程管理
- Flink learning 7: application structure
- (指针)自己写一个比较字符串大小的函数,功能与strcmp类似。
- Msgraphmailbag - search only driveitems of file types
- DP83848+网线热拔插
- ModStartBlog 现代化个人博客系统 v5.2.0 源码下载
- ROS2中CMake编译选项的设置
- (指针)编写函数void fun(int x,int *pp,int *n)
- 毕业设计项目
- 01 qemu 启动编译好的镜像 VFS: Unable to mount root fs on unknown-block(0,0)
猜你喜欢

Flink学习7:应用程序结构

Unity draws the trajectory of pinball and billiards

ctf-pikachu-XSS

02 ls 命令的具体实现

leetcode刷题:二叉树05(翻转二叉树)

分布式系统:what、why、how

*. No main manifest attribute in jar

Msgraphmailbag - search only driveitems of file types

What does software testing do? Find defects and improve the quality of software

leetcode刷题:二叉树04(二叉树的层序遍历)
随机推荐
毕业设计项目
Rhcsa-- day one
Programmers' telecommuting is mixed | community essay solicitation
leetcode刷题:二叉树06(对称二叉树)
Global exposure and roller shutter exposure of industrial cameras
The interactive solution of JS and app in the H5 page embedded in app (parameters can be transferred and callbacks can be made)
微信脑力比拼答题小程序_支持流量主带最新题库文件
深度优先搜索简要讲解(附带基础题)
浅谈一篇优质的小红书文案需要具备什么
Redis cluster uses Lua script. Lua script can also be used for different slots
2021 RSC | Drug–target affinity prediction using graph neural network and contact maps
普源DS1000Z系列数字示波器在通信原理实验中的应用方案
Katalon中控件的参数化
leetcode 121 Best Time to Buy and Sell Stock 买卖股票的最佳时机(简单)
Leetcode skimming: binary tree 09 (minimum depth of binary tree)
[webrtc] M98 Ninja build and compile instructions
idea修改主体颜色
[book club issue 13] packaging format of video files
如何远程办公更有效率 | 社区征文
(pointer) write a function to compare the size of strings by yourself, which is similar to StrCmp.