AlgorithmOJ
Problem
Local Problems
All Problems
Problem Category
Status
Contest
Standard Contests
Replay Contests
Virtual Contests
Ranklist
More...
News
About
F.A.Q
Recent Contests
Coming Soon...
Login
Register
2026-11-01 06:41:00
JZP Set
Time Limit:
5000ms
Memory Limit:
256000KB
This problem will be judged on
HDU
. Original ID:
4834
64-bit integer IO format:
%I64d
Java class name:
Main
Prev
Submit
Status
Statistics
Next
Font Size:
Description
一个{1, ..., n}的子集S被称为JZP集,当且仅当对于任意S中的两个数x,y,若(x+y)/2为整数,那么(x+y)/2也属于S。
例如,n=3,S={1,3}不是JZP集,因为(1+3)/2=2不属于S。但是{1,2,3}的其他子集都属于S,所以n=3时有7个JZP集
给定n,求JZP集的个数。
Input
第一行为T,表示输入数据组数。
每组数据包含一行整数n。
限制条件
1<=T<=10^5
1<=n<=10^7
Output
对第i组数据,输出
Case #i:
然后输出JZP集的个数。
Sample Input
3 1 2 3
Sample Output
Case #1: 2 Case #2: 4 Case #3: 7
Source
2014年百度之星程序设计大赛 - 初赛(第二轮)
Language:
C++
C++11
C++14
C
Java
Pascal
Python2
Python3
C#
Fortran
Perl
Ruby
Ada
SML
Visual C++
Visual C
CLang
CLang++
Theme:
Monokai
Solarized Light
Material
Share Code?
Yes
No
×
Login
Username:
Password:
Cookie:
Never
One Day
One Week
One Month
One Year
×
Register
Username:
Password:
Repeat Password:
Nickname:
School:
Email:
×
News Title
by