2017 多校系列 1
来源:互联网 发布:淘宝店铺绑定 编辑:程序博客网 时间:2024/05/24 01:47
Add More Zero
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 303 Accepted Submission(s): 224
Problem Description
There is a youngster known for amateur propositions concerning several mathematical hard problems.
Nowadays, he is preparing a thought-provoking problem on a specific type of supercomputer which has ability to support calculations of integers between0 and (2m−1) (inclusive).
As a young man born with ten fingers, he loves the powers of10 so much, which results in his eccentricity that he always ranges integers he would like to use from 1 to 10k (inclusive).
For the sake of processing, all integers he would use possibly in this interesting problem ought to be as computable as this supercomputer could.
Given the positive integerm , your task is to determine maximum possible integer k that is suitable for the specific supercomputer.
Nowadays, he is preparing a thought-provoking problem on a specific type of supercomputer which has ability to support calculations of integers between
As a young man born with ten fingers, he loves the powers of
For the sake of processing, all integers he would use possibly in this interesting problem ought to be as computable as this supercomputer could.
Given the positive integer
Input
The input contains multiple test cases. Each test case in one line contains only one positive integer m , satisfying 1≤m≤105 .
Output
For each test case, output "Case #x : y " in one line (without quotes), where x indicates the case number starting from 1 and y denotes the answer of corresponding case.
Sample Input
164
Sample Output
Case #1: 0Case #2: 19
Source
2017 Multi-University Training Contest - Team 1
Recommend
liuyiding | We have carefully selected several similar problems for you: 6044 6043 6042 6041 6040
题意:给你一个m,然后问你2的m次方减一是10的几次方,求k
题解:两边取对数,然后近似求解就好了,水题一枚。
ac code:
#include <iostream>#include <cstdio>#include <cstring>#include <string>#include <cstdlib>#include <cmath>#include <vector>#include <list>#include <deque>#include <queue>#include <iterator>#include <stack>#include <map>#include <set>#include <algorithm>#include <cctype>using namespace std;#define si1(a) scanf("%d",&a)#define si2(a,b) scanf("%d%d",&a,&b)#define sd1(a) scanf("%lf",&a)#define sd2(a,b) scanf("%lf%lf",&a,&b)#define ss1(s) scanf("%s",s)#define pi1(a) printf("%d\n",a)#define pi2(a,b) printf("%d %d\n",a,b)#define mset(a,b) memset(a,b,sizeof(a))#define forb(i,a,b) for(int i=a;i<b;i++)#define ford(i,a,b) for(int i=a;i<=b;i++)typedef long long LL;const int N=1100001;const int M=6666666;const int INF=0x3f3f3f3f;const double PI=acos(-1.0);const double eps=1e-7;int m;int main(){ int cas=0; while(~si1(m)) { int k=(int)m*(log10(2));//减一可以近似约掉,毕竟m越大,感觉不怎么影响 printf("Case #%d: %d\n",++cas,k); } return 0;}
KazaQ's Socks
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 248 Accepted Submission(s): 165
Problem Description
KazaQ wears socks everyday.
At the beginning, he hasn pairs of socks numbered from 1 to n in his closets.
Every morning, he puts on a pair of socks which has the smallest number in the closets.
Every evening, he puts this pair of socks in the basket. If there aren−1 pairs of socks in the basket now, lazy KazaQ has to wash them. These socks will be put in the closets again in tomorrow evening.
KazaQ would like to know which pair of socks he should wear on thek -th day.
At the beginning, he has
Every morning, he puts on a pair of socks which has the smallest number in the closets.
Every evening, he puts this pair of socks in the basket. If there are
KazaQ would like to know which pair of socks he should wear on the
Input
The input consists of multiple test cases. (about 2000 )
For each case, there is a line contains two numbersn,k (2≤n≤109,1≤k≤1018) .
For each case, there is a line contains two numbers
Output
For each test case, output "Case #x : y " in one line (without quotes), where x indicates the case number starting from 1 and y denotes the answer of corresponding case.
Sample Input
3 73 64 9
Sample Output
Case #1: 3Case #2: 1Case #3: 2
Source
2017 Multi-University Training Contest - Team 1
Recommend
liuyiding | We have carefully selected several similar problems for you: 6044 6043 6042 6041 6040
题意:有n双袜子,每天从篮子里拿出号码最小的一双来穿(号码从1到n),当已经穿了n-1双时就要开始洗袜子,到第二天晚上才能放回篮子里。问你第k天穿几号袜子。
题解:找规律,列一下n=3,n=4,n=5看一下就知道了(基本列到9天差不多规律就有了)
ac code:
#include <iostream>#include <cstdio>#include <cstring>#include <string>#include <cstdlib>#include <cmath>#include <vector>#include <list>#include <deque>#include <queue>#include <iterator>#include <stack>#include <map>#include <set>#include <algorithm>#include <cctype>using namespace std;#define si1(a) scanf("%d",&a)#define si2(a,b) scanf("%d%d",&a,&b)#define sd1(a) scanf("%lf",&a)#define sd2(a,b) scanf("%lf%lf",&a,&b)#define ss1(s) scanf("%s",s)#define pi1(a) printf("%d\n",a)#define pi2(a,b) printf("%d %d\n",a,b)#define mset(a,b) memset(a,b,sizeof(a))#define forb(i,a,b) for(int i=a;i<b;i++)#define ford(i,a,b) for(int i=a;i<=b;i++)typedef long long LL;const int N=1100001;const int M=6666666;const int INF=0x3f3f3f3f;const double PI=acos(-1.0);const double eps=1e-7;LL n;LL k;int main(){ int cas=0; while(~scanf("%lld%lld",&n,&k)) { if(k<=n) { printf("Case #%d: %d\n",++cas,k); continue; } k=(k-n)%(2*(n-1)); if(k==0) printf("Case #%d: %d\n",++cas,n); else if(k<=n-1) printf("Case #%d: %d\n",++cas,k); else { k=k%(n-1); printf("Case #%d: %d\n",++cas,k); } } return 0;}
阅读全文
0 0
- 2017 多校系列 1
- 2017 多校系列 2
- 2017 多校系列 3
- 2017 多校系列 4
- 2017 多校系列 5
- 2017 多校系列 6
- NetSNS二次开发系列1--文章系列简介
- MEF学习系列笔记系列(1)
- ○ 多客系列
- StrutsCatalog系列(1)--BaseAction
- struts2系列之1
- 考研系列1
- GeoRSS 学习系列(1)
- MACD系列1
- ORACLE 入门系列(1)
- Learning python 系列1
- ajax系列教程(1)
- Microwindow系列(1)--移植
- HDU 6033 Add More Zero (数学)
- Python的进程与线程
- 懂得这些,才能在软测岗位上活下去
- 1.1 C# 基本类型
- bzoj3289 Mato的文件管理 莫队+树状数组
- 2017 多校系列 1
- GreenDao3.0 完整版(零了解使用)
- echarts的笔记
- 初识TCP/IP及使用套接字进行网络编程
- linux中的正则表达式和通配符
- [LeetCode] 89. Gray Code
- POI入门
- hdu1037 Keep on Truckin'(C语言)
- 最小生成树: HDU1233还是畅通工程