Problem 2909 --3.2.2 Stringsobits

2909: 3.2.2 Stringsobits

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $6$ 正确数量 $2$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 usaco

Consider an ordered set S of strings of N (1 <= N <= 31) bits. Bits, of course, are either 0 or 1.

This set of strings is interesting because it is ordered and contains all possible strings of length N that have L (1 <= L <= N) or fewer bits that are `1'.

Your task is to read a number I (1 <= I <= sizeof(S)) from the input and print the Ith element of the ordered set for N bits with no more than L bits that are `1'.


A single line with three space separated integers: N, L, and I.

A single line containing the integer that represents the Ith element from the order set, as described.

5 3 19
10011

推荐代码 查看2909 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] 梦尘 694971 2020-12-30 23:12:22
内存最少[$1716 $KB] 梦尘 694971 2020-12-30 23:12:22
第一AC 淡意的温柔 596512 2020-06-12 16:54:41
第一挑战 找队友,能刷题的那种 469931 2019-09-18 16:27:23

赛题来源/所属竞赛 usaco training usaco Training

竞赛编号 竞赛名称 竞赛时间 访问比赛