当前位置:网站首页>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;
}边栏推荐
- VIM mapping command
- tdk-lambda电源主要应用
- C语言双向链表初版
- Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
- 微信脑力比拼答题小程序_支持流量主带最新题库文件
- 02 specific implementation of LS command
- 还原窗口位置的微妙之处
- 2020 Bioinformatics | TransformerCPI
- 三年进账35.31亿,这个江西老表要IPO了
- Pytest multi process / multi thread execution test case
猜你喜欢

The difference between bagging and boosting in machine learning

NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线

The maximum expiration time of client secret in azure ad application registration is modified to 2 years

02 specific implementation of LS command

指针数组和数组指针

Flink学习8:数据的一致性

PPt 教程,如何在 PowerPoint 中将演示文稿另存为 PDF 文件?

User defined path and file name of Baidu editor in laravel admin

Restore the subtlety of window position

ctf-pikachu-XSS
随机推荐
Flink learning 6: programming model
普源DS1000Z系列数字示波器在通信原理实验中的应用方案
华为云鲲鹏工程师培训(广西大学)
leetcode刷题:二叉树04(二叉树的层序遍历)
leetcode刷题:二叉树05(翻转二叉树)
ctf-pikachu-XSS
ctf-pikachu-XSS
PPt 教程,如何在 PowerPoint 中将演示文稿另存为 PDF 文件?
【读书会第十三期】多媒体处理工具 FFmpeg 工具集
Common methods of threads
量子力学习题
Unity 绘制弹球和台球的运动轨迹
(pointeur) Écrivez - vous une fonction qui compare la taille de la chaîne et fonctionne comme strcmp.
DP83848+网线热拔插
Leetcode skimming: binary tree 04 (sequence traversal of binary tree)
毕业设计:设计秒杀电商系统
The interactive solution of JS and app in the H5 page embedded in app (parameters can be transferred and callbacks can be made)
Lnk2038 detected a mismatch of "runtimelibrary": the value "md_dynamicrelease" does not match the value "mdd_dynamicdebug" (in main.obj)
There is a problem that the package cannot be parsed in the like project
(指针)编写函数void fun(int x,int *pp,int *n)