CF 404B - Marathon
来源:互联网 发布:雅思考试经验知乎 编辑:程序博客网 时间:2024/04/29 11:24
a*4的正方形体育馆,逆时针counter-clockwise 每次跑d米,输出n个坐标。
把正方形看成一条长度4*a的线,开始在0,每次(len+d) % 4a。
根据len的长度分别在 (len%a,0);(a,len%a);(a-len%a);(0,a-len%a)这四个坐标
#include<stdio.h>#include<iostream>using namespace std;void print(double len,double a){int t=len/a;len-=t*a;if(t==0)printf("%lf %lf\n",len,0.0);else if(t==1)printf("%lf %lf\n",a,len);else if(t==2)printf("%lf %lf\n",a-len,a);elseprintf("%lf %lf\n",0.0,a-len);}int main(){double a,d;int n;cin>>a>>d>>n;double len=0,mod=4*a;while(n--){len+=d;int duo=len/mod;len-=duo*mod;print(len,a);}return 0;}
0 0
- CF 404B - Marathon
- codeforces 404B Marathon
- codeforces 404B - Marathon
- codeforces 404B Marathon
- code forces 404B Marathon
- B. Marathon
- 简单模拟 CodeForces - 404B Marathon
- codeforces 404B Marathon(模拟)
- codeforces B. Marathon
- cf-B
- cf B
- Codeforces Round #237 (Div. 2) / 404B Marathon (fmod或long long表示浮点)
- codeforces 404 B. Marathon、C. Restore Graph、D. Minesweeper 1D
- Codeforces Round #237 (Div. 2) 404B Marathon【精度】 好题!!!!
- Codeforces Round #237 (Div. 2) B. Marathon
- Marathon
- Marathon
- marathon
- 深入 char * ,char ** ,char a[ ] ,char *a[] 内核
- 让Android模拟器实现真机一样速度
- ubuntu12.04上的mongodb卸载
- 无向图的构建及深度优先遍历---邻接表实现
- iOS移植android的环境配置以及部分Bug
- CF 404B - Marathon
- 停在这里吧
- MySQL存储过程学习
- 长连接和短连接的区别
- matlab中的bwlabel函数
- 无法读取tomcat输出流的问题
- QMap QHash的选择
- 操作格子
- 查询2个list相同和不相同元素