CF #329 C
C题我还以为是拉格朗日插值。。。
其实可以想象到,必须有这样一个函数,经过某一点时,其它圆相关的函数要为0。
于是,可以构造这样的一个函数,对于x有 (x/2)*(1-abs(t-i)+abs(1-abs(t-i)))
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <set>
#include <map> using namespace std; #define LL __int64
#define PB push_back
#define P pair<int, int>
#define X first
#define Y second
const int N = 55;
P a[N]; int main() {
int n;
scanf("%d", &n);
int r;
for(int i = 0; i < n; ++i) {
scanf("%d%d%d", &a[i].X, &a[i].Y, &r);
}
string left = "(((1-abs((t-", mid = ")))+abs((abs((t-", right = "))-1)))";
string ans1 = "";
string ans2 = "";
for(int i = 0; i < n - 1; ++i) {
ans1 += "(";
ans2 += "(";
}
for(int i = 0; i < n; ++i) {
string num = to_string(i);
ans1 += left + num + mid + num + right + "*" + to_string(a[i].X / 2) + ")";
ans2 += left + num + mid + num + right + "*" + to_string(a[i].Y / 2) + ")";
if(i != 0) ans1 += ")", ans2 += ")";
if(i != n - 1) ans1 += "+", ans2 += "+";
}
cout<<ans1<<endl;
cout<<ans2<<endl;
return 0;
}
CF #329 C的更多相关文章
- CF #329 D
D题,LCA是很明显的.要注意的是,因为是除法,所以最多可以除x>2的有64次,当大于64时可以直接返回0.而且注意到可能会有很多值为1的边,可以使用路径压缩,把边为1的边压缩掉,类似于并查集的 ...
- ORA-00494: enqueue [CF] held for too long (more than 900 seconds) by 'inst 1, osid 5166'
凌晨收到同事电话,反馈应用程序访问Oracle数据库时报错,当时现场现象确认: 1. 应用程序访问不了数据库,使用SQL Developer测试发现访问不了数据库.报ORA-12570 TNS:pac ...
- cf之路,1,Codeforces Round #345 (Div. 2)
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... ...
- cf Round 613
A.Peter and Snow Blower(计算几何) 给定一个点和一个多边形,求出这个多边形绕这个点旋转一圈后形成的面积.保证这个点不在多边形内. 画个图能明白 这个图形是一个圆环,那么就是这个 ...
- ARC下OC对象和CF对象之间的桥接(bridge)
在开发iOS应用程序时我们有时会用到Core Foundation对象简称CF,例如Core Graphics.Core Text,并且我们可能需要将CF对象和OC对象进行互相转化,我们知道,ARC环 ...
- [Recommendation System] 推荐系统之协同过滤(CF)算法详解和实现
1 集体智慧和协同过滤 1.1 什么是集体智慧(社会计算)? 集体智慧 (Collective Intelligence) 并不是 Web2.0 时代特有的,只是在 Web2.0 时代,大家在 Web ...
- CF memsql Start[c]UP 2.0 A
CF memsql Start[c]UP 2.0 A A. Golden System time limit per test 1 second memory limit per test 256 m ...
- CF memsql Start[c]UP 2.0 B
CF memsql Start[c]UP 2.0 B B. Distributed Join time limit per test 1 second memory limit per test 25 ...
- CF #376 (Div. 2) C. dfs
1.CF #376 (Div. 2) C. Socks dfs 2.题意:给袜子上色,使n天左右脚袜子都同样颜色. 3.总结:一开始用链表存图,一直TLE test 6 (1)如果需 ...
随机推荐
- [Swift通天遁地]九、拔剑吧-(7)创建旋转和弹性的页面切换效果
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...
- flex中align-content属性
在flex弹性盒模型中align-content属性控制容器内多行在交叉轴上的排列方式 默认值:stretch 可用值: 属性值:flex-start 属性值:flex-end 属性值:center ...
- Laravel5.1学习笔记17 数据库3 数据迁移
介绍 建立迁移文件 迁移文件结构 执行迁移 回滚迁移 填写迁移文件 创建表 重命名/ 删除表 创建字段 修改字段 删除字段 建立索引 删除索引 外键约束 #介绍 Migrations are lik ...
- Xml的读取
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace WebAp ...
- 来自一个用户的体验-Alpha项目测试
软件梦之队成员:201731062305 周蓉 这个作业属于哪个课程 <课程的链接> 这个作业要求在哪里 <作业要求的链接> 团队名称 <软件梦之队>(附上团队博客 ...
- [转]STL之list容器详解
List 容器 list是C++标准模版库(STL,Standard Template Library)中的部分内容.实际上,list容器就是一个双向链表,可以高效地进行插入删除元素. 使用list容 ...
- html——特殊字符
- 在PHP中调用php_ssh实现远程登陆linux服务器并执行shell脚本。
这个功能主要用于在web端利用程序对远程服务器进行操作,通过PHP_ssh执行shell脚本来实现. 首先要安装php_ssh2组件,linux中centos7下有ssh2源,直接安装.window下 ...
- js 获取 鼠标位置 和获取元素位置
]; body.addEventListener("mousemove", outpostion); function outpostion() { console.log(&qu ...
- hint: not have locally. This is usually caused by another repository pushing
git 提交代码前先pull代码,否则会报如下错误 wangju@wangju-HP-348-G4:~/test/reponselogiccheck$ git statusOn branch mast ...