11384 - Help is needed for Dexter 模拟 98

简介:

   分治法

/*
author:jxy
lang:C/C++
university:China,Xidian University
**If you need to reprint,please indicate the source**
*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
int org[10001];
int f(int now)
{
    if(now>10000)
        return f(now>>1)+1;
    if(org[now])return org[now];
    return org[now]=f(now>>1)+1;
}
int main()
{
    int n;
    memset(org,0,sizeof(org));
    org[1]=1;
    while(~scanf("%d",&n))
    {
        printf("%d\n",f(n));
    }
}


目录
相关文章
|
C++
如何使用MACS进行peak calling
MACS2是peak calling最常用的工具。 callpeak用法 这是MACS2的主要功能,因为MACS2的目的就是找peak,其他功能都是可有可无,唯独callpeak不可取代。
3705 0
Flutter之运行提示Could not update files on device: Connection closed before full header was received
Flutter之运行提示Could not update files on device: Connection closed before full header was received
695 0
|
6月前
|
iOS开发 MacOS
mac AnyConnect 连接报错 Posture Assessment Failed: Hostscan Initialize error.
mac AnyConnect 连接报错 Posture Assessment Failed: Hostscan Initialize error.
112 1
mac AnyConnect 连接报错 Posture Assessment Failed: Hostscan Initialize error.
|
6月前
|
Rust 小程序
小程序警告:Now you can provide attr wxkey for a wxfor to improve performance
首先,无论什么程序,控制台中的警告都是会影响程序性能的。我们需要减少此类警告的出现,以提高程序的运行性能。 小程序开发的时候,遇到了如下的警告:
88 0
Optimization loop failed: Cancelled: Operation was cancelled解决方案
Optimization loop failed: Cancelled: Operation was cancelled解决方案
258 0
Optimization loop failed: Cancelled: Operation was cancelled解决方案
|
开发工具 Android开发
解决bug:使用Genymotion模拟器时,出现Unable to create virtual device: Connection timeout occurred
解决bug:使用Genymotion模拟器时,出现Unable to create virtual device: Connection timeout occurred
128 0
解决bug:使用Genymotion模拟器时,出现Unable to create virtual device: Connection timeout occurred
Appium问题解决方案(10)- Original error: Swipe did not complete successfully
Appium问题解决方案(10)- Original error: Swipe did not complete successfully
116 0
Appium问题解决方案(10)- Original error: Swipe did not complete successfully
|
测试技术 数据库 关系型数据库
ORA-03113: end-of-file on communication channel 解决思路&方法
场景:测试数据库的hang住问题。 长期解决的方法:定时做rman备份,删除归档日志 1.把数据库启动至mount状态 SQL> startup mount ORACLE instance started.
2429 0
PAT (Advanced Level) Practice - 1122 Hamiltonian Cycle(25 分)
PAT (Advanced Level) Practice - 1122 Hamiltonian Cycle(25 分)
98 0
[swscaler] Warning: data is not aligned! This can lead to a speedloss 的解决方法【FFmpeg】
[swscaler] Warning: data is not aligned! This can lead to a speedloss 的解决方法【FFmpeg】
664 0
[swscaler] Warning: data is not aligned! This can lead to a speedloss 的解决方法【FFmpeg】