Deck

Deck

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 1761    Accepted Submission(s): 1031


Problem Description
A single playing card can be placed on a table, carefully, so that the short edges of the card are parallel to the table's edge, and half the length of the card hangs over the edge of the table. If the card hung any further out, with its center of gravity off the table, it would fall off the table and flutter to the floor. The same reasoning applies if the card were placed on another card, rather than on a table. 

Two playing cards can be arranged, carefully, with short edges parallel to table edges, to extend 3/4 of a card length beyond the edge of the table. The top card hangs half a card length past the edge of the bottom card. The bottom card hangs with on ly 1/4 of its length past the table's edge. The center of gravity of the two cards combined lies just over the edge of the table. 

Three playing cards can be arranged, with short edges parallel to table edges, and each card touching at most on e other card, to extend 11/12 of a card length beyond the edge of the table. The top two cards extend 3/4 of a card length beyond the edge of the bottom card, and the bottom card extends on ly 1/6 over the table's edge; the center of gravity of the three cards lines over the edges of the table. 

If you keep stacking cards so that the edges are aligned and every card has at most on e card above it and on e below it, how far out can 4 cards extend over the table's edge? Or 52 cards? Or 1000 cards? Or 99999?
 

Input
Input contains several nonnegative integers, on e to a line. No integer exceeds 99999.
 

Output
The standard output will contain, on successful completion of the program, a heading: 

# Cards Overhang 

(that's two spaces between the words) and, following, a line for each input integer giving the length of the longest overhang achievable with the given number of cards, measured in cardlengths, and rounded to the nearest thousandth. The length must be expressed with at least on e digit before the decimal point and exactly three digits after it. The number of cards is right-justified in column 5, and the decimal points for the lengths lie in column 12.
 

Sample Input
  
  
1 2 3 4 30
 

Sample Output
  
  
The line of digits is intended to guide you in proper output alignment, and is not part of the output that your solution should produce. 12345678901234567 # Cards Overhang 1 0.500 2 0.750 3 0.917 4 1.042 30 1.997
题目虽然很长,但这题真是没意思,浪费时间。。。就是求1/2+1/4+1/6...
#include <stdio.h> #include <stdlib.h> int main() { int n,i; int flag=1; while(scanf("%d",&n)!=EOF) { if(flag==1) { printf("# Cards Overhang\n"); flag=0; } double s=0; for(i=1;i<=n;i++) { s=s+1.0/(double)(2*i); } printf("%5d %.3lf\n",n,s); } return 0; }
### 如何加密 Deck 文件或数据 在讨论如何加密 Deck 文件或数据之前,需明确 Deck 是指 Nextcloud 的开源项目 **Deck** 还是指其他类型的文件。假设此处指的是 Nextcloud Deck,则可以通过以下几种方式进行加密: #### 1. 使用 Nextcloud 自带的端到端加密功能 Nextcloud 提供了内置的端到端加密机制,能够保护存储的数据和元数据。启用此功能后,所有与 Deck 相关的内容(卡片、列表等)都会受到保护[^2]。 ```bash sudo -u www-data php occ app:enable encryption ``` 运行以上命令可激活 Nextcloud 的加密应用。之后,管理员需要配置密钥管理器并为用户提供个人加密密钥。 #### 2. 对数据库中的 Deck 数据进行额外加密 如果希望更深入地保护 Deck 存储的数据,可以选择对 MySQL/MariaDB 或 PostgreSQL 数据库中的表字段实施透明数据加密 (TDE)[^2]。以下是针对 MariaDB 启用 TDE 的示例代码: ```sql ALTER TABLE `oc_deck_cards` ENCRYPTION='Y'; ALTER TABLE `oc_deck_stacks` ENCRYPTION='Y'; ALTER TABLE `oc_deck_boards` ENCRYPTION='Y'; ``` 这些 SQL 命令会分别对卡牌、堆栈以及看板对应的表格开启硬件级别的加密支持。 #### 3. 利用 PHP 平台提供的 SG 加密技术处理导出的 JSON 数据 当用户决定备份或者迁移其 Deck 数据时,通常是以 JSON 格式的字符串形式存在。此时可以借助像 php.javait.cn 所述的服务来运用 SG 多级加密手段增强安全性[^3]。 例如,在本地环境中编写一段简单的脚本实现基本操作如下所示: ```php <?php // 导入必要的类库... require_once 'vendor/autoload.php'; use Phpjavait\Encryptor; $encryptor = new Encryptor(); $dataToProtect = file_get_contents('path/to/deck_export.json'); $cipherText = $encryptor->sg_encrypt($dataToProtect, 16); // 设置最高级别16 file_put_contents('secure_deck_data.txt', $cipherText); ?> ``` 这样生成的新文件就包含了经过高强度算法转换过的信息,即使被非法获取也很难解读原始内容。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值