HDU 6373.Pinball -简单的计算几何+物理受力分析 (2018 Multi-University Training Contest 6 1012)
6373.Pinball
物理受力分析题目。

画的有点丑,通过受力分析,先求出θ角,为arctan(b/a),就是atan(b/a),然后将重力加速度分解为垂直斜面的和平行斜面的,垂直斜面的记为a1,平行斜面的记为a2。
a1=g*sinθ,a2=g*cosθ,然后算出小球到斜面的侧面高度h,以及小球到斜面底部的距离l,小球走h米高度所花费的时间t2为弹一次花费的时间,然后通过ll花费的时间t1为总时间,直接算倍数就是答案。
具体的代码注释。
代码:
//1012-6373-几何-物理题目
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<deque>
#include<iomanip>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
using namespace std;
typedef long long ll; const double PI=acos(-1.0);
const double eps=1e-;
const ll mod=1e9+;
const int inf=0x3f3f3f3f;
const int maxn=1e5+;
const int maxm=+;
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); int main()
{
int t;
cin>>t;
while(t--){
double a,b,x,y;
cin>>a>>b>>x>>y;
double g=9.8;//重力加速度
double sita=atan(b/a);//斜面倾角θ
double a1=g*sin(sita);//垂直斜面的加速度
double a2=g*cos(sita);//平行斜面的加速度
double h=(y+b/a*x)*cos(sita);//斜面高h
double l=(y+b/a*x)*sin(sita)+((-)*x)/cos(sita);//小球到斜面底的距离l
double t1=sqrt(*l/a1);//小球弹一次的时间
double t2=sqrt(*h/a2);//总的时间
int ans=;//开始的算一次
ans+=(t1-t2)/t2/;//去掉开始的
cout<<ans<<endl;
}
}
我是傻子。
HDU 6373.Pinball -简单的计算几何+物理受力分析 (2018 Multi-University Training Contest 6 1012)的更多相关文章
- HDU 6373 Pinball
Pinball Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total S ...
- HDU 4617 Weapon (简单三维计算几何,异面直线距离)
Weapon Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Subm ...
- HDU 6343.Problem L. Graph Theory Homework-数学 (2018 Multi-University Training Contest 4 1012)
6343.Problem L. Graph Theory Homework 官方题解: 一篇写的很好的博客: HDU 6343 - Problem L. Graph Theory Homework - ...
- hdu 3938 Portal(并查集+离线+kruskal)2011 Multi-University Training Contest 10
搜了题解才把题搞明白.明白之后发现其实题意很清晰,解题思路也很清晰,只是题目表述的很不清晰…… 大意如下—— 给你一个无向图,图中任意两点的距离是两点间所有路径上的某一条边,这条边需要满足两个条件:1 ...
- hdu 2818 Building Block(加权并查集)2009 Multi-University Training Contest 1
题意: 一共有30000个箱子,刚开始时都是分开放置的.接下来会有两种操作: 1. M x y,表示把x箱子所在的一摞放到y箱子那一摞上. 2. C y,表示询问y下方有多少个箱子. 输入: 首行输入 ...
- hdu 3047 Zjnu Stadium(加权并查集)2009 Multi-University Training Contest 14
题意: 有一个运动场,运动场的坐席是环形的,有1~300共300列座位,每列按有无限个座位计算T_T. 输入: 有多组输入样例,每组样例首行包含两个正整数n, m.分别表示共有n个人,m次操作. 接下 ...
- hdu 3461 Code Lock(并查集)2010 ACM-ICPC Multi-University Training Contest(3)
想不到这还可以用并查集解,不过后来证明确实可以…… 题意也有些难理解—— 给你一个锁,这个所由n个字母组成,然后这个锁有m个区间,每次可以对一个区间进行操作,并且区间中的所有字母要同时操作.每次操作可 ...
- HDU 5775 Bubble Sort(线段树)(2016 Multi-University Training Contest 4 1012)
原址地址:http://ibupu.link/?id=31 Problem Description P is a permutation of the integers from 1 to N(ind ...
- HDU 6330.Problem L. Visual Cube-模拟到上天-输出立方体 (2018 Multi-University Training Contest 3 1012)
6330.Problem L. Visual Cube 这个题就是输出立方体.当时写完怎么都不过,后来输出b<c的情况,发现这里写挫了,判断失误.加了点东西就过了,mdzz... 代码: //1 ...
随机推荐
- sql in()批量操作
//批量修改 update 表A set A.name='n' where A.id in(字符串); //批量删除 delete from 表名称 where 列名称 ...
- P3434 [POI2006]KRA-The Disks
题目描述 For his birthday present little Johnny has received from his parents a new plaything which cons ...
- [Leetcode] plus one 加一
Given a number represented as an array of digits, plus one to the number. 题意:给定数以数组的形式存储,然后计算该数加1的值. ...
- 雪碧图background-position的rem用法
background的雪碧图配合rem就正常写即可,要加上background-size,大小为sprites的原图尺寸,宽高为一帧的尺寸.例如: .player{ width: 2.32rem; / ...
- LowercaseRoutesMVC ASP.NET MVC routes to lowercase URLs
About this Project Tired of your MVC application generating mixed-case URLs like http://mysite.com/H ...
- 安卓的progress
https://www.cnblogs.com/wolipengbo/archive/2013/10/23/3383667.html
- CSS3奇偶选择器
.search-form td:nth-child(odd){//奇 width:100px; text-align:right;} .search-form td:nth-child(even){/ ...
- 全排列---(dfs)
全排列输入一个数n,按字典序输出1-n的全排列 #include "cstdio" #include "cstring" ],ans[],n; void dfs ...
- python读写Excel文件_xlrd模块读取,xlwt模块写入
一.安装xlrd模块和xlwt模块(服务器) 1. 下载xlrd模块和xlwt模块 到python官网http://pypi.python.org/pypi/xlrd下载模块.下载的文件例如:xlrd ...
- 【BZOJ4766】文艺计算姬 [暴力]
文艺计算姬 Time Limit: 1 Sec Memory Limit: 128 MB[Submit][Status][Discuss] Description "奋战三星期,造台计算机 ...