模拟 URAL 1149 Sinus Dances
/*
模拟:找到规律分别输出就可以了,简单但是蛮有意思的
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
using namespace std; const int MAXN = 2e2 + ;
const int INF = 0x3f3f3f3f; void print_An(int n)
{
for (int i=; i<=n; ++i)
{
printf ("sin(%d", i);
if (i < n) printf ("%c", (i&) ? '-' : '+');
} for (int i=; i<=n; ++i) printf ("%c", ')');
} void work(int n)
{
for (int i=; i<n; ++i) printf ("%c", '(');
print_An (); printf ("%c%d", '+', n);
for (int i=n-, j=; i>=; --i)
{
printf ("%c", ')'); print_An (++j);
printf ("%c%d", '+', i);
}
puts ("");
} int main(void) //URAL 1149 Sinus Dances
{
// freopen ("F.in", "r", stdin); int n;
while (scanf ("%d", &n) == )
{
work (n);
} return ;
}
模拟 URAL 1149 Sinus Dances的更多相关文章
- Ural 1149 - Sinus Dances
Let An = sin(1–sin(2+sin(3–sin(4+…sin(n))…)Let Sn = (…(A1+n)A2+n–1)A3+…+2)An+1For given N print SN I ...
- Timus 1149. Sinus Dances 打印复杂公式
就是打印以下这两个复杂的式子: Let An = sin(1–sin(2+sin(3–sin(4+-sin(n))-) Let Sn = (-(A1+n)A2+n–1)A3+-+2)An+1 For ...
- 杭电ACM分类
杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
- URAL 2046 A - The First Day at School 模拟题
A - The First Day at SchoolTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudg ...
- URAL 1404. Easy to Hack! (模拟)
space=1&num=1404">1404. Easy to Hack! Time limit: 1.0 second Memory limit: 64 MB When Vi ...
- URAL 1993 This cheeseburger you don't need 模拟题
This cheeseburger you don't need 题目连接: http://acm.timus.ru/problem.aspx?space=1&num=1993 Descrip ...
- ural 2020 Traffic Jam in Flower Town(模拟)
2020. Traffic Jam in Flower Town Time limit: 1.0 secondMemory limit: 64 MB Having returned from Sun ...
- ural 2015 Zhenya moves from the dormitory(模拟)
2015. Zhenya moves from the dormitory Time limit: 1.0 secondMemory limit: 64 MB After moving from hi ...
随机推荐
- Linux下汇编语言学习笔记64 ---
这是17年暑假学习Linux汇编语言的笔记记录,参考书目为清华大学出版社 Jeff Duntemann著 梁晓辉译<汇编语言基于Linux环境>的书,喜欢看原版书的同学可以看<Ass ...
- FZU Problem 2132 LQX的作业 (数学题)
http://acm.fzu.edu.cn/problem.php?pid=2132 N个数已经排成非递减顺序,那么每次可以取 前m->n个在x前面.取前m个在x前面的概率是 C(n,m)*x^ ...
- I - Balancing Act POJ - 1655
Consider a tree T with N (1 <= N <= 20,000) nodes numbered 1...N. Deleting any node from the t ...
- Delphi ADO的Lookup类型字段的问题
关于ADO数据集控件中的Lookup类型字段,在其Lookupkeyfields属性指向的字段中存在NULL值的,就会出现'EOleException with message '发生未知错误',这个 ...
- apple applessd.sys error
http://bbs.feng.com/read-htm-tid-10242622.html
- how to read openstack code : routes
When coding a web system, you have to think about an important problem, how to map urls to logic. Op ...
- 使用Post方法模拟登陆爬取网页(转)
使用Post方法模拟登陆爬取网页 最近弄爬虫,遇到的一个问题就是如何使用post方法模拟登陆爬取网页.下面是极简版的代码: import java.io.BufferedReader; impor ...
- 【CV论文阅读】Deep Linear Discriminative Analysis, ICLR, 2016
DeepLDA 并不是把LDA模型整合到了Deep Network,而是利用LDA来指导模型的训练.从实验结果来看,使用DeepLDA模型最后投影的特征也是很discriminative 的,但是很遗 ...
- NA交换②
虚拟局域网VLAN的核心目的: 将一个大的网络划分为小的网络,也称为网络分片(Segementation):一个VLAN对应着一个广播域,最好对应一个网络子网(为VLAN间的路由作准备). ...
- 通过构建Cocoapods私有库进行组件化开发探索
专题一 一.创建私有索引库 选Github或者码云都可以,本例以Github为例.创建私有索引库用来作为自己组件库的索引: 二.本地添加私有索引库 添加:pod repo add 索引库名称 索引库地 ...