SGU 193.Chinese Girls' Amusement】的更多相关文章

/* 实际上就是求一个k,满足k<=n/2,且gcd(n,k)=1 如果n为奇数,k为[n/2] 如果n为偶数,k=n/2-1-(n/2)%2 */ #include <iostream> using namespace std; string s; void div2() { string t; int l = s.size() - 1, tem = s[0] - '0'; if (tem > 1) t += '0' + tem / 2; tem &= 1; for (i…
题目传送门 /* 杭电一题(ACM_steps 2.2.4)的升级版,使用到高精度: 这次不是简单的猜出来的了,求的是GCD (n, k) == 1 最大的k(1, n/2): 1. 若n是奇数,则k = (n-1) / 2: 2. 若n是偶数,讨论(n-1)/2 的奇偶性,若不是奇数,则是n/2-2: 详细解释(证明):http://www.xuebuyuan.com/1552889.html */ #include <cstdio> #include <iostream> #i…
A - Chinese Girls' Amusement Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) SubmitStatus Problem Description       You must have heard that the Chinese culture is quite different from that of Europe or Russia. So som…
 Chinese Girls' Amusement Time Limit:1000MS     Memory Limit:64000KB     64bit IO Format:%lld & %llu Submit Status Practice ACdream 1210 Description       You must have heard that the Chinese culture is quite different from that of Europe or Russia.…
Chinese Girls' Amusement Time Limit: 2000/1000MS (Java/Others)Memory Limit: 128000/64000KB (Java/Others) SubmitStatisticNext Problem Problem Description You must have heard that the Chinese culture is quite different from that of Europe or Russia. So…
Description       You must have heard that the Chinese culture is quite different from that of Europe or Russia. So some Chinese habits seem quite unusual or even weird to us.       So it is known that there is one popular game of Chinese girls. N gi…
You must have heard that the Chinese culture is quite different from that of Europe or Russia. So some Chinese habits seem quite unusual or even weird to us. So it is known that there is one popular game of Chinese girls. N girls stand forming a circ…
题意:有n个女孩围成一个圈从第1号女孩开始有一个球,可以往编号大的抛去(像传绣球一样绕着环来传),每次必须抛给左边第k个人,比如1号会抛给1+k号女孩.给出女孩的人数,如果他们都每个人都想要碰到球一次,那么这个k应该是多少(满足 1 ≤ K ≤ N/2 且 k必须尽量大)?   例如:n=7,那么1号开始拿球,抛球的顺序是 1, 4, 7, 3, 6, 2, 5, 1.  当球重新回到1女孩手中时,每个人刚好只玩了一次.注:这个数字相当大(3 ≤ N ≤ 102000) 思路: 方法(1): 暴…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1313 题目意思:有 N 个人(编号依次为1~N)围成一个圆圈,要求求出最大的 K (1 ≤ K ≤ N/2),表示从编号为1的人开始,将球传递给他后一个人数起的第K个人,第K个人又传递给往后数的第K个人......要求这样传递下去,且每个人都有机会接到球.也就是不存在当未使得全部人都接到一次球的情况下,某个人接收到两次以上的球. 详细的解题报告在这里: http:/…
http://acm.sgu.ru/problemset.php?contest=0&volume=1 101 Domino 欧拉路 102 Coprime 枚举/数学方法 103 Traffic Lights 最短路 104 Little Shop of Flowers 动态规划 105 Div 3 找规律 106 The Equation 扩展欧几里德 107 987654321 Problem 找规律 108 Self-numbers II 枚举+筛法递推 109 Magic of Dav…
开始套题训练,第一套ASC题目,记住不放过每一题,多独立思考. Problem A ZOJ 2313 Chinese Girls' Amusement 循环节 题意:给定n,为圆环长度,求k <= n/2,从1出发,每次顺时针方向走k步,即1->k+1->2*k+1,直到遇到一个已经走过的点结束,要求最终把所有点访问一遍,最后回到1,使得k尽量大. 代码: Problem B ZOJ 2314 Reactor Cooling 无源汇上下界网络流 题意:经典题,有上下界无源无汇的可行流,对…
SGU 125 题意:给你一个数组b[i][j],表示i,j的四周有多少个数字大于它的,问你能不能构造出一个a矩形 收获:dfs  + 剪枝 一行一行的dfs,然后第一行去枚举0-9,下一行判断当前选择能否满足上一行对应列的情况,可以的话就继续dfs #include<bits/stdc++.h> #define de(x) cout<<#x<<"="<<x<<endl; #define dd(x) cout<<#…
Note 2: Complain 1. The collection of Linkun's [1]: 1.1suck If someone says that something sucks, they are indicating that they think it is very bad. [V] [feelings] [Informal] [RUDE]E.g., The system sucks. 1.2sick and tired of ... 1.3terrible 1.4horr…
环境: mysql:mysql-5.1.65 centos:centos 6.5 编译命令: gcc -o chinesetopinyin chinesetopinyin.c -L/usr/lib/mysql -lmysqlclient -I/usr/include/mysql 源代码: #include <mysql/mysql.h> #include <stdio.h> #include <string.h> void ChineseToPinyin(char *p…
  文房四宝 笔墨纸砚是中国古代文人书房中必备的宝贝,被称为“文房四宝”.用笔墨书写绘画在 中国可追溯到五千年前.秦(前221---前206)时已用不同硬度的毛和竹管制笔:汉代(前206—公元220)以人工制墨替代了天然墨:有了纸张之后,简牍锦帛逐失其用:砚台则随笔墨的使用而发展.“文房四宝”到宋朝(960--1279)以后特指湖笔(浙江湖州).徽墨(安徽徽州).宣纸(安徽宣州).端砚(广东肇庆,古称端州).可以说文房四宝书写了整个中华文明. The writing brush, inkstic…
SGU 解题报告(持续更新中...Ctrl+A可看题目类型): SGU101.Domino(多米诺骨牌)------------★★★type:图 SGU102.Coprimes(互质的数) SGU103.TrafficLights(交通灯)---------★★type:图 SGU104.LittleShopofFlowers(小花店)---★type:DP SGU105.Div3(整除3) SGU106.TheEquation(方程)-------------★type:数论 SGU107.…
Li Shan's oldest son was the perfect candidate to join the throngs of Chinese students studying abroad. But he chose Tsinghua University in Beijing. throng:人群,拥挤,众多 That is an unusual choice for a graduate of the elite Hong Kong International School,…
Chinese companies build iPads, high-speed trains and world-class telecom gear, but they can't seem to make their own fancy handbag. gear:齿轮,装置,工具 It's true that global giants from Prada to Apple source goods from China, but it is difficult to name a…
一.window占用了ctrl+空格的快捷键,影响开发工具的只能提示的使用. 二.解决方式: Go to Start > Type in regedit and start it (打开运行输入regedit) Navigate to HKEY_CURRENT_USER/Control Panel/Input Method/Hot Keys(定位到这个位置) Select the key named:(选择以下俩个语言) 00000070 for the Chinese (Traditional…
从浙江某电信ip的服务器上 ping 大陆外某个外网地址不通,报如下信息: From 202.97.60.193 icmp_seq=48 Time to live exceeded google,百度后,有人也遇到这种情况,是因为在路由过程中出现了环路,改用traceroute -n xx.xx.xx.xx 发现返回如下图结果: 看来是包一直在202.97.60.194 上来回传输,用http://www.ip138.com 查询此ip为上海电信的骨干ip, 应该是包在这个路由上出现了环路,所以…
OpenCascade Chinese Text Rendering eryar@163.com Abstract. OpenCascade uses advanced text rendering powered by FTGL library. The FreeType provides vector text rendering, as a result the text can be rotated and zoomed without quality loss. FreeType al…
NetSuite has a strong report customization application. The standard finance reports has a different layout of Chinese version. Take 3 reports as examples: P&L, Balance Sheet and Cash Flow. Below screenshots shows the capicity of report customization…
We Love MOE Girls Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 572    Accepted Submission(s): 378 Problem Description Chikami Nanako is a girl living in many different parallel worlds. In this…
Where this new investment is being targeted is also interesting雄性禿 . "If you look at the economic zones that North Korea was investing in, one of the key areas is Wonsan. So this is an economic zone on the east coast of North Korea. It faces Japan an…
Configure Amazon RDS mysql to store Chinese Characters https://dev.mysql.com/doc/refman/5.7/en/charset-applications.html http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-charac…
有感于Ruby Girls和Python Girls,在15年就想组织一次移动测试的妹子活动,框架选择Appium, 从15年夏天开始准备,申请Google的会议室,招募教练,开放报名,审核报名,到正式活动已经是16年的1月23号了,囧 当天上海还下起了大雪,不过丝毫不影响教练和妹子们的热情,学员20人实到17人. 活动日程表 时间 内容 10:00-10:30 签到 10:30-11:00 致欢迎词,介绍Testerhome和Appium Girls 11:00-12:30 WORKSHOP…
水概率....SGU里难得的水题.... 495. Kids and Prizes Time limit per test: 0.5 second(s)Memory limit: 262144 kilobytes input: standardoutput: standard ICPC (International Cardboard Producing Company) is in the business of producing cardboard boxes. Recently the…
NPY and girls Problem Description NPY's girlfriend blew him out!His honey doesn't love him any more!However, he has so many girlfriend candidates.Because there are too many girls and for the convenience of management, NPY numbered the girls from 1 to…
sgu 101 - Domino Time Limit:250MS     Memory Limit:4096KB     64bit IO Format:%I64d & %I64u Description Dominoes – game played with small, rectangular blocks of wood or other material, each identified by a number of dots, or pips, on its face. The bl…
http://acm.sgu.ru/problem.php?contest=0&problem=495 题意:N个箱子M个人,初始N个箱子都有一个礼物,M个人依次等概率取一个箱子,如果有礼物则拿出礼物放回盒子,如果没有礼物则不操作.问M个人拿出礼物个数的期望.(N,M<=100000) #include <cstdio> using namespace std; double mpow(double a, int n) { double r=1; while(n) { if(n&…