gym 100531 三维几何+搜索】的更多相关文章

精度有点毒, 其实可以不用double, 因为A, B必定在其中一个在三角形上,可以投影到只有x,y轴的地方叉积比较. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PII pair<int, int> #define PLI pair<LL, int> #define PLL pair<LL,…
Asteroids! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3159    Accepted Submission(s): 2106 Problem Description You're in space.You want to get home.There are asteroids.You don't want to hit…
Special Tetrahedron Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 328    Accepted Submission(s): 130 Problem Description Given n points which are in three-dimensional space(without repetition)…
原题链接:http://codeforces.com/gym/100431/attachments/download/2421/20092010-winter-petrozavodsk-camp-andrew-stankevich-contest-37-asc-37-en.pdf 题意 给你一个n,问你有多少a和x满足:x在a中二分会返回true,其中a的长度是n 题解 考虑到二分的过程不是向左就是向右,所以可以暴力搜索搞到若干序列,这些序列都是由向左或者向右组成的.枚举x,设向左的有i个,向右…
Solitaire 题目连接: http://codeforces.com/gym/100231/ Description 给你一个8*8棋盘,里面有4个棋子,每个棋子可以做一下某个操作之一: 1.走向相邻的空格 2.迈过相邻的棋子 然后给你初始状态和结束状态,问你能否得到呢? Input 第一行给你4个初始状态棋子的坐标 第二行给你4个结束状态棋子的坐标 Output 输出能否从初始状态走到结束状态 Sample Input 4 4 4 5 5 4 6 5 2 4 3 3 3 6 4 6 Sa…
https://codeforces.com/gym/100608 题意: 两个人玩游戏,每个人有一个长为d的b进制数字,两个人轮流摇一个$[0,b-1]$的骰子,并将选出的数字填入自己的d个空位之中 最后数字大的人赢 有两种玩法,第一个是轮流玩,一个是第一个人玩d次之后,第二个人玩 两个人都非常聪明,求第一个人的最大胜率 $d,b<=10,(b+1)^d<=3000$ 题解: 很有意思的是,他保证了$(b+1)^d<=3000$,也就是b+1进制数字不会超过3000的大小 我们考虑暴搜…
Description The famous Ghost Busters team has decided to upgrade their Ectomobile (aka Ecto-1) with a powerful proton gun and an advanced targeting system. Egon has designed and built all the hardware which consists of ectoplasmic scanner and a proto…
Problem Description Doctor D. are researching for a horrific weapon. The muzzle of the weapon is a circle. When it fires, rays form a cylinder that runs through the circle verticality in both side. If one cylinder of rays touch another, there will be…
链接: http://acm.hdu.edu.cn/showproblem.php?pid=4617 Weapon Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 224    Accepted Submission(s): 178 Problem Description Doctor D. are researching for a…
A - 棋盘问题:在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别.要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C. 解题思路:DFS,在这里有两个搜索方向,同时对每个位置的描述由xy坐标完成,第一次我尝试使用pair+vector保存棋盘位置,用两个数组描述放过棋子的行和列但是由于清除标记没做好WA了.这里是因为DFS搜索中状态转移没确定好,导致清楚标记复杂而出错,改为逐行递归逐列遍历.在这里…