A. Number Theory Problem
题目大意:计算小于2^n,且满足2^k-1并且是7的倍数的个数
思路:优先打表,数据不大,1e5,然后求个前n项和
#include<bits/stdc++.h>
using namespace std;
const int N=1E5+;
int arr[N]; void inint(int x){
int t=;
for(int i=;i<=x;i++){
t<<=;
t%=;
if(t==) arr[i]=;
} for(int i=;i<=x;i++) arr[i]=arr[i]+arr[i-];
} void solve(int xx){
int n;
cin>>n;
printf("Case #%d: %d\n",xx,arr[n]);
}
int main(){
inint(N);
int n;
cin>>n;
for(int i=;i<=n;i++) solve(i);
return ;
}
A. Number Theory Problem的更多相关文章
- [E. Ehab's REAL Number Theory Problem](https://codeforces.com/contest/1325/problem/E) 数论+图论 求最小环
E. Ehab's REAL Number Theory Problem 数论+图论 求最小环 题目大意: 给你一个n大小的数列,数列里的每一个元素满足以下要求: 数据范围是:\(1<=a_i& ...
- 题解-Ehab's REAL Number Theory Problem
Ehab's REAL Number Theory Problem 前置知识 质数 分解质因数 无向无权图最小环<讲> Ehab's REAL Number Theory Problem/ ...
- Number Theory Problem(The 2016 ACM-ICPC Asia China-Final Contest 找规律)
题目: Mr. Panda is one of the top specialists on number theory all over the world. Now Mr. Panda is in ...
- Gym 101194A / UVALive 7897 - Number Theory Problem - [找规律水题][2016 EC-Final Problem A]
题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?opti ...
- How to solve the SVDI SN Number Display Problem
Yesterday we have learn how to find the SVDI Serial Number, today one of customer from UK look our a ...
- 2016级算法第二次上机-F.ModricWang's Number Theory II
891 ModricWang's Number Theory II 思路 使得序列的最大公约数不为1,就是大于等于2,就是找到一个大于等于2的数,它能够整除序列中的所有数. 考虑使得一个数d整除数组中 ...
- 【BZOJ4026】dC Loves Number Theory 分解质因数+主席树
[BZOJ4026]dC Loves Number Theory Description dC 在秒了BZOJ 上所有的数论题后,感觉萌萌哒,想出了这么一道水题,来拯救日益枯竭的水题资源. 给 ...
- BZOJ_4026_dC Loves Number Theory _主席树+欧拉函数
BZOJ_4026_dC Loves Number Theory _主席树+欧拉函数 Description dC 在秒了BZOJ 上所有的数论题后,感觉萌萌哒,想出了这么一道水题,来拯救日益枯 竭 ...
- UESTC_方老师和农场 2015 UESTC Training for Graph Theory<Problem L>
L - 方老师和农场 Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submi ...
随机推荐
- hdu1455 拼木棍(经典dfs)
给定木棍序列,求解能将木棍拼成相同长度的数根长木棍的情况下长木棍长度的最小值. /*hdu1455dfs */ #include<bits/stdc++.h> using namespac ...
- body体里面传///貌似jmeter不支持
原因是:当接口请求参数含\\\时请求到服务器端是\\,少了一个\导致参数不合法报错:求助一个大神说是 因为如标题 : 解决如上图所示,完美解决
- 【西北大学集训队选拔赛】D温暖的签到题(自创数据结构)
题目链接 #include <bits/stdc++.h> #define NUM #define ll long long using namespace std; int n, m; ...
- Go语言库系列之flag
背景 终端(命令行)操作是程序员的必备技能,但是你知道怎么通过golang制作出如下命令吗? $ flag girl -h Usage of girl: -height int 身高 (default ...
- Hinton老爷子CapsNet再升级,结合无监督,接近当前最佳效果
2017 年,Geoffrey Hinton 在论文<Dynamic Routing Between Capsules>中提出 CapsNet 引起了极大的关注,同时也提供了一个全新的研究 ...
- css 动画 transition和animation
本文参考:http://www.ruanyifeng.com/blog/2014/02/css_transition_and_animation.html 1. transition基本用法: < ...
- MyBatis 教程 ——检视阅读
MyBatis 教程 --检视阅读 准备 官网文档-中文 教程地址yiibai,质量很差 教程地址w3cschool,纯理论,还不如直接看官网文档 教程地址Mybatis框架入门教程,Oracle M ...
- SringBoot整合velocity及常用语法
项目地址:https://github.com/chywx/springboot-velocity 背景 由于公司业务面向的是非洲市场 那边有些国家智能机并未普及,像乌干达地区还是以功能机为主 为了支 ...
- Bitmap之位图采样和内存计算详解
原文首发于微信公众号:躬行之(jzman-blog) Android 开发中经常考虑的一个问题就是 OOM(Out Of Memory),也就是内存溢出,一方面大量加载图片时有可能出现 OOM, 通过 ...
- 从 Linux 操作系统谈谈 IO 模型(终)
Linux 为什么要区分内核空间与用户空间? Linux 操作系统的 IO 模型有哪几种?有啥区别? 常说的阻塞现象,到底是咋回事? 网络编程研发时,那块到底耗时最多,代码是否还有优化空间? 前几期的 ...