A13224 | Display The Number
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
You have a large electronic screen which can display up to $998244353$ decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of $7$ segments which can be turned on and off to compose different digits. The following picture describes how you can display all $10$ decimal digits:

As you can see, different digits may require different number of segments to be turned on. For example, if you want to display $1$ , you have to turn on $2$ segments of the screen, and if you want to display $8$ , all $7$ segments of some place to display a digit should be turned on.
You want to display a really large integer on the screen. Unfortunately, the screen is bugged: no more than $n$ segments can be turned on simultaneously. So now you wonder what is the greatest integer that can be displayed by turning on no more than $n$ segments.
Your program should be able to process $t$ different test cases.

As you can see, different digits may require different number of segments to be turned on. For example, if you want to display $1$ , you have to turn on $2$ segments of the screen, and if you want to display $8$ , all $7$ segments of some place to display a digit should be turned on.
You want to display a really large integer on the screen. Unfortunately, the screen is bugged: no more than $n$ segments can be turned on simultaneously. So now you wonder what is the greatest integer that can be displayed by turning on no more than $n$ segments.
Your program should be able to process $t$ different test cases.
输入格式
The first line contains one integer $t$ ( $1 \le t \le 100$ ) — the number of test cases in the input.
Then the test cases follow, each of them is represented by a separate line containing one integer $n$ ( $2 \le n \le 10^5$ ) — the maximum number of segments that can be turned on in the corresponding testcase.
It is guaranteed that the sum of $n$ over all test cases in the input does not exceed $10^5$ .
Then the test cases follow, each of them is represented by a separate line containing one integer $n$ ( $2 \le n \le 10^5$ ) — the maximum number of segments that can be turned on in the corresponding testcase.
It is guaranteed that the sum of $n$ over all test cases in the input does not exceed $10^5$ .
输出格式
For each test case, print the greatest integer that can be displayed by turning on no more than $n$ segments of the screen. Note that the answer may not fit in the standard $32$ -bit or $64$ -bit integral data type.
输入输出样例
输入 #1
2 3 4
输出 #1
7 11
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted