题目链接:https://ac.nowcoder.com/acm/contest/992/F 题意:给定正n边形,边长为100,以每条边的中点连线构成新的正n边形,无限循环下去,求所有边的长度和. 思路:简单数学计算题,可以发现每往下进行一层,边长减小cos(PI/n)倍,在n趋于无穷求等比数列和即可. AC代码: #include<cstdio> #include<cmath> using namespace std; ); int n; int main(){ while(~s…
题目描述 In computer science, a binary tree is a tree data structure in which each node has at most two children. Consider an infinite full binary tree (each node has two children except the leaf nodes) defined as follows. For a node labelled v its left…
1808: 地铁 Description Bobo 居住在大城市 ICPCCamp. ICPCCamp 有 n 个地铁站,用 1,2,…,n 编号. m 段双向的地铁线路连接 n 个地铁站,其中第 i 段地铁属于 ci 号线,位于站 ai,bi 之间,往返均需要花费 ti 分钟(即从 ai 到 bi 需要 ti 分钟,从 bi 到 ai 也需要 ti 分钟). 众所周知,换乘线路很麻烦.如果乘坐第 i 段地铁来到地铁站 s,又乘坐第 j 段地铁离开地铁站 s,那么需要额外花费 |ci-cj |…
把点抽出来 跑个最短路就好啦. #include<bits/stdc++.h> #define LL long long #define pii pair<int,int> #define mk make_pair #define fi first #define se second using namespace std; +; ; const int inf=0x3f3f3f3f; const LL INF=0x3f3f3f3f3f3f3f3f; ; , -, , }, dy[…
题目链接:点这 github链接:(包含数据和代码,题解):点这 链接:https://www.nowcoder.com/acm/contest/104/E来源:牛客网 题目描述 (受限于评测机,此题数据范围与现场赛不一致,请谅解) Once upon a time, there was a beautiful princess named TQM, and a handsome prince named GSS. One day, the prince would like to visit…
HInton第8课,之所以说之二三,是因为训练RNN的四种方法之一:长短时记忆在lecture7中介绍过了,这里介绍的是第二和第三种方法:HF优化和Echo (这个字觉得翻译成回声是不是欠妥,所以保留着,不过个人觉得"回显"不错)状态网络.这课有两个论文作为背景可以看<Generating Text with Recurrent Neural Networks>和<Echo state network - Scholarpedia>. 一."Hessi…
1062 - Crossed Ladders PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB A narrow street is lined with tall buildings. An x foot long ladder is rested at the base of the building on the right side of the street and leans on t…
链接:https://www.nowcoder.com/acm/contest/163/F 来源:牛客网 2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 F Color it 时间限制:C/C++ 3秒,其他语言6秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 There is a matrix A that has N rows and M columns. Each grid (i,j)(0 ≤ i < N,…
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 F Color it (扫描线) 链接:https://ac.nowcoder.com/acm/contest/163/F来源:牛客网 时间限制:C/C++ 3秒,其他语言6秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 There is a matrix A that has N rows and M columns. Each grid (i,j)(0 ≤ i…
A------------------------------------------------------------------------------------ 题目链接:http://202.197.224.59/OnlineJudge2/index.php/problem/read/id/1260 题解:随机 n 个数把矩阵补全成 n × n 的.那么就是要算伴随矩阵的第一行,也就是逆矩阵的第一列,高斯消元即可. 源码:(Q神写的高斯消元,先贴一下诶,待补) #include<cs…