B - The Large Family+暴力枚举
来源:互联网 发布:淘宝网app客户端 编辑:程序博客网 时间:2024/06/06 04:39
代码如下:
#include<iostream>#include<cstdio>#include<cstring>using namespace std;int main(){ int G; while(cin>>G) { if(!G) break; int k=G*2; int n1=(k-2)/7; int n2=(k+2)/7; double ans; int t=k/7; if(k-7*n1-2<k-7*n2+2) { if(k-7*t<k-7*n1-2) { printf("%.1lf ",(k-7*t)*0.5); printf("%.1lf %.1lf %.1lf\n",t*0.5,t*0.5,t*0.5); continue; } printf("%.1lf ",(k-7*n1-2)*0.5); printf("%.1lf %.1lf %.1lf\n",(n1+1)*0.5,(n1+1)*0.5,n1*0.5); } else { if(k-7*t<k-7*n2+2) { printf("%.1lf ",(k-7*t)*0.5); printf("%.1lf %.1lf %.1lf\n",t*0.5,t*0.5,t*0.5); continue; } printf("%.1lf ",(k-7*n2+2)*0.5); printf("%.1lf %.1lf %.1lf\n",(n2-1)*0.5,(n2-1)*0.5,n2*0.5); } } return 0;}
0 0
- B - The Large Family+暴力枚举
- CF 558B Amr and The Large Array(暴力法)
- Codeforces Round #312 (Div. 2)-B. Amr and The Large Array-暴力
- cf 551B 暴力枚举
- codeforces 724B 暴力+枚举
- CodeForces 724B(暴力枚举)
- Educational Codeforces Round 22-B. The Golden Age-暴力枚举+map
- B. Amr and The Large Array
- B-codeforces558B-Amr and The Large Array
- (CF)B. Restore Cube (暴力枚举判断)
- 枚举暴力 cf B. Preparing Olympiad
- CF#368 B. Bakery (暴力枚举)
- Codeforces 724B Batch Sort(暴力枚举)
- Codeforces 724B Batch Sort【暴力枚举】
- Wannafly挑战赛6 B比赛【暴力枚举】
- codeforces #312 B B. Amr and The Large Array(统计)
- poj 1166 The Clocks 暴力枚举
- UVA 105 - The Skyline Problem(暴力枚举)
- 实现蝴蝶翩翩飞舞的效果
- Notepad++不打开最近打开的文件
- 《私房菜》3rd 笔记0. 目录
- Best Time to Buy and Sell Stock
- linux中断--内核中断编程
- B - The Large Family+暴力枚举
- SDWebImage的使用
- TCP/IP数据包格式详解-包括数据链路层的头部
- linux中断--中断嵌套&中断请求丢失
- Hbase简介
- cocos2dx添加第三方库注意事项
- linux中断--中断下半部机制的使用 & 中断编程
- 简单几步教你实现对 Drawable 的扇形区域剪切显示
- oracle 笔记 (一)